Title: [94787] trunk
Revision
94787
Author
eric.carl...@apple.com
Date
2011-09-08 13:19:34 -0700 (Thu, 08 Sep 2011)

Log Message

HTMLMediaElement is missing initialTime attribute
https://bugs.webkit.org/show_bug.cgi?id=67791

Reviewed by Darin Adler.

Source/WebCore: 

Test: media/media-initialTime.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::initialTime):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::initialTime):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::initialTime):

LayoutTests: 

* media/media-initialTime-expected.txt: Added.
* media/media-initialTime.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94786 => 94787)


--- trunk/LayoutTests/ChangeLog	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/LayoutTests/ChangeLog	2011-09-08 20:19:34 UTC (rev 94787)
@@ -1,3 +1,13 @@
+2011-09-08  Eric Carlson  <eric.carl...@apple.com>
+
+        HTMLMediaElement is missing initialTime attribute
+        https://bugs.webkit.org/show_bug.cgi?id=67791
+
+        Reviewed by Darin Adler.
+
+        * media/media-initialTime-expected.txt: Added.
+        * media/media-initialTime.html: Added.
+
 2011-09-03  Robert Hogan  <rob...@webkit.org>
 
         Elements with position:absolute don't move to correct position after images load

Added: trunk/LayoutTests/media/media-initialTime-expected.txt (0 => 94787)


--- trunk/LayoutTests/media/media-initialTime-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/media-initialTime-expected.txt	2011-09-08 20:19:34 UTC (rev 94787)
@@ -0,0 +1,8 @@
+Test the, so far unused, 'initialTime' attribute.
+
+EVENT(loadeddata)
+EXPECTED (video.initialTime == '0') OK
+RUN(video.initialTime = 10)
+EXPECTED (video.initialTime == '0') OK
+END OF TEST
+

Added: trunk/LayoutTests/media/media-initialTime.html (0 => 94787)


--- trunk/LayoutTests/media/media-initialTime.html	                        (rev 0)
+++ trunk/LayoutTests/media/media-initialTime.html	2011-09-08 20:19:34 UTC (rev 94787)
@@ -0,0 +1,32 @@
+<html>
+    <head>
+        <title>initialTime attribute test</title>
+        <script src=""
+        <script src=""
+
+        <script>
+            function loadeddata()
+            {
+                testExpected("video.initialTime", 0);
+                run("video.initialTime = 10");
+                testExpected("video.initialTime", 0);
+                endTest();
+            }
+
+            function start()
+            {
+                findMediaElement();
+                waitForEvent('loadeddata', loadeddata);
+
+                video.src = "" "content/test");
+            }
+
+        </script>
+    </head>
+
+    <body _onload_="start()">
+        <video controls> </video>
+        <p>Test the, so far unused, 'initialTime' attribute.</p>
+    
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (94786 => 94787)


--- trunk/Source/WebCore/ChangeLog	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/Source/WebCore/ChangeLog	2011-09-08 20:19:34 UTC (rev 94787)
@@ -1,3 +1,22 @@
+2011-09-08  Eric Carlson  <eric.carl...@apple.com>
+
+        HTMLMediaElement is missing initialTime attribute
+        https://bugs.webkit.org/show_bug.cgi?id=67791
+
+        Reviewed by Darin Adler.
+
+        Test: media/media-initialTime.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::initialTime):
+        * html/HTMLMediaElement.h:
+        * html/HTMLMediaElement.idl:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::initialTime):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::initialTime):
+
 2011-09-03  Robert Hogan  <rob...@webkit.org>
 
         Elements with position:absolute don't move to correct position after images load

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (94786 => 94787)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-09-08 20:19:34 UTC (rev 94787)
@@ -1472,6 +1472,13 @@
     return m_player->startTime();
 }
 
+double HTMLMediaElement::initialTime() const
+{
+    if (!m_player)
+        return 0;
+    return m_player->initialTime();
+}
+
 float HTMLMediaElement::duration() const
 {
     if (m_player && m_readyState >= HAVE_METADATA)

Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (94786 => 94787)


--- trunk/Source/WebCore/html/HTMLMediaElement.h	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h	2011-09-08 20:19:34 UTC (rev 94787)
@@ -111,6 +111,7 @@
 // playback state
     float currentTime() const;
     void setCurrentTime(float, ExceptionCode&);
+    double initialTime() const;
     float startTime() const;
     float duration() const;
     bool paused() const;

Modified: trunk/Source/WebCore/html/HTMLMediaElement.idl (94786 => 94787)


--- trunk/Source/WebCore/html/HTMLMediaElement.idl	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/Source/WebCore/html/HTMLMediaElement.idl	2011-09-08 20:19:34 UTC (rev 94787)
@@ -60,6 +60,7 @@
     // playback state
     attribute float currentTime
         setter raises (DOMException);
+    readonly attribute double initialTime;
     readonly attribute float startTime;
     readonly attribute float duration;
     readonly attribute boolean paused;

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (94786 => 94787)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2011-09-08 20:19:34 UTC (rev 94787)
@@ -459,6 +459,11 @@
     return m_private->startTime();
 }
 
+double MediaPlayer::initialTime() const
+{
+    return m_private->initialTime();
+}
+
 float MediaPlayer::currentTime() const
 {
     return m_private->currentTime();

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (94786 => 94787)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2011-09-08 20:19:34 UTC (rev 94787)
@@ -234,6 +234,8 @@
 
     float startTime() const;
 
+    double initialTime() const;
+
     float rate() const;
     void setRate(float);
 

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (94786 => 94787)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2011-09-08 20:03:54 UTC (rev 94786)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2011-09-08 20:19:34 UTC (rev 94787)
@@ -72,6 +72,8 @@
 
     virtual float startTime() const { return 0; }
 
+    virtual double initialTime() const { return 0; }
+
     virtual void setRate(float) = 0;
     virtual void setPreservesPitch(bool) { }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to