Changeset 262125 in webkit
- Timestamp:
- May 25, 2020 7:47:51 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r262124 r262125 1 2020-05-25 Rob Buis <rbuis@igalia.com> 2 3 Use child text content when determining whether to bail early in running a script 4 https://bugs.webkit.org/show_bug.cgi?id=182695 5 6 Reviewed by Youenn Fablet. 7 8 Update improved test results. 9 10 * web-platform-tests/html/semantics/scripting-1/the-script-element/emptyish-script-elements-expected.txt: 11 1 12 2020-05-22 Sergio Villar Senin <svillar@igalia.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/emptyish-script-elements-expected.txt
r249886 r262125 2 2 PASS A script with no children bails early, before setting already-started, so can be executed when adding text 3 3 PASS A script with a whitespace child executes, setting already-started, so adding text is a no-op 4 FAIL A script with an empty element inserted bails early, before setting already-started, so can be executed when adding text assert_true: expected true got undefined 5 FAIL A script with an empty text node inserted bails early, before setting already-started, so can be executed when adding text assert_true: expected true got undefined 4 PASS A script with an empty element inserted bails early, before setting already-started, so can be executed when adding text 5 PASS A script with an empty text node inserted bails early, before setting already-started, so can be executed when adding text 6 6 PASS A script with a text child inserted executes, setting already-started, so adding text is a no-op 7 FAIL A script with a comment child inserted bails early, before setting already-started, so can be executed when adding text assert_true: expected true got undefined 8 FAIL A script with an element containing text inserted bails early, before setting already-started, so can be executed when adding text assert_true: expected true got undefined 7 PASS A script with a comment child inserted bails early, before setting already-started, so can be executed when adding text 8 PASS A script with an element containing text inserted bails early, before setting already-started, so can be executed when adding text 9 9 -
trunk/Source/WebCore/ChangeLog
r262124 r262125 1 2020-05-25 Rob Buis <rbuis@igalia.com> 2 3 Use child text content when determining whether to bail early in running a script 4 https://bugs.webkit.org/show_bug.cgi?id=182695 5 6 Reviewed by Youenn Fablet. 7 8 Check that the text content is not empty instead of just checking 9 for the first child [1]. 10 11 Behavior matches Chrome and Firefox. 12 13 [1] https://html.spec.whatwg.org/#prepare-a-script step 5 and 6 14 15 Test: web-platform-tests/html/semantics/scripting-1/the-script-element/emptyish-script-elements.html 16 17 * dom/ScriptElement.cpp: 18 (WebCore::ScriptElement::prepareScript): 19 1 20 2020-05-22 Sergio Villar Senin <svillar@igalia.com> 2 21 -
trunk/Source/WebCore/dom/ScriptElement.cpp
r260709 r262125 182 182 m_forceAsync = true; 183 183 184 // FIXME: HTML5 spec says we should check that all children are either comments or empty text nodes.185 if (!hasSourceAttribute() && !m_element.firstChild())184 auto sourceText = scriptContent(); 185 if (!hasSourceAttribute() && sourceText.isEmpty()) 186 186 return false; 187 187 … … 267 267 ASSERT(scriptType == ScriptType::Classic); 268 268 TextPosition position = document.isInDocumentWrite() ? TextPosition() : scriptStartPosition; 269 executeClassicScript(ScriptSourceCode(s criptContent(), URL(document.url()), position, JSC::SourceProviderSourceType::Program, InlineClassicScript::create(*this)));269 executeClassicScript(ScriptSourceCode(sourceText, URL(document.url()), position, JSC::SourceProviderSourceType::Program, InlineClassicScript::create(*this))); 270 270 } 271 271
Note: See TracChangeset
for help on using the changeset viewer.