mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update prefs API to return an Option<bool>.
This allows for situations where there is no reasonable default to apply for the pref value e.g. when we are just listing values
This commit is contained in:
parent
cc1eb3f741
commit
a208379f46
7 changed files with 12 additions and 12 deletions
|
@ -891,7 +891,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
containing_pipeline_id: PipelineId,
|
||||
subpage_id: SubpageId,
|
||||
event: MozBrowserEvent) {
|
||||
assert!(prefs::get_pref("dom.mozbrowser.enabled", false));
|
||||
assert!(prefs::get_pref("dom.mozbrowser.enabled").unwrap_or(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 prefs::get_pref("dom.mozbrowser.enabled", false) {
|
||||
if prefs::get_pref("dom.mozbrowser.enabled").unwrap_or(false) {
|
||||
// Work around borrow checker
|
||||
let event_info = {
|
||||
let pipeline = self.pipeline(pipeline_id);
|
||||
|
|
|
@ -269,7 +269,7 @@ impl Pipeline {
|
|||
pub fn trigger_mozbrowser_event(&self,
|
||||
subpage_id: SubpageId,
|
||||
event: MozBrowserEvent) {
|
||||
assert!(prefs::get_pref("dom.mozbrowser.enabled", false));
|
||||
assert!(prefs::get_pref("dom.mozbrowser.enabled").unwrap_or(false));
|
||||
|
||||
let event = ConstellationControlMsg::MozBrowserEvent(self.id,
|
||||
subpage_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue