[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric.carlson at apple.com eric.carlson at apple.com
Thu Apr 8 00:57:13 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 069746964757b56a9e604d5f1173fffa2a13a4fd
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 7 16:02:50 2010 +0000

    2010-01-07  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Maciej Stachowiak.
    
            https://bugs.webkit.org/show_bug.cgi?id=33272
            'abort' event still fired as a progress event
    
            rdar://6710625
            Test media/video-error-abort.html doesn't work
    
            Test: http/tests/media/video-error-abort.html
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::scheduleEvent): Incorporate code from enqueueEvent.
            (WebCore::HTMLMediaElement::loadInternal): Fix 'abort' event firing logic missed
            in https://bugs.webkit.org/show_bug.cgi?id=30513. Change order of initialization
            to match spec wording.
            * html/HTMLMediaElement.h: Remove enqueueEvent prototype.
    
    2010-01-07  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Maciej Stachowiak.
    
            https://bugs.webkit.org/show_bug.cgi?id=33272
            'abort' event still fired as a progress event
    
            rdar://6710625
            Test media/video-error-abort.html doesn't work
    
            * http/tests/media/video-error-abort-expected.txt: Copied from LayoutTests/media/video-error-abort-expected.txt.
            * http/tests/media/video-error-abort.html: Copied from LayoutTests/media/video-error-abort.html.
                Modified to run with slow loading cgi, add test to ensure that 'abort' event is not a
                progress event.
            * media/video-error-abort-expected.txt: Removed.
            * media/video-error-abort.html: Removed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52923 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a383b83..9cba298 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-01-07  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33272
+        'abort' event still fired as a progress event
+
+        rdar://6710625
+        Test media/video-error-abort.html doesn't work
+
+        * http/tests/media/video-error-abort-expected.txt: Copied from LayoutTests/media/video-error-abort-expected.txt.
+        * http/tests/media/video-error-abort.html: Copied from LayoutTests/media/video-error-abort.html.
+            Modified to run with slow loading cgi, add test to ensure that 'abort' event is not a
+            progress event.
+        * media/video-error-abort-expected.txt: Removed.
+        * media/video-error-abort.html: Removed.
+
 2010-01-07  Kim Grönholm  <kim.gronholm at nomovok.com>
 
         Reviewed by Antti Koivisto.
diff --git a/LayoutTests/http/tests/media/video-error-abort-expected.txt b/LayoutTests/http/tests/media/video-error-abort-expected.txt
new file mode 100644
index 0000000..9d7b331
--- /dev/null
+++ b/LayoutTests/http/tests/media/video-error-abort-expected.txt
@@ -0,0 +1,20 @@
+
+Test before movie is open
+EXPECTED (video.error == 'null') OK
+
+'loadstart' event
+EXPECTED (video.error == 'null') OK
+RUN(video.load())
+
+'abort' event
+EXPECTED (video.error == 'null') OK
+EXPECTED (event.lengthComputable == 'undefined') OK
+
+'loadstart' event
+EXPECTED (video.error == 'null') OK
+
+'canplaythrough' event
+EXPECTED (video.error == 'null') OK
+
+END OF TEST
+
diff --git a/LayoutTests/http/tests/media/video-error-abort.html b/LayoutTests/http/tests/media/video-error-abort.html
new file mode 100644
index 0000000..466fc0a
--- /dev/null
+++ b/LayoutTests/http/tests/media/video-error-abort.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML>
+<html>
+    <head>
+        <title>'abort' event test</title>
+        <script src=../../../media/media-file.js></script>
+        <script src=../../../media/video-test.js></script>
+        <script>
+            var didLoad = false;
+
+            function loadstart()
+            {
+                consoleWrite("<br><b><em>'loadstart'</em> event</b>");
+                testExpected("video.error", null);
+
+                if (didLoad)
+                    return; 
+                didLoad = true; 
+
+                // Force the element to reload, while the current movie is still loading,
+                // this should generate an 'abort' event
+                run("video.load()");
+            }
+
+            function abort()
+            {
+                consoleWrite("<br><b><em>'abort'</em> event</b>");
+                testExpected("video.error", null);
+
+                // Progress events have a 'lengthComputable' field, check to make sure this event
+                // doesn't have one.
+                testExpected("event.lengthComputable", undefined);
+            }
+
+            function canplaythrough()
+            {
+                consoleWrite("<br><b><em>'canplaythrough'</em> event</b>");
+                testExpected("video.error", null);
+
+                consoleWrite("");
+                endTest();
+            }
+
+            function start()
+            {
+                findMediaElement();
+
+                waitForEvent("error");
+
+                consoleWrite("<br><b>Test before movie is open</b>");
+                testExpected("video.error", null);
+
+                var movie = findMediaFile("video", "resources/test");
+                video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=256";
+            }
+        </script>
+    </head>
+
+    <body onload="start()">
+        <video controls
+            onloadstart="loadstart()"
+            onabort="abort()"
+            oncanplaythrough="canplaythrough()"
+            ></video>
+    </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/media/video-error-abort-expected.txt b/LayoutTests/media/video-error-abort-expected.txt
deleted file mode 100644
index 521d66f..0000000
--- a/LayoutTests/media/video-error-abort-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-EXPECTED (video.error == 'null') OK
-EVENT(loadstart)
-EVENT(abort)
-EXPECTED (video.error.code == '1') OK
-EVENT(loadstart)
-EVENT(canplaythrough)
-EXPECTED (video.error == 'null') OK
-END OF TEST
-
diff --git a/LayoutTests/media/video-error-abort.html b/LayoutTests/media/video-error-abort.html
deleted file mode 100644
index 6eb90c8..0000000
--- a/LayoutTests/media/video-error-abort.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<video controls></video>
-<script src=media-file.js></script>
-<script src=video-test.js></script>
-<script>
-    testExpected("video.error", null);
-    var didLoad = false;
-
-    waitForEvent("loadstart", function () { if (didLoad) return; didLoad = true; video.load(); });
-
-    waitForEvent("abort", function () { testExpected("video.error.code", MediaError.MEDIA_ERR_ABORTED); } );
-
-    waitForEvent('canplaythrough', function () { 
-        testExpected("video.error", null);
-        endTest();
-    } );
-
-    video.src = findMediaFile("video", "content/test");
-</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c45c3b4..ba9338f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-01-07  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=33272
+        'abort' event still fired as a progress event
+
+        rdar://6710625
+        Test media/video-error-abort.html doesn't work
+
+        Test: http/tests/media/video-error-abort.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::scheduleEvent): Incorporate code from enqueueEvent.
+        (WebCore::HTMLMediaElement::loadInternal): Fix 'abort' event firing logic missed
+        in https://bugs.webkit.org/show_bug.cgi?id=30513. Change order of initialization 
+        to match spec wording.
+        * html/HTMLMediaElement.h: Remove enqueueEvent prototype.
+
 2010-01-07  Kim Grönholm  <kim.gronholm at nomovok.com>
 
         Reviewed by Antti Koivisto.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index f2a1178..ba8f219 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -56,7 +56,6 @@
 #include "MediaPlayer.h"
 #include "MediaQueryEvaluator.h"
 #include "Page.h"
-#include "ProgressEvent.h"
 #include "RenderVideo.h"
 #include "RenderView.h"
 #include "ScriptEventListener.h"
@@ -300,12 +299,7 @@ void HTMLMediaElement::scheduleNextSourceChild()
 
 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
 {
-    enqueueEvent(Event::create(eventName, false, true));
-}
-
-void HTMLMediaElement::enqueueEvent(RefPtr<Event> event)
-{
-    m_pendingEvents.append(event);
+    m_pendingEvents.append(Event::create(eventName, false, true));
     if (!m_asyncEventTimer.isActive())
         m_asyncEventTimer.startOneShot(0);
 }
@@ -440,38 +434,19 @@ void HTMLMediaElement::prepareForLoad()
 
 void HTMLMediaElement::loadInternal()
 {
-    // 1 - If the load() method for this element is already being invoked, then abort these steps.
+    // If the load() method for this element is already being invoked, then abort these steps.
     if (m_processingLoad)
         return;
     m_processingLoad = true;
     
-    // Steps 2 and 3 were done in prepareForLoad()
-    
-    // 4 - If the media element's networkState is set to NETWORK_LOADING or NETWORK_IDLE, set
-    // the error attribute to a new MediaError object whose code attribute is set to
-    // MEDIA_ERR_ABORTED, fire a progress event called abort at the media element, in the
-    // context of the fetching process that is in progress for the element.
-    if (m_networkState == NETWORK_LOADING || m_networkState == NETWORK_IDLE) {
-        m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED);
-
-        // fire synchronous 'abort'
-        bool totalKnown = m_player && m_player->totalBytesKnown();
-        unsigned loaded = m_player ? m_player->bytesLoaded() : 0;
-        unsigned total = m_player ? m_player->totalBytes() : 0;
-        dispatchEvent(ProgressEvent::create(eventNames().abortEvent, totalKnown, loaded, total));
-    }
+    // Steps 1 and 2 were done in prepareForLoad()
 
-    // 5
-    m_error = 0;
-    m_autoplaying = true;
-    m_playedTimeRanges = TimeRanges::create();
-    m_lastSeekTime = 0;
-    m_closedCaptionsVisible = false;
-
-    // 6
-    setPlaybackRate(defaultPlaybackRate());
+    // 3 - If the media element's networkState is set to NETWORK_LOADING or NETWORK_IDLE, queue
+    // a task to fire a simple event named abort at the media element.
+    if (m_networkState == NETWORK_LOADING || m_networkState == NETWORK_IDLE)
+        scheduleEvent(eventNames().abortEvent);
 
-    // 7
+    // 4
     if (m_networkState != NETWORK_EMPTY) {
         m_networkState = NETWORK_EMPTY;
         m_readyState = HAVE_NOTHING;
@@ -482,9 +457,21 @@ void HTMLMediaElement::loadInternal()
             m_playing = false;
             m_player->seek(0);
         }
-        dispatchEvent(Event::create(eventNames().emptiedEvent, false, true));
+        scheduleEvent(eventNames().emptiedEvent);
     }
 
+    // 5 - Set the playbackRate attribute to the value of the defaultPlaybackRate attribute.
+    setPlaybackRate(defaultPlaybackRate());
+
+    // 6 - Set the error attribute to null and the autoplaying flag to true.
+    m_error = 0;
+    m_autoplaying = true;
+
+    m_playedTimeRanges = TimeRanges::create();
+    m_lastSeekTime = 0;
+    m_closedCaptionsVisible = false;
+
+    // 7 - Invoke the media element's resource selection algorithm.
     selectMediaResource();
     m_processingLoad = false;
 }
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index bc39dd7..4288c45 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -219,7 +219,6 @@ private:
     
     void scheduleTimeupdateEvent(bool periodicEvent);
     void scheduleEvent(const AtomicString& eventName);
-    void enqueueEvent(RefPtr<Event> event);
     
     // loading
     void selectMediaResource();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list