summaryrefslogtreecommitdiffstats
path: root/dom/base/nsDocument.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 07:25:14 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 07:25:14 -0400
commitfd7a325bc08f1f027b692181b6c7ab5efaf619aa (patch)
tree2d5fffa0474fea1a9d2f4fb855e6aabdf4b05d4c /dom/base/nsDocument.cpp
parentf0b7ba1e2b49858ce2755c61beebe3694cae882f (diff)
downloadUXP-fd7a325bc08f1f027b692181b6c7ab5efaf619aa.tar
UXP-fd7a325bc08f1f027b692181b6c7ab5efaf619aa.tar.gz
UXP-fd7a325bc08f1f027b692181b6c7ab5efaf619aa.tar.lz
UXP-fd7a325bc08f1f027b692181b6c7ab5efaf619aa.tar.xz
UXP-fd7a325bc08f1f027b692181b6c7ab5efaf619aa.zip
Bug 1422931 - Fix crash with slot element and make webcomponents preference per-doc
Tag #1375
Diffstat (limited to 'dom/base/nsDocument.cpp')
-rw-r--r--dom/base/nsDocument.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index d69fff863..459ad6bdd 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1332,6 +1332,10 @@ nsIDocument::nsIDocument()
{
SetIsInDocument();
+ // Set this when document is created and value stays the same for the lifetime
+ // of the document.
+ mIsWebComponentsEnabled = nsContentUtils::IsWebComponentsEnabled();
+
PR_INIT_CLIST(&mDOMMediaQueryLists);
}
@@ -5686,6 +5690,12 @@ nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject)
}
bool
+nsDocument::IsWebComponentsEnabled(const nsINode* aNode)
+{
+ return aNode->OwnerDoc()->IsWebComponentsEnabled();
+}
+
+bool
nsDocument::IsWebComponentsEnabled(dom::NodeInfo* aNodeInfo)
{
if (nsContentUtils::IsWebComponentsEnabled()) {