[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric.carlson at apple.com eric.carlson at apple.com
Thu Feb 4 21:26:57 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 4736a36004d379ecde8303cebdd2bae16f5854cc
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 25 06:21:09 2010 +0000

    2010-01-24  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Media element duration changes to zero after playing in reverse
            https://bugs.webkit.org/show_bug.cgi?id=34041
    
            Test: media/video-reverse-play-duration.html
    
            * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
            (WebCore::MediaPlayerPrivate::didEnd): QTKit's ended notification fires at time zero when
            playing in reverse, so don't reset duration in that case.
    
    2010-01-24  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Media element duration changes to zero after playing in reverse
            https://bugs.webkit.org/show_bug.cgi?id=34041
    
            * media/video-reverse-play-duration-expected.txt: Added.
            * media/video-reverse-play-duration.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53792 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 132e5e7..a0c0f56 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-24  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Media element duration changes to zero after playing in reverse
+        https://bugs.webkit.org/show_bug.cgi?id=34041
+
+        * media/video-reverse-play-duration-expected.txt: Added.
+        * media/video-reverse-play-duration.html: Added.
+
 2010-01-25  Roland Steiner  <rolandsteiner at chromium.org>
 
         Reviewed by Maciej Stachowiak.
diff --git a/LayoutTests/media/video-reverse-play-duration-expected.txt b/LayoutTests/media/video-reverse-play-duration-expected.txt
new file mode 100644
index 0000000..48cf561
--- /dev/null
+++ b/LayoutTests/media/video-reverse-play-duration-expected.txt
@@ -0,0 +1,16 @@
+Tests that duration is not set to zero when playing in reverse to the origin.
+
+
+EVENT(canplaythrough)
+EXPECTED (video.duration > '0') OK
+EXPECTED (video.currentTime == '0') OK
+RUN(video.currentTime = 0.3)
+
+EVENT(seeked)
+EXPECTED (video.currentTime.toFixed(1) == '0.3') OK
+RUN(video.play())
+RUN(video.playbackRate = -1)
+
+EXPECTED (video.duration > '0') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-reverse-play-duration.html b/LayoutTests/media/video-reverse-play-duration.html
new file mode 100644
index 0000000..a43c53d
--- /dev/null
+++ b/LayoutTests/media/video-reverse-play-duration.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+
+<html>
+    <head>
+        <title>local video</title>
+
+        <script src=media-file.js></script>
+        <script src=video-test.js></script>
+
+        <script>
+
+            var startedPlayback = 0;
+            var duration = 0;
+
+            function canplaythrough()
+            {
+                // Cache the duration, seek to 0.2 seconds
+                duration = video.duration;
+                testExpected("video.duration", 0, '>');
+                testExpected("video.currentTime", 0);
+                run("video.currentTime = 0.3");
+                consoleWrite("");
+            }
+
+            function seeked()
+            {
+                // Play backwards
+                testExpected("video.currentTime.toFixed(1)", 0.3);
+                run("video.play()");
+                run("video.playbackRate = -1");
+                startedPlayback = true;
+                consoleWrite("");
+            }
+
+            function timeupdate()
+            {
+                if (startedPlayback && video.currentTime == 0) {
+                    // Make sure the duration is still valid
+                    testExpected("video.duration", 0, '>');
+                    endTest();
+                }
+            }
+
+            function start()
+            {
+                findMediaElement();
+
+                waitForEvent("error");
+                waitForEvent('canplaythrough', canplaythrough);
+                waitForEvent('seeked', seeked);
+                video.addEventListener("timeupdate", timeupdate);
+
+                video.src = findMediaFile("video", "content/test");
+                consoleWrite("");
+            }
+
+        </script>
+    </head>
+    <body>
+        <video controls autobuffer></video>
+        <p>Tests that duration is not set to zero when playing in reverse to the origin.</p>
+        <script>start()</script>
+    </body>
+</html>
+
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8739145..c5f67eb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-24  Eric Carlson  <eric.carlson at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Media element duration changes to zero after playing in reverse
+        https://bugs.webkit.org/show_bug.cgi?id=34041
+
+        Test: media/video-reverse-play-duration.html
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivate::didEnd): QTKit's ended notification fires at time zero when 
+        playing in reverse, so don't reset duration in that case.
+
 2010-01-24  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index 3c79bf3..60b52f6 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -1045,8 +1045,11 @@ void MediaPlayerPrivate::didEnd()
 
     // Hang onto the current time and use it as duration from now on since QuickTime is telling us we
     // are at the end. Do this because QuickTime sometimes reports one time for duration and stops
-    // playback at another time, which causes problems in HTMLMediaElement.
-    m_cachedDuration = currentTime();
+    // playback at another time, which causes problems in HTMLMediaElement. QTKit's 'ended' event 
+    // fires when playing in reverse so don't update duration when at time zero!
+    float now = currentTime();
+    if (now > 0)
+        m_cachedDuration = now;
 
     updateStates();
     m_player->timeChanged();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list