Replace catch-all experimental flag with fine-grained boolean preferences initialized from a JSON document.

This commit is contained in:
Josh Matthews 2015-08-26 12:35:38 -04:00
parent 6431e8da43
commit a3ee9b5dd9
11 changed files with 95 additions and 46 deletions

View file

@ -54,8 +54,8 @@ use style::viewport::ViewportConstraints;
use url::Url;
use util::cursor::Cursor;
use util::geometry::PagePx;
use util::opts;
use util::task::spawn_named;
use util::{opts, prefs};
/// Maintains the pipelines and navigation context and grants permission to composite.
///
@ -891,7 +891,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
containing_pipeline_id: PipelineId,
subpage_id: SubpageId,
event: MozBrowserEvent) {
assert!(opts::experimental_enabled());
assert!(prefs::get_pref("dom.mozbrowser.enabled", false));
// Find the script channel for the given parent pipeline,
// and pass the event to that script task.
@ -1373,7 +1373,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserlocationchange
fn trigger_mozbrowserlocationchange(&self, pipeline_id: PipelineId) {
if opts::experimental_enabled() {
if prefs::get_pref("dom.mozbrowser.enabled", false) {
// Work around borrow checker
let event_info = {
let pipeline = self.pipeline(pipeline_id);

View file

@ -31,7 +31,7 @@ use url::Url;
use util;
use util::geometry::{PagePx, ViewportPx};
use util::ipc::OptionalIpcSender;
use util::opts;
use util::prefs;
/// A uniquely-identifiable pipeline of script task, layout task, and paint task.
pub struct Pipeline {
@ -269,7 +269,7 @@ impl Pipeline {
pub fn trigger_mozbrowser_event(&self,
subpage_id: SubpageId,
event: MozBrowserEvent) {
assert!(opts::experimental_enabled());
assert!(prefs::get_pref("dom.mozbrowser.enabled", false));
let event = ConstellationControlMsg::MozBrowserEvent(self.id,
subpage_id,