script.text shouldn't include text from non-direct children of the script element
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Oct 2015 02:26:13 +0000 (02:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Oct 2015 02:26:13 +0000 (02:26 +0000)
commita2bc60a0b65e3cedd235180e672f106cf5748f9b
treed6ca9e9fe45f91830c14776defdd1176ce26201b
parentfe6928d207fd19f93abb90258d0783c82434e049
script.text shouldn't include text from non-direct children of the script element
https://bugs.webkit.org/show_bug.cgi?id=148851
<rdar://problem/22587759>

Patch by Keith Rollin <krollin@apple.com> on 2015-10-07
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaseline several W3C HTML tests now that new checks are passing.

* web-platform-tests/html/semantics/scripting-1/the-script-element/script-text-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-text-xhtml-expected.txt:

Source/WebCore:

Don't include text from non-direct children in script.text. Per:
https://html.spec.whatwg.org/multipage/scripting.html#dom-script-text
Chrome and Firefox behavior match the spec.

Test: fast/dom/script-subtext-in-script-elements.html

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::scriptContent):

LayoutTests:

script-getElementById-during-insertion removed because it no longer
runs correctly with this change.

* fast/dom/script-getElementById-during-insertion-expected.txt: Removed.
* fast/dom/script-getElementById-during-insertion.html: Removed.
* fast/dom/script-subtext-in-script-elements-expected.txt: Added.
* fast/dom/script-subtext-in-script-elements.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/script-getElementById-during-insertion-expected.txt [deleted file]
LayoutTests/fast/dom/script-getElementById-during-insertion.html [deleted file]
LayoutTests/fast/dom/script-subtext-in-script-elements-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/script-subtext-in-script-elements.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-text-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-text-xhtml-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/ScriptElement.cpp