зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1539326 - Cherry-pick changes for servo/servo#8539 (config preferences backend restructure). r=npotb
This commit is contained in:
Родитель
3a5289bd45
Коммит
32484d9bdf
|
@ -66,11 +66,11 @@ lazy_static! {
|
|||
Ok(num) => num,
|
||||
#[cfg(feature = "servo")]
|
||||
_ => {
|
||||
use servo_config::pref;
|
||||
// We always set this pref on startup, before layout or script
|
||||
// have had a chance of accessing (and thus creating) the
|
||||
// thread-pool.
|
||||
use servo_config::prefs::PREFS;
|
||||
PREFS.get("layout.threads").as_u64().unwrap() as usize
|
||||
pref!(layout.threads) as usize
|
||||
}
|
||||
#[cfg(feature = "gecko")]
|
||||
_ => {
|
||||
|
|
|
@ -33,7 +33,7 @@ use crate::parser::ParserContext;
|
|||
use crate::properties::longhands::system_font::SystemFont;
|
||||
use crate::selector_parser::PseudoElement;
|
||||
use selectors::parser::SelectorParseErrorKind;
|
||||
#[cfg(feature = "servo")] use servo_config::prefs::PREFS;
|
||||
#[cfg(feature = "servo")] use servo_config::prefs;
|
||||
use style_traits::{CssWriter, KeywordsCollectFn, ParseError, ParsingMode};
|
||||
use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
||||
use crate::stylesheets::{CssRuleType, Origin, UrlExtraData};
|
||||
|
@ -515,7 +515,7 @@ impl NonCustomPropertyId {
|
|||
Some(pref) => pref,
|
||||
};
|
||||
|
||||
PREFS.get(pref).as_boolean().unwrap_or(false)
|
||||
prefs::pref_map().get(pref).as_bool().unwrap_or(false)
|
||||
% else:
|
||||
unsafe { structs::nsCSSProps_gPropertyEnabled[self.0] }
|
||||
% endif
|
||||
|
|
|
@ -38,11 +38,8 @@ use style_traits::{CssWriter, ParseError, PinchZoomFactor, StyleParseErrorKind,
|
|||
/// Whether parsing and processing of `@viewport` rules is enabled.
|
||||
#[cfg(feature = "servo")]
|
||||
pub fn enabled() -> bool {
|
||||
use servo_config::prefs::PREFS;
|
||||
PREFS
|
||||
.get("layout.viewport.enabled")
|
||||
.as_boolean()
|
||||
.unwrap_or(false)
|
||||
use servo_config::pref;
|
||||
pref!(layout.viewport.enabled)
|
||||
}
|
||||
|
||||
/// Whether parsing and processing of `@viewport` rules is enabled.
|
||||
|
|
Загрузка…
Ссылка в новой задаче