mirror of
https://github.com/servo/servo.git
synced 2025-07-30 10:40:27 +01:00
Auto merge of #7545 - jgraham:get_pref_option, r=jdm
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 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7545) <!-- Reviewable:end -->
This commit is contained in:
commit
9d42179900
7 changed files with 12 additions and 12 deletions
|
@ -42,7 +42,7 @@ use url::{Url, UrlParser};
|
|||
use util::str::{self, LengthOrPercentageOrAuto};
|
||||
|
||||
pub fn mozbrowser_enabled() -> bool {
|
||||
prefs::get_pref("dom.mozbrowser.enabled", false)
|
||||
prefs::get_pref("dom.mozbrowser.enabled").unwrap_or(false)
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf)]
|
||||
|
|
|
@ -171,7 +171,7 @@ impl MouseEventMethods for MouseEvent {
|
|||
// This returns the same result as current gecko.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which
|
||||
fn Which(&self) -> i32 {
|
||||
if prefs::get_pref("dom.mouseevent.which.enabled", false) {
|
||||
if prefs::get_pref("dom.mouseevent.which.enabled").unwrap_or(false) {
|
||||
(self.button.get() + 1) as i32
|
||||
} else {
|
||||
0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue