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
iframe srcdoc with quirky doctype should be no-quirks mode
https://bugs.webkit.org/show_bug.cgi?id=159489 Reviewed by Chris Dumez. This patch addresses the bug that a document in srcdoc can be in quirks mode due to DOCTYPE. New behavior of WebKit matches the spec, Gecko, and Blink. * LayoutTests/fast/parser/strict-mode-in-srcdoc-with-quirks-doctype-expected.txt: Added. * LayoutTests/fast/parser/strict-mode-in-srcdoc-with-quirks-doctype.html: Added. * LayoutTests/fast/frames/srcdoc/srcdoc-can-be-in-qurks-mode-expected.txt: * Source/WebCore/html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype): (WebCore::HTMLConstructionSite::insertDoctype): Canonical link: https://commits.webkit.org/253326@main
- Loading branch information
Showing
4 changed files
with
42 additions
and
2 deletions.
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ALERT: BackCompat | ||
ALERT: CSS1Compat | ||
Normally srcdoc documents default to standards mode, but they can end up in quirks mode with a sufficiently nutty DocType. |
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,13 @@ | ||
This tests that the documents in srcdoc are always in strict mode | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS frame1.contentDocument.compatMode is "CSS1Compat" | ||
PASS frame2.contentDocument.compatMode is "CSS1Compat" | ||
PASS frame3.contentDocument.compatMode is "CSS1Compat" | ||
PASS frame4.contentDocument.compatMode is "CSS1Compat" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script src='../../resources/js-test.js'></script> | ||
<iframe id="frame1" srcdoc='<!doctype x>'></iframe> | ||
<iframe id="frame2" srcdoc='<!doctype html public "-//w3c//dtd html 3.2//en">'></iframe> | ||
<iframe id="frame3" srcdoc='<!doctype "-//w3c//dtd html 3.2//en">'></iframe> | ||
<iframe id="frame4" srcdoc='<!doctype html -//w3c//dtd xhtml 1.0 frameset//">'></iframe> | ||
<script> | ||
|
||
description('This tests that the documents in srcdoc are always in strict mode'); | ||
|
||
onload = () => { | ||
shouldBeEqualToString('frame1.contentDocument.compatMode', 'CSS1Compat'); | ||
shouldBeEqualToString('frame2.contentDocument.compatMode', 'CSS1Compat'); | ||
shouldBeEqualToString('frame3.contentDocument.compatMode', 'CSS1Compat'); | ||
shouldBeEqualToString('frame4.contentDocument.compatMode', 'CSS1Compat'); | ||
} | ||
|
||
</script> | ||
</body> | ||
</html> |
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