2010-11-10 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Nov 2010 07:37:47 +0000 (07:37 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Nov 2010 07:37:47 +0000 (07:37 +0000)
commit0ab14207d50dfd0248dbfcd0b887a4789e7fdb4d
tree9b4db9833b904a6db75b7a851af6013aeb1d2690
parentc9925d3e2061cbcb3fd9f08350b33ac9b976ec7c
2010-11-10  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Adam Barth.

        [HTML5] 10.2.8.4 Scripts that modify the page as it is being parsed
        https://bugs.webkit.org/show_bug.cgi?id=49364

        Fixed HTMLScriptRunner's executeScript to use the ScriptController of the frame to which script element belongs
        as supposed to that of the frame associated with the HTMLScriptRunner.

        See also: http://www.whatwg.org/specs/web-apps/current-work/#scripts-that-modify-the-page-as-it-is-being-parsed

        Test: fast/parser/script-modify-page-outer.html

        * html/parser/HTMLScriptRunner.cpp:
        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Calls executeScript.
        (WebCore::HTMLScriptRunner::executeScript): Uses the correct ScriptController instance.
        (WebCore::HTMLScriptRunner::runScript): Call executeScript.
        * html/parser/HTMLScriptRunner.h:
2010-11-10  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Adam Barth.

        [HTML5] 10.2.8.4 Scripts that modify the page as it is being parsed
        https://bugs.webkit.org/show_bug.cgi?id=49364

        Added a test to ensure moving the script element to the parent document as it is being parsed
        changes the script's global object to the parent document's window object.

        See also: http://www.whatwg.org/specs/web-apps/current-work/#scripts-that-modify-the-page-as-it-is-being-parsed

        * fast/parser/move-during-parsing-expected.txt:
        * fast/parser/resources/script-modify-page-inner.html: Added.
        * fast/parser/script-modify-page-outer-expected.txt: Added.
        * fast/parser/script-modify-page-outer.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/parser/move-during-parsing-expected.txt
LayoutTests/fast/parser/resources/script-modify-page-inner.html [new file with mode: 0644]
LayoutTests/fast/parser/script-modify-page-outer-expected.txt [new file with mode: 0644]
LayoutTests/fast/parser/script-modify-page-outer.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/parser/HTMLScriptRunner.cpp
WebCore/html/parser/HTMLScriptRunner.h