Bug 742537 - Remove HTMLMediaElement.initialTime attribute. r=cpearce,doublec
authorAndrew Quartey <andrew.quartey@gmail.com>
Mon, 01 Apr 2013 20:38:54 -0400
changeset 126903 88ff175d85fec8ea0ef99c6326e0d5aac08d282f
parent 126902 e7ac9fca699c14670fe608b46dc30789046d0c53
child 126904 0a1e54662a84b1b81bc2ead6ebf6962a5c71eef2
push id25717
push userandrew.quartey@gmail.com
push dateTue, 02 Apr 2013 00:39:19 +0000
treeherdermozilla-inbound@88ff175d85fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, doublec
bugs742537
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 742537 - Remove HTMLMediaElement.initialTime attribute. r=cpearce,doublec
content/html/content/public/HTMLMediaElement.h
content/html/content/src/HTMLMediaElement.cpp
content/media/MediaDecoder.cpp
content/media/test/fragment_noplay.js
content/media/test/fragment_play.js
content/media/test/test_seekable1.html
dom/interfaces/html/nsIDOMHTMLMediaElement.idl
dom/webidl/HTMLMediaElement.webidl
--- a/content/html/content/public/HTMLMediaElement.h
+++ b/content/html/content/public/HTMLMediaElement.h
@@ -462,18 +462,16 @@ public:
   {
     SetHTMLBoolAttr(nsGkAtoms::muted, aMuted, aRv);
   }
 
   already_AddRefed<DOMMediaStream> GetMozSrcObject() const;
 
   void SetMozSrcObject(DOMMediaStream& aValue);
 
-  double InitialTime();
-
   bool MozPreservesPitch() const
   {
     return mPreservesPitch;
   }
 
   // XPCOM MozPreservesPitch() is OK
 
   bool MozAutoplayEnabled() const
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -3512,38 +3512,16 @@ void HTMLMediaElement::GetCurrentSpec(ns
 {
   if (mLoadingSrc) {
     mLoadingSrc->GetSpec(aString);
   } else {
     aString.Truncate();
   }
 }
 
-/* attribute double initialTime; */
-double
-HTMLMediaElement::InitialTime()
-{
-  // If there is no start fragment then the initalTime is zero.
-  // Clamp to duration if it is greater than duration.
-  double duration = Duration();
-
-  double time = mFragmentStart < 0.0 ? 0.0 : mFragmentStart;
-  if (time > duration) {
-    time = duration;
-  }
-
-  return time;
-}
-
-NS_IMETHODIMP HTMLMediaElement::GetInitialTime(double* aTime)
-{
-  *aTime = InitialTime();
-  return NS_OK;
-}
-
 /* attribute double mozFragmentEnd; */
 double
 HTMLMediaElement::MozFragmentEnd()
 {
   double duration = Duration();
 
   // If there is no end fragment, or the fragment end is greater than the
   // duration, return the duration.
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -1276,17 +1276,16 @@ bool MediaDecoder::IsMediaSeekable()
   NS_ENSURE_TRUE(GetStateMachine(), false);
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
   MOZ_ASSERT(OnDecodeThread() || NS_IsMainThread());
   return mMediaSeekable;
 }
 
 nsresult MediaDecoder::GetSeekable(TimeRanges* aSeekable)
 {
-  //TODO : change 0.0 to GetInitialTime() when available
   double initialTime = 0.0;
 
   // We can seek in buffered range if the media is seekable. Also, we can seek
   // in unbuffered ranges if the transport level is seekable (local file or the
   // server supports range requests, etc.)
   if (!IsMediaSeekable()) {
     return NS_OK;
   } else if (!IsTransportSeekable()) {
--- a/content/media/test/fragment_noplay.js
+++ b/content/media/test/fragment_noplay.js
@@ -1,15 +1,14 @@
 function test_fragment_noplay(v, start, end, is, ok, finish) {
 
 function onLoadedMetadata() {
   var s = start == null ? 0 : start;
   var e = end == null ? v.duration : end;
   var a = s - 0.15;
   var b = s + 0.15;
   ok(v.currentTime >= a && v.currentTime <= b, "loadedmetadata currentTime is " + a + " < " + v.currentTime + " < " + b);
-  ok(v.initialTime == s, "initialTime (" + v.initialTime + ") == start Time (" + s + ")");
   ok(v.mozFragmentEnd == e, "mozFragmentEnd (" + v.mozFragmentEnd + ") == end Time (" + e + ")");
   finish();
 }
 
 v.addEventListener("loadedmetadata", onLoadedMetadata, false);
 }
--- a/content/media/test/fragment_play.js
+++ b/content/media/test/fragment_play.js
@@ -4,17 +4,16 @@ var completed = false;
 var loadedMetadataRaised = false;
 var seekedRaised = false;
 var pausedRaised = false;
 
 function onLoadedMetadata() {
   var s = start == null ? 0 : start;
   var e = end == null ? v.duration : end;
   ok(v.currentTime == s, "loadedmetadata currentTime is " + v.currentTime + " != " + s);
-  ok(v.initialTime == s, "initialTime (" + v.initialTime + ") == start Time (" + s + ")");
   ok(v.mozFragmentEnd == e, "mozFragmentEnd (" + v.mozFragmentEnd + ") == end Time (" + e + ")");
   loadedMetadataRaised = true; 
   v.play();
 }
 
 function onSeeked() {
   if (completed)
     return;
--- a/content/media/test/test_seekable1.html
+++ b/content/media/test/test_seekable1.html
@@ -23,17 +23,16 @@ function finish_test(element) {
 var tests = [
 // Test using a finite media stream, and a server supporting range requests
 {
 setup : function(element) {
           is(element.seekable.length, 0, "seekable.length should be initialy 0.");
           element.addEventListener("loadedmetadata", function() {
               is(element.seekable.length, 1, "seekable.length should be 1 for a server supporting range requests.");
 
-              //TODO : change this by using element.initialTime
               is(element.seekable.start(0), 0.0, "The start of the first range should be the initialTime.");
               is(element.seekable.end(0), element.duration, "The end of the first range should be the duration.")
               finish_test(element);
               }, false);
         }
 }
 ];
 
--- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
@@ -22,17 +22,17 @@ interface nsIDOMMediaStream;
 
 // undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
 %{C++
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 %}
 
-[scriptable, uuid(488eb1d7-fa08-425e-bac4-f7dd59805352)]
+[scriptable, uuid(3c153ac6-1c6a-45e3-be14-8ca1baacedd2)]
 interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement
 {
   // error state
   readonly attribute nsIDOMMediaError error;
 
   // network state
            attribute DOMString src;
            attribute nsIDOMMediaStream mozSrcObject;
@@ -54,17 +54,16 @@ interface nsIDOMHTMLMediaElement : nsIDO
   const unsigned short HAVE_CURRENT_DATA = 2;
   const unsigned short HAVE_FUTURE_DATA = 3;
   const unsigned short HAVE_ENOUGH_DATA = 4;
   readonly attribute unsigned short readyState;
   readonly attribute boolean seeking;
 
   // playback state
            attribute double currentTime;
-  readonly attribute double initialTime;
   readonly attribute double duration;
   readonly attribute boolean paused;
            attribute double defaultPlaybackRate;
            attribute double playbackRate;
            attribute boolean mozPreservesPitch;
   readonly attribute nsIDOMTimeRanges played;
   readonly attribute nsIDOMTimeRanges seekable;
   readonly attribute boolean ended;
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -89,17 +89,16 @@ interface HTMLMediaElement : HTMLElement
   //readonly attribute VideoTrackList videoTracks;
   //readonly attribute TextTrackList textTracks;
   //TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language);
 };
 
 // Mozilla extensions:
 partial interface HTMLMediaElement {
   attribute MediaStream? mozSrcObject;
-  readonly attribute double initialTime;
   attribute boolean mozPreservesPitch;
   readonly attribute boolean mozAutoplayEnabled;
 
   // Mozilla extension: stream capture
   [Throws]
   MediaStream mozCaptureStream();
   [Throws]
   MediaStream mozCaptureStreamUntilEnded();