Bug 1422931 - Part 2: Make webcomponents preference per-doc. r=smaug

This is to fix the case where preference is restore to false when a
testcas ends, but nsDocument::DeleteShell is called afterwards. So, we
make the preference per-doc and once it is enabled for a document, it
stays enabled.
This commit is contained in:
Jessica Jong
2017-12-08 22:17:40 +08:00
parent 7fd704363c
commit b940e53eb8
12 changed files with 86 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ NS_NewHTMLSlotElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
RefPtr<mozilla::dom::NodeInfo> nodeInfo(aNodeInfo);
if (nsContentUtils::IsWebComponentsEnabled()) {
if (nsDocument::IsWebComponentsEnabled(nodeInfo->GetDocument())) {
already_AddRefed<mozilla::dom::NodeInfo> nodeInfoArg(nodeInfo.forget());
return new mozilla::dom::HTMLSlotElement(nodeInfoArg);
}