mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Use static_prefs::pref!
.
It's much nicer. One nice thing about this is that the new code is subject to the existing threadedness checking, which identified that several of these should be atomic because they're accessed off the main thread. Differential Revision: https://phabricator.services.mozilla.com/D40792
This commit is contained in:
parent
ad1d028e40
commit
bb032c1ddc
17 changed files with 26 additions and 60 deletions
|
@ -69,8 +69,7 @@ pub enum TimingKeyword {
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn step_position_jump_enabled(_context: &ParserContext) -> bool {
|
||||
use crate::gecko_bindings::structs;
|
||||
unsafe { structs::StaticPrefs::sVarCache_layout_css_step_position_jump_enabled }
|
||||
static_prefs::pref!("layout.css.step-position-jump.enabled")
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
|
|
|
@ -72,11 +72,8 @@ impl<Value> Spacing<Value> {
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn line_height_moz_block_height_enabled(context: &ParserContext) -> bool {
|
||||
use crate::gecko_bindings::structs;
|
||||
context.in_ua_sheet() ||
|
||||
unsafe {
|
||||
structs::StaticPrefs::sVarCache_layout_css_line_height_moz_block_height_content_enabled
|
||||
}
|
||||
static_prefs::pref!("layout.css.line-height-moz-block-height.content.enabled")
|
||||
}
|
||||
|
||||
/// A generic value for the `line-height` property.
|
||||
|
|
|
@ -58,9 +58,7 @@ pub type Polygon = generic::GenericPolygon<LengthPercentage>;
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn is_clip_path_path_enabled(context: &ParserContext) -> bool {
|
||||
use crate::gecko_bindings::structs::mozilla;
|
||||
context.chrome_rules_enabled() ||
|
||||
unsafe { mozilla::StaticPrefs::sVarCache_layout_css_clip_path_path_enabled }
|
||||
context.chrome_rules_enabled() || static_prefs::pref!("layout.css.clip-path-path.enabled")
|
||||
}
|
||||
#[cfg(feature = "servo")]
|
||||
fn is_clip_path_path_enabled(_: &ParserContext) -> bool {
|
||||
|
|
|
@ -23,18 +23,14 @@ use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
|||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn moz_display_values_enabled(context: &ParserContext) -> bool {
|
||||
use crate::gecko_bindings::structs;
|
||||
context.in_ua_or_chrome_sheet() ||
|
||||
unsafe { structs::StaticPrefs::sVarCache_layout_css_xul_display_values_content_enabled }
|
||||
static_prefs::pref!("layout.css.xul-display-values.content.enabled")
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn moz_box_display_values_enabled(context: &ParserContext) -> bool {
|
||||
use crate::gecko_bindings::structs;
|
||||
context.in_ua_or_chrome_sheet() ||
|
||||
unsafe {
|
||||
structs::StaticPrefs::sVarCache_layout_css_xul_box_display_values_content_enabled
|
||||
}
|
||||
static_prefs::pref!("layout.css.xul-box-display-values.content.enabled")
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
|
||||
|
|
|
@ -305,8 +305,7 @@ impl Parse for TrackList<LengthPercentage, Integer> {
|
|||
#[cfg(feature = "gecko")]
|
||||
#[inline]
|
||||
fn allow_grid_template_subgrids() -> bool {
|
||||
use crate::gecko_bindings::structs::mozilla;
|
||||
unsafe { mozilla::StaticPrefs::sVarCache_layout_css_grid_template_subgrid_value_enabled }
|
||||
static_prefs::pref!("layout.css.grid-template-subgrid-value.enabled")
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
|
|
|
@ -32,8 +32,7 @@ pub type SVGStrokeDashArray = generic::SVGStrokeDashArray<NonNegativeLengthPerce
|
|||
/// Whether the `context-value` value is enabled.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub fn is_context_value_enabled() -> bool {
|
||||
use crate::gecko_bindings::structs::mozilla;
|
||||
unsafe { mozilla::StaticPrefs::sVarCache_gfx_font_rendering_opentype_svg_enabled }
|
||||
static_prefs::pref!("gfx.font_rendering.opentype_svg.enabled")
|
||||
}
|
||||
|
||||
/// Whether the `context-value` value is enabled.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue