Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Align <script type language> with the HTML Standard
https://bugs.webkit.org/show_bug.cgi?id=257080 rdar://109600797 Reviewed by Alexey Shvayka. In particular: - Stop supporting language attribute values in the type attribute value. - Stop supporting javascript1.6 and javascript1.7 altogether. - Strip ASCII whitespace rather than some variant of Unicode whitespace. In terms of interoperability: - The non-whitespace changes align WebKit with Chromium and Gecko. - The whitespace change align us with Gecko only. New test is upstreamed via web-platform-tests/wpt#40112. * LayoutTests/fast/html/script-allowed-types-languages-expected.txt: * LayoutTests/fast/html/script-allowed-types-languages.html: * LayoutTests/fast/tokenizer/004-expected.txt: * LayoutTests/fast/tokenizer/004.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-type-and-language-js-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-type-and-language-js-svg-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-type-and-language-js-xhtml-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-type-whitespace-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-type-whitespace.html: Added. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log: * LayoutTests/svg/custom/absolute-sized-content-with-resources.xhtml: * LayoutTests/svg/custom/relative-sized-content-with-resources.xhtml: * LayoutTests/svg/custom/relative-sized-content.xhtml: * LayoutTests/svg/custom/relative-sized-image.xhtml: * Source/WebCore/dom/ScriptElement.cpp: (WebCore::ScriptElement::determineScriptType): (WebCore::ScriptElement::determineScriptType const): (WebCore::ScriptElement::prepareScript): (WebCore::isLegacySupportedJavaScriptLanguage): Deleted. * Source/WebCore/dom/ScriptElement.h: * Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::XMLDocumentParser::endElementNs): Canonical link: https://commits.webkit.org/265977@main
- Loading branch information
Showing
17 changed files
with
84 additions
and
81 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
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
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
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
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
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
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
7 changes: 7 additions & 0 deletions
7
...m-tests/html/semantics/scripting-1/the-script-element/script-type-whitespace-expected.txt
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,7 @@ | ||
|
||
PASS Script shouldn't run with type="text/javascript" (parser-inserted) | ||
PASS Script shouldn't run with type="text/javascript…" (parser-inserted) | ||
PASS Script shouldn't run with type="text/javascript " (parser-inserted) | ||
PASS Script shouldn't run with type="text/javascript " (parser-inserted) | ||
PASS Script shouldn't run with type="text/javascript " (parser-inserted) | ||
|
27 changes: 27 additions & 0 deletions
27
...-platform-tests/html/semantics/scripting-1/the-script-element/script-type-whitespace.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!doctype html> | ||
<title><script type> non-ASCII whitespace handling</title> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<script> | ||
function testParserInsertedDidNotRun(description) { | ||
test(() => assert_false(window.ran), | ||
"Script shouldn't run with " + description + " (parser-inserted)"); | ||
window.ran = false; | ||
} | ||
</script> | ||
|
||
<script>window.ran = false;</script> | ||
<script type="text/javascript">window.ran = true;</script> | ||
<script>testParserInsertedDidNotRun("type=\"text/javascript\"");</script> | ||
|
||
<script type="text/javascript…">window.ran = true;</script> | ||
<script>testParserInsertedDidNotRun("type=\"text/javascript…\"");</script> | ||
|
||
<script type="text/javascript ">window.ran = true;</script> | ||
<script>testParserInsertedDidNotRun("type=\"text/javascript \"");</script> | ||
|
||
<script type="text/javascript ">window.ran = true;</script> | ||
<script>testParserInsertedDidNotRun("type=\"text/javascript \"");</script> | ||
|
||
<script type="text/javascript ">window.ran = true;</script> | ||
<script>testParserInsertedDidNotRun("type=\"text/javascript \"");</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
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
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
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
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
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
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
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