2010-07-23 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jul 2010 22:14:02 +0000 (22:14 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jul 2010 22:14:02 +0000 (22:14 +0000)
commitdb575b8ca041dba36ad5f341449712f76ca7dba1
tree6cb13f32d5304172bbf19fe26689372ccfaeb34b
parent44dc8794dd782dd189dc605a495f8fa7c3401c69
2010-07-23  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        HTML5 Parser: document.write in a asynchronous script which is specified to load before page finish blows away document
        https://bugs.webkit.org/show_bug.cgi?id=42365

        * http/tests/misc/write-from-dom-script-expected.txt: Added.
        * http/tests/misc/write-from-dom-script.html: Added.
          - Test the scenario where a script added to the DOM asynchronously
            while the nesting level is >0.  It's supposed to have its calls to
            document.write blocked.
        * http/tests/misc/write-while-waiting.html:
          - Writes are only prevented from scripts that are added to the DOM.
            Scripts that run via setTimeout do not have their writes blocked.
2010-07-23  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        HTML5 Parser: document.write in a asynchronous script which is specified to load before page finish blows away document
        https://bugs.webkit.org/show_bug.cgi?id=42365

        This patch implements the changes Ian made to HTML5 to address these
        issues.  Let's try it and see how well it works.

        Test: http/tests/misc/write-from-dom-script.html

        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::write):
        * dom/Document.h:
        (WebCore::Document::writeDisabled):
        (WebCore::Document::setWriteDisabled):
        * dom/DocumentParser.h:
        (WebCore::DocumentParser::hasInsertionPoint):
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::insertedIntoDocument):
        (WebCore::ScriptElementData::ScriptElementData):
        (WebCore::ScriptElementData::evaluateScript):
        * dom/ScriptElement.h:
        (WebCore::ScriptElementData::writeDisabled):
        (WebCore::ScriptElementData::setWriteDisabled):
        * html/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::hasInsertionPoint):
        (WebCore::HTMLDocumentParser::insert):
        * html/HTMLDocumentParser.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63998 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/misc/write-from-dom-script-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/write-from-dom-script.html [new file with mode: 0644]
LayoutTests/http/tests/misc/write-while-waiting.html
WebCore/ChangeLog
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/DocumentParser.h
WebCore/dom/ScriptElement.cpp
WebCore/dom/ScriptElement.h
WebCore/html/HTMLDocumentParser.cpp
WebCore/html/HTMLDocumentParser.h
WebCore/html/HTMLInputStream.h
WebCore/html/HTMLScriptRunner.cpp
WebCore/html/HTMLScriptRunner.h