[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric.carlson at apple.com eric.carlson at apple.com
Wed Dec 22 12:38:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9c7fc72b35b1ea5c1345da885187e66b00a89968
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 26 16:45:43 2010 +0000

    2010-08-26  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Darin Adler and Maciej Stachowiak.
    
            https://bugs.webkit.org/show_bug.cgi?id=44013
            HTMLMediaElement should delay document load event
    
            Test: media/video-delay-load-event.html
    
            * dom/Document.cpp:
            (WebCore::Document::Document): Initialize incrementLoadEventDelayCount.
            (WebCore::Document::decrementLoadEventDelayCount): New, decrement incrementLoadEventDelayCount
            and call loader->checkCompleted() when it reaches zero.
            * dom/Document.h:
            (WebCore::Document::incrementLoadEventDelayCount): New.
            (WebCore::Document::isDelayingLoadEvent): New.
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::~HTMLMediaElement): Stop delaying the load event if necessary.
            (WebCore::HTMLMediaElement::willMoveToNewOwnerDocument): Ditto.
            (WebCore::HTMLMediaElement::didMoveToNewOwnerDocument): Delay the load event if we don't the
            meta data for the movie yet.
            (WebCore::HTMLMediaElement::prepareForLoad): Delay the load event.
            (WebCore::HTMLMediaElement::selectMediaResource): Don't delay the load event when there are
            no more sources to consider. Don't change m_delayingTheLoadEvent directly, call
            setShouldDelayLoadEvent() instead.
            (WebCore::HTMLMediaElement::waitForSourceChange): Stop delaying the load event.
            (WebCore::HTMLMediaElement::noneSupported): Ditto.
            (WebCore::HTMLMediaElement::mediaEngineError): Ditto.
            (WebCore::HTMLMediaElement::setReadyState): Ditto.
            (WebCore::HTMLMediaElement::userCancelledLoad): Ditto.
            (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): New, increment/decrement the document's
            load event delay count.
            * html/HTMLMediaElement.h:
    
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::checkCompleted): See if the document wants to delay completion for
            elements that don't go through a FrameLoader.
            (WebCore::FrameLoader::checkCallImplicitClose): Ditto
            * page/Frame.cpp:
    
    2010-08-26  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Darin Adler and Maciej Stachowiak.
    
            https://bugs.webkit.org/show_bug.cgi?id=44013
            HTMLMediaElement should delay document load event
    
            * media/video-delay-load-event-expected.txt: Added.
            * media/video-delay-load-event.html: Added.
            * media/video-layer-crash.html: Trigger test with script inline in the <body> instead
            of from an onload handler as that runs too late. Reformat script to make it readable.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66110 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 69b5387..0b53752 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-26  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Darin Adler and Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=44013
+        HTMLMediaElement should delay document load event
+
+        * media/video-delay-load-event-expected.txt: Added.
+        * media/video-delay-load-event.html: Added.
+        * media/video-layer-crash.html: Trigger test with script inline in the <body> instead
+        of from an onload handler as that runs too late. Reformat script to make it readable.
+
 2010-08-26  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/media/video-delay-load-event-expected.txt b/LayoutTests/media/video-delay-load-event-expected.txt
new file mode 100644
index 0000000..cea2a4d
--- /dev/null
+++ b/LayoutTests/media/video-delay-load-event-expected.txt
@@ -0,0 +1,32 @@
+ 
+Test the document's load event is delayed until a movie's meta data is available.
+
+
+inline script
+no 'src'.
+EXPECTED (video.networkState == '0') OK
+EXPECTED (video.readyState == '0') OK
+
+with 'src' attribute.
+EXPECTED (video.networkState == '3') OK
+EXPECTED (video.readyState == '0') OK
+
+with <source> element.
+EXPECTED (video.networkState == '3') OK
+EXPECTED (video.readyState == '0') OK
+
+document 'load' event handler
+no 'src'.
+EXPECTED (video.networkState == '0') OK
+EXPECTED (video.readyState == '0') OK
+
+with 'src' attribute.
+EXPECTED (video.networkState != '3') OK
+EXPECTED (video.networkState >= '1') OK
+EXPECTED (video.readyState >= '2') OK
+
+with <source> element.
+EXPECTED (video.networkState != '3') OK
+EXPECTED (video.networkState >= '1') OK
+EXPECTED (video.readyState >= '2') OK
+
diff --git a/LayoutTests/media/video-delay-load-event.html b/LayoutTests/media/video-delay-load-event.html
new file mode 100644
index 0000000..ae5e11c
--- /dev/null
+++ b/LayoutTests/media/video-delay-load-event.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<html>
+    <head>
+        <title>delay document 'load' event test</title>
+        <style> video { border: 3px solid red; } </style>
+        <script src=video-test.js></script>
+        <script src=media-file.js></script>
+        <script>
+            var video;
+
+            function testMovieWithNoSource(elem)
+            {
+                video = elem;   // Need it in a global for testExpected() to see it.
+                consoleWrite("<em>no 'src'.</em>");
+                testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_EMPTY, "==");
+                testExpected("video.readyState", HTMLMediaElement.prototype.HAVE_NOTHING, "==");
+            }
+
+            function testMovieWithSource(elem, hasLoaded, msg)
+            {
+                video = elem;   // Need it in a global for testExpected() to see it.
+                consoleWrite(msg);
+                if (hasLoaded) {
+                    // The movie should have loaded at least to HAVE_CURRENT_DATA
+                    testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_NO_SOURCE, "!=");
+                    testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_IDLE, ">=");
+                    testExpected("video.readyState", HTMLMediaElement.prototype.HAVE_CURRENT_DATA, ">=");
+                } else {
+                    testExpected("video.networkState", HTMLMediaElement.prototype.NETWORK_NO_SOURCE, "==");
+                    testExpected("video.readyState", HTMLMediaElement.prototype.HAVE_NOTHING, "==");
+                }
+            }
+
+            function loaded()
+            {
+                consoleWrite("<br><b>document <em>'load'<" + "/em> event handler</b>");
+
+                testMovieWithNoSource(document.getElementById('video-1'));
+                testMovieWithSource(document.getElementById('video-2'), true, "<br><em>with 'src' attribute.</em>");
+                testMovieWithSource(document.getElementById('video-3'), true, "<br><em>with &lt;source&gt; element.</em>");
+
+                if (window.layoutTestController)
+                    layoutTestController.notifyDone();
+            }
+        </script>
+    </head>
+    <body onload="loaded()">
+        <video id="video-1"></video>
+        <video id="video-2"></video>
+        <video id="video-3"><source id="source-1"></video>
+
+        <p>Test the document's load event is delayed until a movie's meta data is available.</p>
+
+        <script>
+            consoleWrite("<br><b>inline script</b>");
+
+            testMovieWithNoSource(document.getElementById('video-1'));
+
+            video = document.getElementById('video-2');
+            video.src = findMediaFile("video", "content/test");
+            testMovieWithSource(video, false, "<br><em>with 'src' attribute.</em>");
+
+            source = document.getElementById('source-1');
+            source.src = findMediaFile("video", "content/test");
+            testMovieWithSource(document.getElementById('video-3'), false, "<br><em>with &lt;source&gt; element.</em>");
+        </script>
+
+    </body>
+</html>
diff --git a/LayoutTests/media/video-layer-crash.html b/LayoutTests/media/video-layer-crash.html
index e4f2a78..b5844d6 100644
--- a/LayoutTests/media/video-layer-crash.html
+++ b/LayoutTests/media/video-layer-crash.html
@@ -1,12 +1,20 @@
-<script src="media-file.js"></script>
-<script src="video-paint-test.js"></script>
-<body onload="document.body.removeChild(document.getElementById('one')); document.body.offsetLeft; init()">
-<style>
-video { width:200px; border: 3px solid red; -webkit-box-reflect: below 5px; }
-</style>
-<p>Test dynamic removal of transformed and reflected video </p>
-&nbsp;<video id="one" style="-webkit-transform:rotate(20deg)"></video><br>
-&nbsp;<video style="-webkit-transform:scale(0.5)"></video><br>
-&nbsp;<video style="-webkit-transform:skew(20deg)"></video><br>
-<script>setSrcByTagName('video', findMediaFile('video', 'content/test'))</script>
-</body>
+<html>
+    <head>
+        <script src="media-file.js"></script>
+        <script src="video-paint-test.js"></script>
+        <style>
+            video { width:200px; border: 3px solid red; -webkit-box-reflect: below 5px; }
+        </style>
+    </head>
+    <body>
+        <p>Test dynamic removal of transformed and reflected video </p>
+        &nbsp;<video id="one" style="-webkit-transform:rotate(20deg)"></video><br>
+        &nbsp;<video style="-webkit-transform:scale(0.5)"></video><br>
+        &nbsp;<video style="-webkit-transform:skew(20deg)"></video><br>
+        <script>
+            setSrcByTagName('video', findMediaFile('video', 'content/test'));
+            document.body.removeChild(document.getElementById('one')); document.body.offsetLeft;
+            init();
+        </script>
+    </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8e14e2d..f4f2a1f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,44 @@
+2010-08-26  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Darin Adler and Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=44013
+        HTMLMediaElement should delay document load event
+
+        Test: media/video-delay-load-event.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::Document): Initialize incrementLoadEventDelayCount.
+        (WebCore::Document::decrementLoadEventDelayCount): New, decrement incrementLoadEventDelayCount 
+        and call loader->checkCompleted() when it reaches zero.
+        * dom/Document.h:
+        (WebCore::Document::incrementLoadEventDelayCount): New.
+        (WebCore::Document::isDelayingLoadEvent): New.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::~HTMLMediaElement): Stop delaying the load event if necessary.
+        (WebCore::HTMLMediaElement::willMoveToNewOwnerDocument): Ditto.
+        (WebCore::HTMLMediaElement::didMoveToNewOwnerDocument): Delay the load event if we don't the
+        meta data for the movie yet.
+        (WebCore::HTMLMediaElement::prepareForLoad): Delay the load event.
+        (WebCore::HTMLMediaElement::selectMediaResource): Don't delay the load event when there are 
+        no more sources to consider. Don't change m_delayingTheLoadEvent directly, call 
+        setShouldDelayLoadEvent() instead.
+        (WebCore::HTMLMediaElement::waitForSourceChange): Stop delaying the load event.
+        (WebCore::HTMLMediaElement::noneSupported): Ditto.
+        (WebCore::HTMLMediaElement::mediaEngineError): Ditto.
+        (WebCore::HTMLMediaElement::setReadyState): Ditto.
+        (WebCore::HTMLMediaElement::userCancelledLoad): Ditto.
+        (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): New, increment/decrement the document's
+        load event delay count.
+        * html/HTMLMediaElement.h:
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::checkCompleted): See if the document wants to delay completion for 
+        elements that don't go through a FrameLoader.
+        (WebCore::FrameLoader::checkCallImplicitClose): Ditto
+        * page/Frame.cpp:
+
 2010-08-26  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index dd7f1da..a29b6b1 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -397,6 +397,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
 #endif
     , m_weakReference(DocumentWeakReference::create(this))
     , m_idAttributeName(idAttr)
+    , m_loadEventDelayCount(0)
 {
     m_document = this;
 
@@ -4601,4 +4602,13 @@ InspectorController* Document::inspectorController() const
 }
 #endif
 
+void Document::decrementLoadEventDelayCount()
+{
+    ASSERT(m_loadEventDelayCount);
+    --m_loadEventDelayCount;
+
+    if (frame() && !m_loadEventDelayCount)
+        frame()->loader()->checkCompleted();
+}
+
 } // namespace WebCore
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 1c1ec00..18244a1 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -995,6 +995,11 @@ public:
     bool writeDisabled() const { return m_writeDisabled; }
     void setWriteDisabled(bool flag) { m_writeDisabled = flag; }
 
+    // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event.
+    void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; }
+    void decrementLoadEventDelayCount();
+    bool isDelayingLoadEvent() const { return m_loadEventDelayCount; }
+
 protected:
     Document(Frame*, const KURL&, bool isXHTML, bool isHTML);
 
@@ -1270,6 +1275,8 @@ private:
     HashSet<MediaCanStartListener*> m_mediaCanStartListeners;
 
     QualifiedName m_idAttributeName;
+
+    int m_loadEventDelayCount;
 };
 
 inline bool Document::hasElementWithId(AtomicStringImpl* id) const
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 2e7ffc5..6b334e2 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -37,7 +37,6 @@
 #include "ClientRect.h"
 #include "ClientRectList.h"
 #include "ContentType.h"
-#include "DocLoader.h"
 #include "Event.h"
 #include "EventNames.h"
 #include "ExceptionCode.h"
@@ -112,7 +111,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc)
     , m_processingMediaPlayerCallback(0)
     , m_playing(false)
     , m_isWaitingUntilMediaCanStart(false)
-    , m_delayingTheLoadEvent(false)
+    , m_shouldDelayLoadEvent(false)
     , m_haveFiredLoadedData(false)
     , m_inActiveDocument(true)
     , m_autoplaying(true)
@@ -140,6 +139,7 @@ HTMLMediaElement::~HTMLMediaElement()
 {
     if (m_isWaitingUntilMediaCanStart)
         document()->removeMediaCanStartListener(this);
+    setShouldDelayLoadEvent(false);
     document()->unregisterForDocumentActivationCallbacks(this);
     document()->unregisterForMediaVolumeCallbacks(this);
 }
@@ -148,6 +148,7 @@ void HTMLMediaElement::willMoveToNewOwnerDocument()
 {
     if (m_isWaitingUntilMediaCanStart)
         document()->removeMediaCanStartListener(this);
+    setShouldDelayLoadEvent(false);
     document()->unregisterForDocumentActivationCallbacks(this);
     document()->unregisterForMediaVolumeCallbacks(this);
     HTMLElement::willMoveToNewOwnerDocument();
@@ -157,6 +158,8 @@ void HTMLMediaElement::didMoveToNewOwnerDocument()
 {
     if (m_isWaitingUntilMediaCanStart)
         document()->addMediaCanStartListener(this);
+    if (m_readyState < HAVE_CURRENT_DATA)
+        setShouldDelayLoadEvent(true);
     document()->registerForDocumentActivationCallbacks(this);
     document()->registerForMediaVolumeCallbacks(this);
     HTMLElement::didMoveToNewOwnerDocument();
@@ -541,6 +544,11 @@ void HTMLMediaElement::prepareForLoad()
     m_playedTimeRanges = TimeRanges::create();
     m_lastSeekTime = 0;
     m_closedCaptionsVisible = false;
+
+    // The spec doesn't say to block the load event until we actually run the asynchronous section
+    // algorithm, but do it now because we won't start that until after the timer fires and the 
+    // event may have already fired by then.
+    setShouldDelayLoadEvent(true);
 }
 
 void HTMLMediaElement::loadInternal()
@@ -574,18 +582,19 @@ void HTMLMediaElement::selectMediaResource()
 
         if (!node) {
             m_loadState = WaitingForSource;
+            setShouldDelayLoadEvent(false);
 
             // ... set the networkState to NETWORK_EMPTY, and abort these steps
             m_networkState = NETWORK_EMPTY;
-            ASSERT(!m_delayingTheLoadEvent);
             return;
         }
 
         mode = children;
     }
 
-    // 4
-    m_delayingTheLoadEvent = true;
+    // 4 - Set the media element's delaying-the-load-event flag to true (this delays the load event), 
+    // and set its networkState to NETWORK_LOADING.
+    setShouldDelayLoadEvent(true);
     m_networkState = NETWORK_LOADING;
 
     // 5
@@ -709,7 +718,7 @@ void HTMLMediaElement::waitForSourceChange()
     m_networkState = NETWORK_NO_SOURCE;
 
     // 6.18 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
-    m_delayingTheLoadEvent = false;
+    setShouldDelayLoadEvent(false);
 }
 
 void HTMLMediaElement::noneSupported()
@@ -732,7 +741,7 @@ void HTMLMediaElement::noneSupported()
     scheduleEvent(eventNames().errorEvent);
 
     // 8 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
-    m_delayingTheLoadEvent = false;
+    setShouldDelayLoadEvent(false);
 
     // 9 -Abort these steps. Until the load() method is invoked, the element won't attempt to load another resource.
 
@@ -752,8 +761,7 @@ void HTMLMediaElement::mediaEngineError(PassRefPtr<MediaError> err)
     // set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE.
     m_error = err;
 
-    // 3 - Queue a task to fire a progress event called error at the media element, in
-    // the context of the fetching process started by this instance of this algorithm.
+    // 3 - Queue a task to fire a simple event named error at the media element.
     scheduleEvent(eventNames().errorEvent);
 
     // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value and queue a
@@ -762,7 +770,7 @@ void HTMLMediaElement::mediaEngineError(PassRefPtr<MediaError> err)
     scheduleEvent(eventNames().emptiedEvent);
 
     // 5 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
-    m_delayingTheLoadEvent = false;
+    setShouldDelayLoadEvent(false);
 
     // 6 - Abort the overall resource selection algorithm.
     m_currentSourceNode = 0;
@@ -909,21 +917,16 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
         scheduleEvent(eventNames().loadedmetadataEvent);
         if (renderer())
             renderer()->updateFromElement();
-        m_delayingTheLoadEvent = false;
         m_player->seek(0);
     }
 
     bool shouldUpdateDisplayState = false;
 
-    // 4.8.10.7 says loadeddata is sent only when the new state *is* HAVE_CURRENT_DATA: "If the
-    // previous ready state was HAVE_METADATA and the new ready state is HAVE_CURRENT_DATA", 
-    // but the event table at the end of the spec says it is sent when: "readyState newly 
-    // increased to HAVE_CURRENT_DATA  or greater for the first time"
-    // We go with the later because it seems useful to count on getting this event
     if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA && !m_haveFiredLoadedData) {
         m_haveFiredLoadedData = true;
         shouldUpdateDisplayState = true;
         scheduleEvent(eventNames().loadeddataEvent);
+        setShouldDelayLoadEvent(false);
     }
 
     bool isPotentiallyPlaying = potentiallyPlaying();
@@ -1812,13 +1815,12 @@ void HTMLMediaElement::userCancelledLoad()
     // 2 - Set the error attribute to a new MediaError object whose code attribute is set to MEDIA_ERR_ABORTED.
     m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED);
 
-    // 3 - Queue a task to fire a progress event called abort at the media element, in the context
-    // of the fetching process started by this instance of this algorithm.
+    // 3 - Queue a task to fire a simple event named error at the media element.
     scheduleEvent(eventNames().abortEvent);
 
-    // 5 - If the media element's readyState attribute has a value equal to HAVE_NOTHING, set the
-    // element's networkState attribute to the NETWORK_EMPTY value and queue a task to fire a
-    // simple event called emptied at the element. Otherwise, set set the element's networkState
+    // 4 - If the media element's readyState attribute has a value equal to HAVE_NOTHING, set the 
+    // element's networkState attribute to the NETWORK_EMPTY value and queue a task to fire a 
+    // simple event named emptied at the element. Otherwise, set the element's networkState 
     // attribute to the NETWORK_IDLE value.
     if (m_readyState == HAVE_NOTHING) {
         m_networkState = NETWORK_EMPTY;
@@ -1827,10 +1829,10 @@ void HTMLMediaElement::userCancelledLoad()
     else
         m_networkState = NETWORK_IDLE;
 
-    // 6 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
-    m_delayingTheLoadEvent = false;
+    // 5 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
+    setShouldDelayLoadEvent(false);
 
-    // 7 - Abort the overall resource selection algorithm.
+    // 6 - Abort the overall resource selection algorithm.
     m_currentSourceNode = 0;
 
     // Reset m_readyState since m_player is gone.
@@ -2081,6 +2083,18 @@ bool HTMLMediaElement::isURLAttribute(Attribute* attribute) const
     return attribute->name() == srcAttr;
 }
 
+void HTMLMediaElement::setShouldDelayLoadEvent(bool delay)
+{
+    if (m_shouldDelayLoadEvent == delay)
+        return;
+
+    m_shouldDelayLoadEvent = delay;
+    if (delay)
+        document()->incrementLoadEventDelayCount();
+    else
+        document()->decrementLoadEventDelayCount();
+}
+    
 }
 
 #endif
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 4706178..a98e19e 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -280,6 +280,8 @@ private:
 
     virtual void mediaCanStart();
 
+    void setShouldDelayLoadEvent(bool);
+
     // Restrictions to change default behaviors. This is effectively a compile time choice at the moment
     // because there are no accessor functions.
     enum BehaviorRestrictions {
@@ -339,7 +341,7 @@ private:
 
     bool m_playing : 1;
     bool m_isWaitingUntilMediaCanStart : 1;
-    bool m_delayingTheLoadEvent : 1;
+    bool m_shouldDelayLoadEvent : 1;
     bool m_haveFiredLoadedData : 1;
     bool m_inActiveDocument : 1;
     bool m_autoplaying : 1;
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 24888f2..a0cc2ee 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -831,6 +831,10 @@ void FrameLoader::checkCompleted()
     if (numRequests(m_frame->document()))
         return;
 
+    // Still waiting for elements that don't go through a FrameLoader?
+    if (m_frame->document()->isDelayingLoadEvent())
+        return;
+
     // OK, completed.
     m_isComplete = true;
 
@@ -879,7 +883,7 @@ void FrameLoader::scheduleCheckLoadComplete()
 
 void FrameLoader::checkCallImplicitClose()
 {
-    if (m_didCallImplicitClose || m_frame->document()->parsing())
+    if (m_didCallImplicitClose || m_frame->document()->parsing() || m_frame->document()->isDelayingLoadEvent())
         return;
 
     if (!allChildrenAreComplete())

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list