[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:03:22 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8fec90f7795b4982607fc458ba6b90fb91f7b48f
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 30 21:43:57 2009 +0000

    2009-11-30  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Simon Fraser.
    
            All HTML5 media element events should be regular events
            https://bugs.webkit.org/show_bug.cgi?id=30513
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::selectMediaResource):
            (WebCore::HTMLMediaElement::noneSupported):
            (WebCore::HTMLMediaElement::mediaEngineError):
            (WebCore::HTMLMediaElement::setNetworkState):
            (WebCore::HTMLMediaElement::userCancelledLoad):
                Call scheduleEvent instead of scheduleProgressEvent.
            (WebCore::HTMLMediaElement::progressEventTimerFired):
                Call scheduleEvent instead of scheduleProgressEvent. Call renderer->updateFromElement
                after scheduling a 'progress' event so the controller will update download
                progress indicator.
            * html/HTMLMediaElement.h:
                Remove scheduleProgressEvent prototype.
    
    2009-11-30  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Simon Fraser.
    
            All HTML5 media element events should be regular events
            https://bugs.webkit.org/show_bug.cgi?id=30513
    
            Remove progress event tests.
    
            * media/progress-event-at-least-one-expected.txt: Removed.
            * media/progress-event-at-least-one.html: Removed.
            * media/progress-event-expected.txt: Removed.
            * media/progress-event-total-expected.txt: Removed.
            * media/progress-event-total.html: Removed.
            * media/progress-event.html: Removed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51511 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 20b2a03..7232df5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2009-11-30  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        All HTML5 media element events should be regular events
+        https://bugs.webkit.org/show_bug.cgi?id=30513
+        
+        Remove progress event tests.
+
+        * media/progress-event-at-least-one-expected.txt: Removed.
+        * media/progress-event-at-least-one.html: Removed.
+        * media/progress-event-expected.txt: Removed.
+        * media/progress-event-total-expected.txt: Removed.
+        * media/progress-event-total.html: Removed.
+        * media/progress-event.html: Removed.
+
 2009-11-30  Yuzo Fujishima  <yuzo at google.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/media/progress-event-at-least-one-expected.txt b/LayoutTests/media/progress-event-at-least-one-expected.txt
deleted file mode 100644
index 353eb0d..0000000
--- a/LayoutTests/media/progress-event-at-least-one-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Test that at least one 'progress' event is fired before the 'load' event.
-
-RUN(mediaElement = document.createElement('audio'))
-RUN(mediaElement.src = 'content/test.wav')
-RUN(mediaElement.load())
-
-EVENT(loadstart)
-EVENT(durationchange)
-EVENT(loadedmetadata)
-EVENT(loadeddata)
-EVENT(canplaythrough)
-EXPECTED (progressEventCount >= '1') OK
-END OF TEST
-
diff --git a/LayoutTests/media/progress-event-at-least-one.html b/LayoutTests/media/progress-event-at-least-one.html
deleted file mode 100644
index d129156..0000000
--- a/LayoutTests/media/progress-event-at-least-one.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<html>
-    <head>
-        <script src=media-file.js></script>
-        <script src=video-test.js></script>
-
-        <script>
-
-            var progressEventCount = 0;
-
-            function progress()
-            {
-                // 'progress' events can fire an arbitrary number of times if the
-                // file loads slowly, and the order of the first event in relation
-                // to the other events is not guaranteed, and we only want to ensure
-                // that AT LEAST one is fired so just count the number of events instead
-                // of logging them.
-                if (++progressEventCount > 1)
-                    return;
-            }
-
-            function canplaythrough()
-            {
-                consoleWrite("EVENT(canplaythrough)");
-                
-                testExpected('progressEventCount', 1, '>=');
-                endTest();
-            }
-
-            function start()
-            {
-                run("mediaElement = document.createElement('audio')");
-
-                mediaElement.setAttribute('oncanplaythrough', "canplaythrough()");
-                mediaElement.setAttribute('onprogress', "progress()");
-
-                waitForEvent("loadstart");
-                waitForEvent("loaded");
-                waitForEvent("waiting");
-                waitForEvent("ratechange");
-                waitForEvent("durationchange");
-                waitForEvent("pause");
-                waitForEvent("play");
-                waitForEvent("playing");
-                waitForEvent('loadedmetadata');
-                waitForEvent('loadeddata');
-
-                var mediaFile = findMediaFile("audio", "content/test");
-                run("mediaElement.src = '" + mediaFile + "'");
-                run("mediaElement.load()");
-
-                consoleWrite("");
-            }
-
-        </script>
-    </head>
-
-    <body onload="start()">
-
-    <p>Test that at least one 'progress' event is fired before the 'load' event.</p>
-
-    </body>
-</html>
diff --git a/LayoutTests/media/progress-event-expected.txt b/LayoutTests/media/progress-event-expected.txt
deleted file mode 100644
index 72c0b26..0000000
--- a/LayoutTests/media/progress-event-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-EVENT(loadstart)
-EXPECTED (!event.lengthComputable == 'true') OK
-EXPECTED (event.total == '0') OK
-EXPECTED (event.loaded == '0') OK
-END OF TEST
-
diff --git a/LayoutTests/media/progress-event-total-expected.txt b/LayoutTests/media/progress-event-total-expected.txt
deleted file mode 100644
index 818aab7..0000000
--- a/LayoutTests/media/progress-event-total-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-EVENT(loadstart)
-EXPECTED (!event.lengthComputable == 'true') OK
-EXPECTED (event.total == '0') OK
-EXPECTED (event.loaded == '0') OK
-EVENT(progress)
-EXPECTED (event.lengthComputable == 'true') OK
-EXPECTED (event.loaded > '0') OK
-END OF TEST
-
diff --git a/LayoutTests/media/progress-event-total.html b/LayoutTests/media/progress-event-total.html
deleted file mode 100644
index ed4959e..0000000
--- a/LayoutTests/media/progress-event-total.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<html>
-    <head>
-
-        <script src=media-file.js></script>
-        <script src=video-test.js></script>
-        <script>
-            function testOnLoadStart()
-            {
-                consoleWrite("EVENT(" + event.type + ")");
-                testExpected("!event.lengthComputable", true);
-                testExpected("event.total", 0);
-                testExpected("event.loaded", 0);
-            }
-        
-            function testOnProgress()
-            {
-                consoleWrite("EVENT(" + event.type + ")");
-                testExpected("event.lengthComputable", true);
-                testExpected("event.loaded", 0, '>');
-                endTest();
-            }
-
-            function start()
-            {
-                setSrcByTagName("video", findMediaFile("video", "content/test"));
-                findMediaElement();
-            }
-
-        </script>
-    </head>
-
-    <body onload="start()">
-
-        <video controls onloadstart="testOnLoadStart()" onprogress="testOnProgress()">
-        </video>
-
-    </body>
-</html>
diff --git a/LayoutTests/media/progress-event.html b/LayoutTests/media/progress-event.html
deleted file mode 100644
index 35cbff0..0000000
--- a/LayoutTests/media/progress-event.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<html>
-    <head>
-
-        <script src=media-file.js></script>
-        <script src=video-test.js></script>
-        <script>
-            function testOnLoadStart()
-            {
-                consoleWrite("EVENT(" + event.type + ")");
-                testExpected("!event.lengthComputable", true);
-                testExpected("event.total", 0);
-                testExpected("event.loaded", 0);
-                endTest();
-            }
-        
-            function start()
-            {
-                setSrcByTagName("video", findMediaFile("video", "content/test"));
-                findMediaElement();
-            }
-        </script>
-    </head>
-
-    <body onload="start()">
-
-        <video controls onloadstart="testOnLoadStart()" >
-        </video>
-
-    </body>
-</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 548ccdd..6692c4f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2009-11-30  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        All HTML5 media element events should be regular events
+        https://bugs.webkit.org/show_bug.cgi?id=30513
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::selectMediaResource):
+        (WebCore::HTMLMediaElement::noneSupported):
+        (WebCore::HTMLMediaElement::mediaEngineError):
+        (WebCore::HTMLMediaElement::setNetworkState):
+        (WebCore::HTMLMediaElement::userCancelledLoad):
+            Call scheduleEvent instead of scheduleProgressEvent.
+        (WebCore::HTMLMediaElement::progressEventTimerFired):
+            Call scheduleEvent instead of scheduleProgressEvent. Call renderer->updateFromElement
+            after scheduling a 'progress' event so the controller will update download
+            progress indicator.
+        * html/HTMLMediaElement.h:
+            Remove scheduleProgressEvent prototype.
+
 2009-11-30  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 99e2f1e..30f762a 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -297,24 +297,6 @@ void HTMLMediaElement::scheduleNextSourceChild()
     m_loadTimer.startOneShot(0);
 }
 
-void HTMLMediaElement::scheduleProgressEvent(const AtomicString& eventName)
-{
-    if (!m_sendProgressEvents)
-        return;
-
-    // FIXME: don't schedule timeupdate or progress events unless there are registered listeners
-
-    bool totalKnown = m_player && m_player->totalBytesKnown();
-    unsigned loaded = m_player ? m_player->bytesLoaded() : 0;
-    unsigned total = m_player ? m_player->totalBytes() : 0;
-
-    RefPtr<ProgressEvent> evt = ProgressEvent::create(eventName, totalKnown, loaded, total);
-    enqueueEvent(evt);
-
-    if (renderer())
-        renderer()->updateFromElement();
-}
-
 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
 {
     enqueueEvent(Event::create(eventName, false, true));
@@ -529,7 +511,7 @@ void HTMLMediaElement::selectMediaResource()
     m_networkState = NETWORK_LOADING;
 
     // 5
-    scheduleProgressEvent(eventNames().loadstartEvent);
+    scheduleEvent(eventNames().loadstartEvent);
 
     // 6 - If the media element has a src attribute, then run these substeps
     ContentType contentType("");
@@ -652,7 +634,7 @@ void HTMLMediaElement::noneSupported()
     // 7 - Queue a task to fire a progress event called error at the media element, in
     // the context of the fetching process that was used to try to obtain the media
     // resource in the resource fetch algorithm.
-    scheduleProgressEvent(eventNames().errorEvent);
+    scheduleEvent(eventNames().errorEvent);
 
     // 8 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
     m_delayingTheLoadEvent = false;
@@ -677,7 +659,7 @@ void HTMLMediaElement::mediaEngineError(PassRefPtr<MediaError> 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.
-    scheduleProgressEvent(eventNames().errorEvent);
+    scheduleEvent(eventNames().errorEvent);
 
     // 4 - 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.
@@ -744,7 +726,7 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
     if (state == MediaPlayer::Idle) {
         if (m_networkState > NETWORK_IDLE) {
             stopPeriodicTimers();
-            scheduleProgressEvent(eventNames().suspendEvent);
+            scheduleEvent(eventNames().suspendEvent);
         }
         m_networkState = NETWORK_IDLE;
     }
@@ -764,7 +746,7 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
 
             // Schedule one last progress event so we guarantee that at least one is fired
             // for files that load very quickly.
-            scheduleProgressEvent(eventNames().progressEvent);
+            scheduleEvent(eventNames().progressEvent);
 
             // Check to see if readyState changes need to be dealt with before sending the 
             // 'load' event so we report 'canplaythrough' first. This is necessary because a
@@ -773,7 +755,7 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
             if (static_cast<ReadyState>(currentState) != m_readyState)
                 setReadyState(currentState);
 
-            scheduleProgressEvent(eventNames().loadEvent);
+            scheduleEvent(eventNames().loadEvent);
         }
     }
 }
@@ -890,14 +872,16 @@ void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*)
 
     if (progress == m_previousProgress) {
         if (timedelta > 3.0 && !m_sentStalledEvent) {
-            scheduleProgressEvent(eventNames().stalledEvent);
+            scheduleEvent(eventNames().stalledEvent);
             m_sentStalledEvent = true;
         }
     } else {
-        scheduleProgressEvent(eventNames().progressEvent);
+        scheduleEvent(eventNames().progressEvent);
         m_previousProgress = progress;
         m_previousProgressTime = time;
         m_sentStalledEvent = false;
+        if (renderer())
+            renderer()->updateFromElement();
     }
 }
 
@@ -1657,7 +1641,7 @@ void HTMLMediaElement::userCancelledLoad()
 
     // 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.
-    scheduleProgressEvent(eventNames().abortEvent);
+    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
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index b868359..bc39dd7 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -218,7 +218,6 @@ private:
     void addPlayedRange(float start, float end);
     
     void scheduleTimeupdateEvent(bool periodicEvent);
-    void scheduleProgressEvent(const AtomicString& eventName);
     void scheduleEvent(const AtomicString& eventName);
     void enqueueEvent(RefPtr<Event> event);
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list