Skip to content
  • tonyg@chromium.org's avatar
    2010-10-21 Tony Gentilcore <tonyg@chromium.org> · 8500eb81
    tonyg@chromium.org authored
            Reviewed by Adam Barth.
    
            Ignore document.write() when it comes from a network task
            https://bugs.webkit.org/show_bug.cgi?id=47560
    
            write()s from deferred scripts are now ignored. This matches the latest
            Firefox 4 beta behavior. The defer-write expectations are updated, and
            the other tests are now all moot since deferred scrits can't write().
    
            * fast/dom/HTMLScriptElement/defer-double-defer-write-expected.txt: Removed.
            * fast/dom/HTMLScriptElement/defer-double-defer-write.html: Removed.
            * fast/dom/HTMLScriptElement/defer-double-write-expected.txt: Removed.
            * fast/dom/HTMLScriptElement/defer-double-write.html: Removed.
            * fast/dom/HTMLScriptElement/defer-write.html: Updated to match FF4.
            * fast/dom/HTMLScriptElement/remove-source-expected.txt: Added.
            * fast/dom/HTMLScriptElement/remove-source.html: Added. Verifies that writes are still ignored when the src is removed after the script is requested but before it is executed.
            * fast/dom/HTMLScriptElement/two-defer-writes-expected.txt: Removed.
            * fast/dom/HTMLScriptElement/two-defer-writes.html: Removed.
            * fast/dom/HTMLScriptElement/write-after-ignored-write-expected.txt: Added. Verifies that after a write from a network task is ignored, a write which is not from a network task still blows away the document.
            * fast/dom/HTMLScriptElement/write-after-ignored-write.html: Added.
    2010-10-21  Tony Gentilcore  <tonyg@chromium.org>
    
            Reviewed by Adam Barth.
    
            Ignore document.write() when it comes from a network task
            https://bugs.webkit.org/show_bug.cgi?id=47560
    
            This implements the update to the spec made by:
            http://www.w3.org/Bugs/Public/show_bug.cgi?id=9767
    
            It also matches the latest Firefox 4 beta. The notable change is that
            document.write from a deferred script no longer works. This avoids
            blowing the patch away.
    
            * dom/Document.cpp:
            (WebCore::Document::Document):
            (WebCore::Document::write):
            * dom/Document.h:
            (WebCore::DestructiveWriteCountIncrementer::DestructiveWriteCountIncrementer):
            (WebCore::Document::ignoreDestructiveWriteCountIncrementer):
            * dom/ScriptElement.cpp:
            (WebCore::ScriptElement::insertedIntoDocument):
            (WebCore::ScriptElementData::ScriptElementData):
            (WebCore::ScriptElementData::evaluateScript):
            * dom/ScriptElement.h:
            * html/parser/HTMLScriptRunner.cpp:
            (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8500eb81