Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
HTML parser should ignore head start tags in "in head noscript" state
https://bugs.webkit.org/show_bug.cgi?id=243976 Reviewed by Ryosuke Niwa. https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inheadnoscript * LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/inhead-noscript-head-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/inhead-noscript-head.html: Added. * Source/WebCore/html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processStartTag): Canonical link: https://commits.webkit.org/253489@main
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
|
||
PASS When the scripting flag is disabled, a head start tag in "in head noscript" mode should be ignored | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>Test that when the scripting flag is disabled, a head start tag in "in head noscript" mode is ignored</title> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<body> | ||
<script> | ||
promise_test(async function(t) { | ||
let iframe = document.createElement("iframe"); | ||
iframe.srcdoc = "<!DOCTYPE html><head><noscript><head><style></style>"; | ||
iframe.sandbox = "allow-same-origin"; | ||
let loaded = new Promise(resolve => iframe.onload = resolve); | ||
document.body.append(iframe); | ||
await loaded; | ||
assert_equals(String(iframe.contentDocument.querySelector("noscript").firstChild), "[object HTMLStyleElement]"); | ||
}, "When the scripting flag is disabled, a head start tag in \"in head noscript\" mode should be ignored"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters