mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 2e49069ac1ad
This commit is contained in:
parent
e3b4a4aee5
commit
1be89d99f3
@ -846,29 +846,24 @@ void nsHTMLMediaElement::UpdatePreloadAction()
|
||||
// Find the appropriate preload action by looking at the attribute.
|
||||
const nsAttrValue* val = mAttrsAndChildren.GetAttr(nsGkAtoms::preload,
|
||||
kNameSpaceID_None);
|
||||
PRUint32 preloadDefault = nsContentUtils::GetIntPref("media.preload.default",
|
||||
nsHTMLMediaElement::PRELOAD_ATTR_METADATA);
|
||||
PRUint32 preloadAuto = nsContentUtils::GetIntPref("media.preload.auto",
|
||||
nsHTMLMediaElement::PRELOAD_ENOUGH);
|
||||
if (!val) {
|
||||
// Attribute is not set. Use the preload action specified by the
|
||||
// media.preload.default pref, or just preload metadata if not present.
|
||||
nextAction = static_cast<PreloadAction>(preloadDefault);
|
||||
// Attribute is not set. The default is to load metadata.
|
||||
nextAction = nsHTMLMediaElement::PRELOAD_METADATA;
|
||||
} else if (val->Type() == nsAttrValue::eEnum) {
|
||||
PreloadAttrValue attr = static_cast<PreloadAttrValue>(val->GetEnumValue());
|
||||
if (attr == nsHTMLMediaElement::PRELOAD_ATTR_EMPTY ||
|
||||
attr == nsHTMLMediaElement::PRELOAD_ATTR_AUTO)
|
||||
{
|
||||
nextAction = static_cast<PreloadAction>(preloadAuto);
|
||||
nextAction = nsHTMLMediaElement::PRELOAD_ENOUGH;
|
||||
} else if (attr == nsHTMLMediaElement::PRELOAD_ATTR_METADATA) {
|
||||
nextAction = nsHTMLMediaElement::PRELOAD_METADATA;
|
||||
} else if (attr == nsHTMLMediaElement::PRELOAD_ATTR_NONE) {
|
||||
nextAction = nsHTMLMediaElement::PRELOAD_NONE;
|
||||
}
|
||||
} 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);
|
||||
// There was a value, but it wasn't an enumerated value.
|
||||
// Use the suggested "missing value default" of "metadata".
|
||||
nextAction = nsHTMLMediaElement::PRELOAD_METADATA;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -394,25 +394,3 @@ function mediaTestCleanup() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
Components.utils.forceGC();
|
||||
}
|
||||
|
||||
(function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
// Ensure that preload preferences are comsistent
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService);
|
||||
var branch = prefService.getBranch("media.");
|
||||
var oldDefault = 2;
|
||||
var oldAuto = 3;
|
||||
try {
|
||||
oldDefault = branch.getIntPref("preload.default");
|
||||
oldAuto = branch.getIntPref("preload.auto");
|
||||
} catch(ex) { }
|
||||
branch.setIntPref("preload.default", 2); // preload_metadata
|
||||
branch.setIntPref("preload.auto", 3); // preload_enough
|
||||
|
||||
window.addEventListener("unload", function() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
branch.setIntPref("preload.default", oldDefault);
|
||||
branch.setIntPref("preload.auto", oldAuto);
|
||||
}, false);
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user