diff options
author | James Graham <james@hoppipolla.co.uk> | 2015-09-17 00:49:05 +0100 |
---|---|---|
committer | James Graham <james@hoppipolla.co.uk> | 2015-09-25 00:58:48 +0100 |
commit | 79e548905e3c5c9891eef2fcbf20203c56f952ee (patch) | |
tree | 1ed4e133772e6b7b6f060ae7204ae64c76dd14f3 /components/script/dom/mouseevent.rs | |
parent | d811f2d1baac6dcb501f3588eb509086bd1b2a66 (diff) | |
download | servo-79e548905e3c5c9891eef2fcbf20203c56f952ee.tar.gz servo-79e548905e3c5c9891eef2fcbf20203c56f952ee.zip |
Enable resetable and String prefs.
This allows both boolean and string-type preferences. It
also implements a system where prefs that are read from a
configuration file can be reset back to their initial value,
which is useful in a number of cases e.g. when running tests
to ensure that each test starts with the same values for
the prefs.
Diffstat (limited to 'components/script/dom/mouseevent.rs')
-rw-r--r-- | components/script/dom/mouseevent.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/mouseevent.rs b/components/script/dom/mouseevent.rs index 5e75d11ea9d..3e6f5c20e30 100644 --- a/components/script/dom/mouseevent.rs +++ b/components/script/dom/mouseevent.rs @@ -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").unwrap_or(false) { + if prefs::get_pref("dom.mouseevent.which.enabled").as_boolean().unwrap_or(false) { (self.button.get() + 1) as i32 } else { 0 |