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
--- 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.");