Changeset 104927 in webkit


Ignore:
Timestamp:
Jan 13, 2012 6:20:20 AM (12 years ago)
Author:
jochen@chromium.org
Message:

Source/WebCore: Once we prepared a script element for execution, execute it, even if the script element was meanwhile removed from the dom tree.
https://bugs.webkit.org/show_bug.cgi?id=76083

Reviewed by Adam Barth.

This bug was caught by the following IE Test Center test:

http://samples.msdn.microsoft.com/ietestcenter/HTML5/show_async_test.htm?11_RemovingAsyncScript

Test: http/tests/misc/async-script-removed.html

http/tests/misc/async-script.html

  • dom/ScriptElement.cpp:
  • dom/ScriptElement.h:
  • dom/ScriptRunner.cpp:

(WebCore::ScriptRunner::queueScriptForExecution):

  • html/HTMLScriptElement.cpp:
  • html/HTMLScriptElement.h:
  • svg/SVGScriptElement.cpp:
  • svg/SVGScriptElement.h:

LayoutTests: Once we've prepared script element for execution, execute it, even if the script element was meanwhile removed from the dom tree.
https://bugs.webkit.org/show_bug.cgi?id=76083

Reviewed by Adam Barth.

  • http/tests/misc/async-script-expected.txt: Added.
  • http/tests/misc/async-script-removed-expected.txt: Added.
  • http/tests/misc/async-script-removed.html: Added.
  • http/tests/misc/async-script.html: Added.
  • http/tests/misc/resources/delayed-log.php: Added.
Location:
trunk
Files:
5 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r104921 r104927  
     12012-01-13  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Once we've prepared script element for execution, execute it, even if the script element was meanwhile removed from the dom tree.
     4        https://bugs.webkit.org/show_bug.cgi?id=76083
     5
     6        Reviewed by Adam Barth.
     7
     8        * http/tests/misc/async-script-expected.txt: Added.
     9        * http/tests/misc/async-script-removed-expected.txt: Added.
     10        * http/tests/misc/async-script-removed.html: Added.
     11        * http/tests/misc/async-script.html: Added.
     12        * http/tests/misc/resources/delayed-log.php: Added.
     13
    1142012-01-13  Alexander Pavlov  <apavlov@chromium.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r104926 r104927  
     12012-01-13  Jochen Eisinger  <jochen@chromium.org>
     2
     3        Once we prepared a script element for execution, execute it, even if the script element was meanwhile removed from the dom tree.
     4        https://bugs.webkit.org/show_bug.cgi?id=76083
     5
     6        Reviewed by Adam Barth.
     7
     8        This bug was caught by the following IE Test Center test:
     9
     10        http://samples.msdn.microsoft.com/ietestcenter/HTML5/show_async_test.htm?11_RemovingAsyncScript
     11
     12        Test: http/tests/misc/async-script-removed.html
     13              http/tests/misc/async-script.html
     14
     15        * dom/ScriptElement.cpp:
     16        * dom/ScriptElement.h:
     17        * dom/ScriptRunner.cpp:
     18        (WebCore::ScriptRunner::queueScriptForExecution):
     19        * html/HTMLScriptElement.cpp:
     20        * html/HTMLScriptElement.h:
     21        * svg/SVGScriptElement.cpp:
     22        * svg/SVGScriptElement.h:
     23
    1242012-01-12  Nikolas Zimmermann  <nzimmermann@rim.com>
    225
  • trunk/Source/WebCore/dom/ScriptElement.cpp

    r101792 r104927  
    8181}
    8282
    83 void ScriptElement::removedFromDocument()
    84 {
    85     // Eventually stop loading any not-yet-finished content
    86     stopLoadRequest();
    87 }
    88 
    8983void ScriptElement::childrenChanged()
    9084{
  • trunk/Source/WebCore/dom/ScriptElement.h

    r101792 r104927  
    6868    // Helper functions used by our parent classes.
    6969    void insertedIntoDocument();
    70     void removedFromDocument();
    7170    void childrenChanged();
    7271    void handleSourceAttribute(const String& sourceUrl);
  • trunk/Source/WebCore/dom/ScriptRunner.cpp

    r101792 r104927  
    5757    Element* element = scriptElement->element();
    5858    ASSERT(element);
    59     ASSERT(element->inDocument());
    6059
    6160    m_document->incrementLoadEventDelayCount();
  • trunk/Source/WebCore/html/HTMLScriptElement.cpp

    r99742 r104927  
    8484    HTMLElement::insertedIntoDocument();
    8585    ScriptElement::insertedIntoDocument();
    86 }
    87 
    88 void HTMLScriptElement::removedFromDocument()
    89 {
    90     HTMLElement::removedFromDocument();
    91     ScriptElement::removedFromDocument();
    9286}
    9387
  • trunk/Source/WebCore/html/HTMLScriptElement.h

    r91404 r104927  
    4747    virtual void parseMappedAttribute(Attribute*);
    4848    virtual void insertedIntoDocument();
    49     virtual void removedFromDocument();
    5049    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
    5150    virtual void attributeChanged(Attribute*, bool preserveDecls = false);
  • trunk/Source/WebCore/svg/SVGScriptElement.cpp

    r96307 r104927  
    143143}
    144144
    145 void SVGScriptElement::removedFromDocument()
    146 {
    147     SVGElement::removedFromDocument();
    148     ScriptElement::removedFromDocument();
    149 }
    150 
    151145void SVGScriptElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
    152146{
  • trunk/Source/WebCore/svg/SVGScriptElement.h

    r91404 r104927  
    4848    virtual void parseMappedAttribute(Attribute*);
    4949    virtual void insertedIntoDocument();
    50     virtual void removedFromDocument();
    5150    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
    5251
Note: See TracChangeset for help on using the changeset viewer.