Backed out changeset 822a570ebc0a (bug 1892882) for causing wpt failures in idlharness.window.html?exclude=Node CLOSED TREE

This commit is contained in:
Cristian Tuns 2024-05-14 19:10:34 -04:00
parent ed693381d7
commit fb2ccec709
2 changed files with 0 additions and 28 deletions

View File

@ -418,8 +418,6 @@ nsresult nsHtml5Parser::Parse(const nsAString& aSourceBuffer, void* aKey,
executor->GetStage(), true);
mDocWriteSpeculativeTreeBuilder->setScriptingEnabled(
mTreeBuilder->isScriptingEnabled());
mDocWriteSpeculativeTreeBuilder->setAllowDeclarativeShadowRoots(
mTreeBuilder->isAllowDeclarativeShadowRoots());
mDocWriteSpeculativeTokenizer = mozilla::MakeUnique<nsHtml5Tokenizer>(
mDocWriteSpeculativeTreeBuilder.get(), false);
mDocWriteSpeculativeTokenizer->setInterner(&mAtomTable);
@ -650,8 +648,6 @@ nsresult nsHtml5Parser::StartExecutor() {
RefPtr<nsHtml5TreeOpExecutor> executor(mExecutor);
executor->SetParser(this);
mTreeBuilder->setScriptingEnabled(executor->IsScriptEnabled());
mTreeBuilder->setAllowDeclarativeShadowRoots(
executor->GetDocument()->AllowsDeclarativeShadowRoots());
mTreeBuilder->setIsSrcdocDocument(false);
@ -668,8 +664,6 @@ nsresult nsHtml5Parser::StartExecutor() {
nsresult nsHtml5Parser::Initialize(mozilla::dom::Document* aDoc, nsIURI* aURI,
nsISupports* aContainer,
nsIChannel* aChannel) {
mTreeBuilder->setAllowDeclarativeShadowRoots(
aDoc->AllowsDeclarativeShadowRoots());
return mExecutor->Init(aDoc, aURI, aContainer, aChannel);
}

View File

@ -1,22 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>`document.write` on inner iframe handles declarative shadow DOM</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe></iframe>
<script>
promise_test(async () => {
await new Promise(res => window.addEventListener("load", res));
let elem = document.querySelector("iframe");
elem.contentDocument.write(`
<div>
<template shadowrootmode="open"><slot></slot></template>
<p>Test</p>
</div>
`);
let container = elem.contentDocument.querySelector("div");
assert_true(!!container, "write should occur");
assert_true(!!container.shadowRoot, "write should create shadowroot");
assert_equals(container.innerText, "Test", "div should still contain text");
}, "`document.write` on inner iframe handles declarative shadow DOM");
</script>