diff options
author | Josh Matthews <josh@joshmatthews.net> | 2015-08-26 12:35:38 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2015-08-28 10:30:04 -0400 |
commit | a3ee9b5dd9105a141a45de8f5e3ca8818c217fa3 (patch) | |
tree | dd376ffa5811ce14c8b0c2a3386867b6e979f852 /components/script/dom/htmliframeelement.rs | |
parent | 6431e8da43817e8a6b1e4757afbcf45c1a629707 (diff) | |
download | servo-a3ee9b5dd9105a141a45de8f5e3ca8818c217fa3.tar.gz servo-a3ee9b5dd9105a141a45de8f5e3ca8818c217fa3.zip |
Replace catch-all experimental flag with fine-grained boolean preferences initialized from a JSON document.
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 4732037cbe4..eabf16b9cac 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -30,7 +30,7 @@ use msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandbo use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::{PipelineId, SubpageId, ConstellationChan, MozBrowserEvent, NavigationDirection}; use string_cache::Atom; -use util::opts; +use util::prefs; use util::str::DOMString; use js::jsapi::{RootedValue, JSAutoRequest, JSAutoCompartment}; @@ -41,6 +41,10 @@ use std::cell::Cell; use url::{Url, UrlParser}; use util::str::{self, LengthOrPercentageOrAuto}; +pub fn mozbrowser_enabled() -> bool { + prefs::get_pref("dom.mozbrowser.enabled", false) +} + #[derive(HeapSizeOf)] enum SandboxAllowance { AllowNothing = 0x00, @@ -117,7 +121,7 @@ impl HTMLIFrameElement { old_subpage_id, sandboxed)).unwrap(); - if opts::experimental_enabled() { + if mozbrowser_enabled() { // https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadstart self.dispatch_mozbrowser_event(MozBrowserEvent::LoadStart); } @@ -136,7 +140,7 @@ impl HTMLIFrameElement { // TODO(gw): Support mozbrowser event types that have detail which is not a string. // See https://developer.mozilla.org/en-US/docs/Web/API/Using_the_Browser_API // for a list of mozbrowser events. - assert!(opts::experimental_enabled()); + assert!(mozbrowser_enabled()); if self.Mozbrowser() { let window = window_from_node(self); @@ -302,7 +306,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-mozbrowser fn Mozbrowser(&self) -> bool { - if opts::experimental_enabled() { + if mozbrowser_enabled() { let element = ElementCast::from_ref(self); element.has_attribute(&Atom::from_slice("mozbrowser")) } else { @@ -312,7 +316,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-mozbrowser fn SetMozbrowser(&self, value: bool) -> ErrorResult { - if opts::experimental_enabled() { + if mozbrowser_enabled() { let element = ElementCast::from_ref(self); element.set_bool_attribute(&Atom::from_slice("mozbrowser"), value); } |