зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1685828 - Stop calling SVG and MathML enabling helpers every time we check their enabling status. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101244
This commit is contained in:
Родитель
c60fdae7a4
Коммит
59be07e5b4
|
@ -362,6 +362,8 @@ static bool IsSystemOrAddonOrAboutPrincipal(nsIPrincipal* aPrincipal) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsNodeInfoManager::InternalSVGEnabled() {
|
bool nsNodeInfoManager::InternalSVGEnabled() {
|
||||||
|
MOZ_ASSERT(!mSVGEnabled, "Caller should use the cached mSVGEnabled!");
|
||||||
|
|
||||||
// If the svg.disabled pref. is true, convert all SVG nodes into
|
// If the svg.disabled pref. is true, convert all SVG nodes into
|
||||||
// disabled SVG nodes by swapping the namespace.
|
// disabled SVG nodes by swapping the namespace.
|
||||||
nsNameSpaceManager* nsmgr = nsNameSpaceManager::GetInstance();
|
nsNameSpaceManager* nsmgr = nsNameSpaceManager::GetInstance();
|
||||||
|
@ -396,6 +398,8 @@ bool nsNodeInfoManager::InternalSVGEnabled() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsNodeInfoManager::InternalMathMLEnabled() {
|
bool nsNodeInfoManager::InternalMathMLEnabled() {
|
||||||
|
MOZ_ASSERT(!mMathMLEnabled, "Caller should use the cached mMathMLEnabled!");
|
||||||
|
|
||||||
// If the mathml.disabled pref. is true, convert all MathML nodes into
|
// If the mathml.disabled pref. is true, convert all MathML nodes into
|
||||||
// disabled MathML nodes by swapping the namespace.
|
// disabled MathML nodes by swapping the namespace.
|
||||||
nsNameSpaceManager* nsmgr = nsNameSpaceManager::GetInstance();
|
nsNameSpaceManager* nsmgr = nsNameSpaceManager::GetInstance();
|
||||||
|
|
|
@ -101,13 +101,16 @@ class nsNodeInfoManager final {
|
||||||
/**
|
/**
|
||||||
* Returns true if SVG nodes in this document have real SVG semantics.
|
* Returns true if SVG nodes in this document have real SVG semantics.
|
||||||
*/
|
*/
|
||||||
bool SVGEnabled() { return mSVGEnabled.valueOr(InternalSVGEnabled()); }
|
bool SVGEnabled() {
|
||||||
|
return mSVGEnabled.valueOrFrom([this] { return InternalSVGEnabled(); });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if MathML nodes in this document have real MathML semantics.
|
* Returns true if MathML nodes in this document have real MathML semantics.
|
||||||
*/
|
*/
|
||||||
bool MathMLEnabled() {
|
bool MathMLEnabled() {
|
||||||
return mMathMLEnabled.valueOr(InternalMathMLEnabled());
|
return mMathMLEnabled.valueOrFrom(
|
||||||
|
[this] { return InternalMathMLEnabled(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::dom::DOMArena* GetArenaAllocator() { return mArena; }
|
mozilla::dom::DOMArena* GetArenaAllocator() { return mArena; }
|
||||||
|
|
Загрузка…
Ссылка в новой задаче