Bug 984259 - 1. remove dead code to please the eyes. 2. remove the don't-preload-less-when-loading-resource rule which is no more spec. r=cpearce
authorJW Wang <jwwang@mozilla.com>
Thu, 02 Oct 2014 23:34:00 +0200
changeset 232127 4de43ef387d279e6eadefcb39c34a828822a7911
parent 232126 ad8d4f7be999ff2205280fa37146b6d90b28456f
child 232128 f70e16de6f33742ae387b1f38d1aa960667b3cda
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs984259
milestone35.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 984259 - 1. remove dead code to please the eyes. 2. remove the don't-preload-less-when-loading-resource rule which is no more spec. r=cpearce
content/html/content/src/HTMLMediaElement.cpp
content/media/test/test_preload_actions.html
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -1057,23 +1057,16 @@ void HTMLMediaElement::UpdatePreloadActi
       }
     } else {
       // Use the suggested "missing value default" of "metadata", or the value
       // specified by the media.preload.default, if present.
       nextAction = static_cast<PreloadAction>(preloadDefault);
     }
   }
 
-  if ((mBegun || mIsRunningSelectResource) && nextAction < mPreloadAction) {
-    // We've started a load or are already downloading, and the preload was
-    // changed to a state where we buffer less. We don't support this case,
-    // so don't change the preload behaviour.
-    return;
-  }
-
   mPreloadAction = nextAction;
   if (nextAction == HTMLMediaElement::PRELOAD_ENOUGH) {
     if (mSuspendedForPreloadNone) {
       // Our load was previouly suspended due to the media having preload
       // value "none". The preload value has changed to preload:auto, so
       // resume the load.
       ResumeLoad(PRELOAD_ENOUGH);
     } else {
--- a/content/media/test/test_preload_actions.html
+++ b/content/media/test/test_preload_actions.html
@@ -381,44 +381,16 @@ var tests = [
       v.addEventListener("loadedmetadata", function(e){v._gotLoadedMetaData = true;}, false);
       v.addEventListener("loadeddata", this.loadeddata, false);
       v.src = test.name; // Causes implicit load.
       document.body.appendChild(v);
     },
 
     name: "test11",
   },
-  /*{
-    // 12. Change preload value from auto to metadata after load started,
-    // should still do full load, should not halt after metadata only.
-    // disable this test since the spec is no longer found in the document
-    // http://dev.w3.org/html5/spec-preview/media-elements.html
-    canplaythrough:
-    function(e) {
-      var v = e.target;
-      is(v._gotLoadedMetaData, true, "(12) Must get loadedmetadata.");
-      is(v._gotLoadStart, true, "(12) Must get loadstart.");
-      maybeFinish(v, 12);
-    },
-
-    setup:
-    function(v) {
-      v._gotLoadStart = false;
-      v._gotLoadedMetaData = false;
-      v.preload = "auto";
-      v.addEventListener("loadstart", function(e){v._gotLoadStart = true;}, false);
-      v.addEventListener("loadedmetadata", function(e){v._gotLoadedMetaData = true;}, false);
-      v.addEventListener("canplaythrough", this.canplaythrough, false);
-      v.src = test.name; // Causes implicit load.
-      document.body.appendChild(v);
-      v.preload = "metadata";
-    },
-
-    name: "test12",
-  },*/
   {
     // 13. Change preload value from auto to none after specifying a src
     // should load according to preload none, no buffering should have taken place
     suspend:
     function(e) {
       var v = e.target;
       is(v._gotLoadStart, true, "(13) Must get loadstart.");
       is(v._gotLoadedMetaData, false, "(13) Must not get loadedmetadata.");