mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
#8539 Config preferences backend restructure
This commit is contained in:
parent
34fda66dfa
commit
8bfd4dc1e2
53 changed files with 1748 additions and 680 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
use js::jsapi::JSContext;
|
||||
use js::rust::HandleObject;
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_config::prefs;
|
||||
|
||||
/// A container with a condition.
|
||||
pub struct Guard<T: Clone + Copy> {
|
||||
|
@ -48,7 +48,7 @@ pub enum Condition {
|
|||
impl Condition {
|
||||
unsafe fn is_satisfied(&self, cx: *mut JSContext, obj: HandleObject) -> bool {
|
||||
match *self {
|
||||
Condition::Pref(name) => PREFS.get(name).as_boolean().unwrap_or(false),
|
||||
Condition::Pref(name) => prefs::pref_map().get(name).as_bool().unwrap_or(false),
|
||||
Condition::Func(f) => f(cx, obj),
|
||||
Condition::Satisfied => true,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue