Backed out 2 changesets (bug 1563555) for causing marionette failures on test_profile_management.py.
authorCosmin Sabou <csabou@mozilla.com>
Wed, 07 Aug 2019 12:09:13 +0300
changeset 486698 7e98e814517c1c4b6ab999a81e9db5d54dc98a6a
parent 486697 1b0c2b127fcbbe7fe2dcb7aaf08262c9c68d8931
child 486699 978d8be38d3a2e0e58755826993f099dcf39cc39
push id91885
push usercsabou@mozilla.com
push dateWed, 07 Aug 2019 09:13:17 +0000
treeherderautoland@978d8be38d3a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1563555
milestone70.0a1
backs out2559f5ddf8e06ec761e35aaa401a66e6de5189fa
e3c86ffa168c07f6809d1587bafdb0b6284e1511
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1563555) for causing marionette failures on test_profile_management.py. Backed out changeset 2559f5ddf8e0 (bug 1563555) Backed out changeset e3c86ffa168c (bug 1563555)
Cargo.lock
layout/style/ServoBindings.toml
modules/libpref/init/StaticPrefList.yaml
modules/libpref/init/StaticPrefListBegin.h
servo/components/style/Cargo.toml
servo/components/style/font_face.rs
servo/components/style/gecko/media_queries.rs
servo/components/style/gecko/pseudo_element.rs
servo/components/style/gecko/pseudo_element_definition.mako.rs
servo/components/style/gecko/selector_parser.rs
servo/components/style/lib.rs
servo/components/style/media_queries/media_feature_expression.rs
servo/components/style/properties/cascade.rs
servo/components/style/stylesheets/document_rule.rs
servo/components/style/stylesheets/supports_rule.rs
servo/components/style/values/generics/easing.rs
servo/components/style/values/generics/text.rs
servo/components/style/values/specified/basic_shape.rs
servo/components/style/values/specified/box.rs
servo/components/style/values/specified/grid.rs
servo/components/style/values/specified/svg.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2987,17 +2987,16 @@ dependencies = [
  "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "selectors 0.21.0",
  "servo_arc 0.1.1",
  "smallbitvec 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "static_prefs 0.1.0",
  "style_derive 0.0.1",
  "style_traits 0.0.1",
  "thin-slice 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "to_shmem 0.0.1",
  "to_shmem_derive 0.0.1",
  "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "uluru 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -19,16 +19,17 @@ headers = [
     "mozilla/CORSMode.h",
     "mozilla/Keyframe.h",
     "mozilla/ServoElementSnapshot.h",
     "mozilla/ServoElementSnapshotTable.h",
     "mozilla/dom/Element.h",
     "mozilla/dom/ChildIterator.h",
     "mozilla/dom/NameSpaceConstants.h",
     "mozilla/LookAndFeel.h",
+    "mozilla/StaticPrefsAll.h",
     "mozilla/GeckoBindings.h",
     "mozilla/ServoBindings.h",
     "mozilla/ComputedStyle.h",
     "mozilla/ServoTraversalStatistics.h",
     "mozilla/SizeOfState.h",
     "nsCSSProps.h",
     "nsContentUtils.h",
     "nsNameSpaceManager.h",
@@ -155,16 +156,17 @@ whitelist-vars = [
     "kNameSpaceID_.*",
     "kGenericFont_.*",
     "kPresContext_.*",
     "nsContentUtils_.*",
     "GECKO_IS_NIGHTLY",
     "mozilla::detail::gGkAtoms",
     "mozilla::detail::kGkAtomsArrayOffset",
     "mozilla::profiler::detail::RacyFeatures::sActiveAndFeatures",
+    "mozilla::StaticPrefs::.*",
 ]
 # TODO(emilio): A bunch of types here can go away once we generate bindings and
 # structs together.
 whitelist-types = [
     "RawGecko.*",
     "RawServo.*",
     "ServoCssRules",
     "nsFontFaceRuleContainer",
@@ -195,16 +197,17 @@ whitelist-types = [
     "mozilla::css::DocumentMatchingFunction",
     "mozilla::dom::IterationCompositeOperation",
     "mozilla::dom::StyleChildrenIterator",
     "mozilla::HalfCorner",
     "mozilla::MallocSizeOf",
     "mozilla::OriginFlags",
     "mozilla::PropertyStyleAnimationValuePair",
     "mozilla::ServoTraversalFlags",
+    "mozilla::StaticPrefs",
     "mozilla::StyleShapeRadius",
     "mozilla::StyleGrid.*",
     "mozilla::UpdateAnimationsTasks",
     "mozilla::PointerCapabilities",
     "mozilla::LookAndFeel",
     "mozilla::gfx::Float",
     "mozilla::gfx::FontVariation",
     "mozilla::StyleImageLayerAttachment",
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -738,17 +738,17 @@
   type: String
   value: ""
   mirror: never
 
 # 0 = default: always, except in high contrast mode
 # 1 = always
 # 2 = never
 - name: browser.display.document_color_use
-  type: RelaxedAtomicUint32
+  type: uint32_t
   value: 0
   mirror: always
   rust: true
 
 - name: browser.display.focus_ring_on_anything
   type: bool
   value: false
   mirror: always
@@ -789,17 +789,16 @@
   mirror: always
 
 # In theory: 0 = never, 1 = quick, 2 = always, though we always just use it as
 # a bool!
 - name: browser.display.use_document_fonts
   type: RelaxedAtomicInt32
   value: 1
   mirror: always
-  rust: true
 
 - name: browser.display.use_focus_colors
   type: bool
   value: false
   mirror: always
 
 - name: browser.display.use_system_colors
   type: bool
@@ -2494,20 +2493,19 @@
 #---------------------------------------------------------------------------
 
 - name: full-screen-api.enabled
   type: bool
   value: false
   mirror: always
 
 - name: full-screen-api.unprefix.enabled
-  type: RelaxedAtomicBool
-  value: true
-  mirror: always
-  rust: true
+  type: bool
+  value: true
+  mirror: always
 
 - name: full-screen-api.allow-trusted-requests-only
   type: bool
   value: true
   mirror: always
 
 - name: full-screen-api.mouse-event-allow-left-button-only
   type: bool
@@ -2873,20 +2871,19 @@
 #if defined(XP_MACOSX)
 - name: gfx.font_rendering.coretext.enabled
   type: RelaxedAtomicBool
   value: false
   mirror: always
 #endif
 
 - name: gfx.font_rendering.opentype_svg.enabled
-  type: RelaxedAtomicBool
-  value: true
-  mirror: always
-  rust: true
+  type: bool
+  value: true
+  mirror: always
 
 - name: gfx.layerscope.enabled
   type: RelaxedAtomicBool
   value: false
   mirror: always
 
 - name: gfx.layerscope.port
   type: RelaxedAtomicInt32
@@ -4010,20 +4007,19 @@
 # Is the codepath for using cached scrollbar styles enabled?
 - name: layout.css.cached-scrollbar-styles.enabled
   type: bool
   value: true
   mirror: always
 
 # Is path() supported in clip-path?
 - name: layout.css.clip-path-path.enabled
-  type: RelaxedAtomicBool
-  value: false
-  mirror: always
-  rust: true
+  type: bool
+  value: false
+  mirror: always
 
 # text underline offset
 - name: layout.css.text-underline-offset.enabled
   type: bool
   value: false
   mirror: always
 
 # text decoration thickness
@@ -4092,43 +4088,40 @@
   value: false
   mirror: always
 
 # Is support for the font-display @font-face descriptor enabled?
 - name: layout.css.font-display.enabled
   type: bool
   value: true
   mirror: always
-  rust: true
 
 # Is support for document.fonts enabled?
 - name: layout.css.font-loading-api.enabled
   type: bool
   value: true
   mirror: always
 
 # Is support for variation fonts enabled?
 - name: layout.css.font-variations.enabled
   type: RelaxedAtomicBool
   value: true
   mirror: always
-  rust: true
 
 # Is support for GeometryUtils.getBoxQuads enabled?
 - name: layout.css.getBoxQuads.enabled
   type: bool
   value: @IS_NOT_RELEASE_OR_BETA@
   mirror: always
 
 # Is support for CSS "grid-template-{columns,rows}: subgrid X" enabled?
 - name: layout.css.grid-template-subgrid-value.enabled
-  type: RelaxedAtomicBool
+  type: bool
   value: @IS_NIGHTLY_BUILD@
   mirror: always
-  rust: true
 
 # Is support for CSS individual transform enabled?
 - name: layout.css.individual-transform.enabled
   type: bool
   value: false
   mirror: always
 
 # Is support for CSS initial-letter property enabled?
@@ -4137,17 +4130,16 @@
   value: false
   mirror: always
 
 # Pref to control whether line-height: -moz-block-height is exposed to content.
 - name: layout.css.line-height-moz-block-height.content.enabled
   type: bool
   value: false
   mirror: always
-  rust: true
 
 # Is support for motion-path enabled?
 - name: layout.css.motion-path.enabled
   type: bool
   value: @IS_NOT_RELEASE_OR_BETA@
   mirror: always
 
 # Is support for -moz-binding enabled?
@@ -4156,39 +4148,36 @@
   value: false
   mirror: always
 
 # Pref to control whether the ::marker property restrictions defined in [1]
 # apply.
 #
 # [1]: https://drafts.csswg.org/css-pseudo-4/#selectordef-marker
 - name: layout.css.marker.restricted
-  type: RelaxedAtomicBool
-  value: true
-  mirror: always
-  rust: true
+  type: bool
+  value: true
+  mirror: always
 
 # Pref to control whether @-moz-document rules are enabled in content pages.
 - name: layout.css.moz-document.content.enabled
-  type: RelaxedAtomicBool
-  value: false
-  mirror: always
-  rust: true
+  type: bool
+  value: false
+  mirror: always
 
 # Pref to control whether @-moz-document url-prefix() is parsed in content
 # pages. Only effective when layout.css.moz-document.content.enabled is false.
 - name: layout.css.moz-document.url-prefix-hack.enabled
-  type: RelaxedAtomicBool
+  type: bool
 #ifdef EARLY_BETA_OR_EARLIER
   value: false
 #else
   value: true
 #endif
   mirror: always
-  rust: true
 
 # Whether the offset-* logical property aliases are enabled.
 - name: layout.css.offset-logical-properties.enabled
   type: bool
   value: false
   mirror: always
 
 # Is -moz-osx-font-smoothing enabled? (Only supported in OSX builds)
@@ -4239,20 +4228,19 @@
 # Is support for -moz-box-sizing enabled?
 - name: layout.css.prefixes.box-sizing
   type: bool
   value: true
   mirror: always
 
 # Are "-webkit-{min|max}-device-pixel-ratio" media queries supported?
 - name: layout.css.prefixes.device-pixel-ratio-webkit
-  type: RelaxedAtomicBool
-  value: true
-  mirror: always
-  rust: true
+  type: bool
+  value: true
+  mirror: always
 
 # Is support for -moz-prefixed font feature properties enabled?
 - name: layout.css.prefixes.font-features
   type: bool
   value: true
   mirror: always
 
 # Is support for -moz-prefixed transform properties enabled?
@@ -4294,17 +4282,16 @@
   type: bool
   value: true
   mirror: always
 
 - name: layout.css.supports-selector.enabled
   type: bool
   value: true
   mirror: always
-  rust: true
 
 - name: layout.css.scroll-behavior.enabled
   type: RelaxedAtomicBool
   value: true
   mirror: always
 
 - name: layout.css.scroll-behavior.spring-constant
   type: AtomicFloat
@@ -4323,37 +4310,35 @@
 
 - name: layout.css.scroll-snap.proximity-threshold
   type: RelaxedAtomicInt32
   value: 200
   mirror: always
 
 # Is steps(jump-*) supported in easing functions?
 - name: layout.css.step-position-jump.enabled
-  type: RelaxedAtomicBool
-  value: true
-  mirror: always
-  rust: true
+  type: bool
+  value: true
+  mirror: always
 
 # W3C touch-action css property (related to touch and pointer events)
 # Note that we turn this on even on platforms/configurations where touch
 # events are not supported (e.g. OS X, or Windows with e10s disabled). For
 # those platforms we don't handle touch events anyway so it's conceptually
 # a no-op.
 - name: layout.css.touch_action.enabled
   type: RelaxedAtomicBool
   value: true
   mirror: always
 
 # Does arbitrary ::-webkit-* pseudo-element parsed?
 - name: layout.css.unknown-webkit-pseudo-element
-  type: RelaxedAtomicBool
-  value: true
-  mirror: always
-  rust: true
+  type: bool
+  value: true
+  mirror: always
 
 # Are style system use counters enabled?
 - name: layout.css.use-counters.enabled
   type: bool
   value: @IS_NOT_RELEASE_OR_BETA@
   mirror: always
 
 # Should the :visited selector ever match (otherwise :link matches instead)?
@@ -4364,36 +4349,33 @@
 
 # Is the '-webkit-appearance' alias for '-moz-appearance' enabled?
 - name: layout.css.webkit-appearance.enabled
   type: bool
   value: true
   mirror: always
 
 - name: layout.css.xul-display-values.content.enabled
-  type: RelaxedAtomicBool
-  value: false
-  mirror: always
-  rust: true
+  type: bool
+  value: false
+  mirror: always
 
 # Pref to control whether display: -moz-box and display: -moz-inline-box are
 # parsed in content pages.
 - name: layout.css.xul-box-display-values.content.enabled
-  type: RelaxedAtomicBool
-  value: false
-  mirror: always
-  rust: true
+  type: bool
+  value: false
+  mirror: always
 
 # Pref to control whether XUL ::-tree-* pseudo-elements are parsed in content
 # pages.
 - name: layout.css.xul-tree-pseudos.content.enabled
-  type: RelaxedAtomicBool
-  value: false
-  mirror: always
-  rust: true
+  type: bool
+  value: false
+  mirror: always
 
 # Whether to block large cursors intersecting UI.
 - name: layout.cursor.block.enabled
   type: bool
   value: true
   mirror: always
 
 # The maximum width or height of the cursor we should allow when intersecting
@@ -4539,20 +4521,19 @@
 
 # Are shared memory User Agent style sheets enabled?
 - name: layout.css.shared-memory-ua-sheets.enabled
   type: bool
   value: false
   mirror: always
 
 - name: layout.css.shadow-parts.enabled
-  type: RelaxedAtomicBool
+  type: bool
   value: @IS_NIGHTLY_BUILD@
   mirror: always
-  rust: true
 
 # Is support for CSS text-justify property enabled?
 - name: layout.css.text-justify.enabled
   type: bool
   value: true
   mirror: always
 
 # Is support for -webkit-line-clamp enabled?
--- a/modules/libpref/init/StaticPrefListBegin.h
+++ b/modules/libpref/init/StaticPrefListBegin.h
@@ -10,17 +10,18 @@
 
 #include "StaticPrefsBase.h"
 #include "MainThreadUtils.h"  // for NS_IsMainThread()
 
 namespace mozilla {
 namespace StaticPrefs {
 
 // For mirrored prefs we generate an extern variable declaration and three
-// getter declarations/definitions.
+// getter declarations/definitions. The extern declaration of the variable is
+// necessary for bindgen to see it and generate Rust bindings.
 #define NEVER_PREF(name, cpp_type, default_value)
 #define ALWAYS_PREF(name, base_id, full_id, cpp_type, default_value)          \
   extern cpp_type sVarCache_##full_id;                                        \
   inline StripAtomic<cpp_type> full_id() {                                    \
     MOZ_DIAGNOSTIC_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),     \
                           "Non-atomic static pref '" name                     \
                           "' being accessed on background thread by getter"); \
     return sVarCache_##full_id;                                               \
--- a/servo/components/style/Cargo.toml
+++ b/servo/components/style/Cargo.toml
@@ -62,17 +62,16 @@ precomputed-hash = "0.1.1"
 rayon = "1"
 selectors = { path = "../selectors" }
 serde = {version = "1.0", optional = true, features = ["derive"]}
 servo_arc = { path = "../servo_arc" }
 servo_atoms = {path = "../atoms", optional = true}
 servo_config = {path = "../config", optional = true}
 smallbitvec = "2.3.0"
 smallvec = "0.6.6"
-static_prefs = { path = "../../../modules/libpref/init/static_prefs" }
 string_cache = { version = "0.7", optional = true }
 style_derive = {path = "../style_derive"}
 style_traits = {path = "../style_traits"}
 servo_url = {path = "../url", optional = true}
 thin-slice = "0.1.0"
 to_shmem = {path = "../to_shmem"}
 to_shmem_derive = {path = "../to_shmem_derive"}
 time = "0.1"
--- a/servo/components/style/font_face.rs
+++ b/servo/components/style/font_face.rs
@@ -409,20 +409,26 @@ impl Parse for Source {
             url: url,
             format_hints: format_hints,
         }))
     }
 }
 
 macro_rules! is_descriptor_enabled {
     ("font-display") => {
-        static_prefs::pref!("layout.css.font-display.enabled")
+        unsafe {
+            use crate::gecko_bindings::structs::mozilla;
+            mozilla::StaticPrefs::sVarCache_layout_css_font_display_enabled
+        }
     };
     ("font-variation-settings") => {
-        static_prefs::pref!("layout.css.font-variations.enabled")
+        unsafe {
+            use crate::gecko_bindings::structs::mozilla;
+            mozilla::StaticPrefs::sVarCache_layout_css_font_variations_enabled != 0
+        }
     };
     ($name:tt) => {
         true
     };
 }
 
 macro_rules! font_face_descriptors_common {
     (
--- a/servo/components/style/gecko/media_queries.rs
+++ b/servo/components/style/gecko/media_queries.rs
@@ -263,17 +263,18 @@ impl Device {
 
     /// Returns whether document colors are enabled.
     #[inline]
     pub fn use_document_colors(&self) -> bool {
         let doc = self.document();
         if doc.mIsBeingUsedAsImage() {
             return true;
         }
-        let document_color_use = static_prefs::pref!("browser.display.document_color_use");
+        let document_color_use =
+            unsafe { structs::StaticPrefs::sVarCache_browser_display_document_color_use };
         let prefs = self.pref_sheet_prefs();
         match document_color_use {
             1 => true,
             2 => prefs.mIsChrome,
             _ => !prefs.mUseAccessibilityTheme,
         }
     }
 
--- a/servo/components/style/gecko/pseudo_element.rs
+++ b/servo/components/style/gecko/pseudo_element.rs
@@ -182,18 +182,21 @@ impl PseudoElement {
     /// Property flag that properties must have to apply to this pseudo-element.
     #[inline]
     pub fn property_restriction(&self) -> Option<PropertyFlags> {
         Some(match *self {
             PseudoElement::FirstLetter => PropertyFlags::APPLIES_TO_FIRST_LETTER,
             PseudoElement::FirstLine => PropertyFlags::APPLIES_TO_FIRST_LINE,
             PseudoElement::Placeholder => PropertyFlags::APPLIES_TO_PLACEHOLDER,
             PseudoElement::Cue => PropertyFlags::APPLIES_TO_CUE,
-            PseudoElement::Marker if static_prefs::pref!("layout.css.marker.restricted") =>
-                PropertyFlags::APPLIES_TO_MARKER,
+            PseudoElement::Marker
+                if unsafe { structs::StaticPrefs::sVarCache_layout_css_marker_restricted } =>
+            {
+                PropertyFlags::APPLIES_TO_MARKER
+            },
             _ => return None,
         })
     }
 
     /// Whether this pseudo-element should actually exist if it has
     /// the given styles.
     pub fn should_exist(&self, style: &ComputedValues) -> bool {
         debug_assert!(self.is_eager());
--- a/servo/components/style/gecko/pseudo_element_definition.mako.rs
+++ b/servo/components/style/gecko/pseudo_element_definition.mako.rs
@@ -107,17 +107,17 @@ impl PseudoElement {
 
     /// Gets the flags associated to this pseudo-element, or 0 if it's an
     /// anonymous box.
     pub fn flags(&self) -> u32 {
         match *self {
             % for pseudo in PSEUDOS:
                 ${pseudo_element_variant(pseudo)} =>
                 % if pseudo.is_tree_pseudo_element():
-                    if static_prefs::pref!("layout.css.xul-tree-pseudos.content.enabled") {
+                    if unsafe { structs::StaticPrefs::sVarCache_layout_css_xul_tree_pseudos_content_enabled } {
                         0
                     } else {
                         structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS_AND_CHROME
                     },
                 % elif pseudo.is_anon_box():
                     structs::CSS_PSEUDO_ELEMENT_ENABLED_IN_UA_SHEETS,
                 % else:
                     structs::SERVO_CSS_PSEUDO_ELEMENT_FLAGS_${pseudo.pseudo_ident},
@@ -204,17 +204,19 @@ impl PseudoElement {
             }
             "-moz-list-bullet" | "-moz-list-number" => {
                 return Some(PseudoElement::Marker);
             }
             _ => {
                 if starts_with_ignore_ascii_case(name, "-moz-tree-") {
                     return PseudoElement::tree_pseudo_element(name, Box::new([]))
                 }
-                if static_prefs::pref!("layout.css.unknown-webkit-pseudo-element") {
+                if unsafe {
+                    structs::StaticPrefs::sVarCache_layout_css_unknown_webkit_pseudo_element
+                } {
                     const WEBKIT_PREFIX: &str = "-webkit-";
                     if starts_with_ignore_ascii_case(name, WEBKIT_PREFIX) {
                         let part = string_as_ascii_lowercase(&name[WEBKIT_PREFIX.len()..]);
                         return Some(PseudoElement::UnknownWebkit(part.into()));
                     }
                 }
             }
         }
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 
 //! Gecko-specific bits for selector-parsing.
 
 use crate::element_state::{DocumentState, ElementState};
-use crate::gecko_bindings::structs::RawServoSelectorList;
+use crate::gecko_bindings::structs::{self, RawServoSelectorList};
 use crate::gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
 use crate::invalidation::element::document_state::InvalidationMatchingData;
 use crate::selector_parser::{Direction, SelectorParser};
 use crate::str::starts_with_ignore_ascii_case;
 use crate::string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
 use crate::values::serialize_atom_identifier;
 use cssparser::{BasicParseError, BasicParseErrorKind, Parser};
 use cssparser::{CowRcStr, SourceLocation, ToCss, Token};
@@ -165,20 +165,23 @@ impl NonTSPseudoClass {
                 }
             }
         }
         apply_non_ts_list!(pseudo_class_check_is_enabled_in)
     }
 
     /// Returns whether the pseudo-class is enabled in content sheets.
     fn is_enabled_in_content(&self) -> bool {
+        use crate::gecko_bindings::structs::mozilla;
         match *self {
             // For pseudo-classes with pref, the availability in content
             // depends on the pref.
-            NonTSPseudoClass::Fullscreen => static_prefs::pref!("full-screen-api.unprefix.enabled"),
+            NonTSPseudoClass::Fullscreen => unsafe {
+                mozilla::StaticPrefs::sVarCache_full_screen_api_unprefix_enabled
+            },
             // Otherwise, a pseudo-class is enabled in content when it
             // doesn't have any enabled flag.
             _ => !self
                 .has_any_flag(NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
         }
     }
 
     /// Get the state flag associated with a pseudo-class, if any.
@@ -346,17 +349,18 @@ impl<'a, 'i> ::selectors::Parser<'i> for
 
     #[inline]
     fn parse_host(&self) -> bool {
         true
     }
 
     #[inline]
     fn parse_part(&self) -> bool {
-        self.chrome_rules_enabled() || static_prefs::pref!("layout.css.shadow-parts.enabled")
+        self.chrome_rules_enabled() ||
+            unsafe { structs::StaticPrefs::sVarCache_layout_css_shadow_parts_enabled }
     }
 
     fn parse_non_ts_pseudo_class(
         &self,
         location: SourceLocation,
         name: CowRcStr<'i>,
     ) -> Result<NonTSPseudoClass, ParseError<'i>> {
         if let Some(pseudo_class) = NonTSPseudoClass::parse_non_functional(&name) {
--- a/servo/components/style/lib.rs
+++ b/servo/components/style/lib.rs
@@ -86,17 +86,16 @@ pub extern crate servo_arc;
 #[macro_use]
 extern crate servo_atoms;
 #[cfg(feature = "servo")]
 extern crate servo_config;
 #[cfg(feature = "servo")]
 extern crate servo_url;
 extern crate smallbitvec;
 extern crate smallvec;
-extern crate static_prefs;
 #[cfg(feature = "servo")]
 extern crate string_cache;
 #[macro_use]
 extern crate style_derive;
 extern crate style_traits;
 #[cfg(feature = "gecko")]
 extern crate thin_slice;
 extern crate time;
--- a/servo/components/style/media_queries/media_feature_expression.rs
+++ b/servo/components/style/media_queries/media_feature_expression.rs
@@ -6,16 +6,18 @@
 //! `(width >= 400px)`.
 
 use super::media_feature::{Evaluator, MediaFeatureDescription};
 use super::media_feature::{KeywordDiscriminant, ParsingRequirements};
 use super::Device;
 use crate::context::QuirksMode;
 #[cfg(feature = "gecko")]
 use crate::gecko::media_features::MEDIA_FEATURES;
+#[cfg(feature = "gecko")]
+use crate::gecko_bindings::structs;
 use crate::parser::{Parse, ParserContext};
 #[cfg(feature = "servo")]
 use crate::servo::media_queries::MEDIA_FEATURES;
 use crate::str::{starts_with_ignore_ascii_case, string_as_ascii_lowercase};
 use crate::values::computed::{self, ToComputedValue};
 use crate::values::specified::{Integer, Length, Number, Resolution};
 use crate::values::{serialize_atom_identifier, CSSFloat};
 use crate::{Atom, Zero};
@@ -294,17 +296,19 @@ impl MediaFeatureExpression {
             let result = {
                 let mut feature_name = &**ident;
 
                 #[cfg(feature = "gecko")]
                 {
                     if starts_with_ignore_ascii_case(feature_name, "-webkit-") {
                         feature_name = &feature_name[8..];
                         requirements.insert(ParsingRequirements::WEBKIT_PREFIX);
-                        if static_prefs::pref!("layout.css.prefixes.device-pixel-ratio-webkit") {
+                        if unsafe {
+                            structs::StaticPrefs::sVarCache_layout_css_prefixes_device_pixel_ratio_webkit
+                        } {
                             requirements.insert(
                                 ParsingRequirements::WEBKIT_DEVICE_PIXEL_RATIO_PREF_ENABLED,
                             );
                         }
                     }
                 }
 
                 let range = if starts_with_ignore_ascii_case(feature_name, "min-") {
--- a/servo/components/style/properties/cascade.rs
+++ b/servo/components/style/properties/cascade.rs
@@ -668,25 +668,25 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
     /// `mDefaultFontType`) depends on the current lang group and generic font
     /// family, so we may need to recompute it if or the family changed.
     ///
     /// Also, we prioritize non-document fonts here if we need to (see the pref
     /// `browser.display.use_document_fonts`).
     #[inline]
     #[cfg(feature = "gecko")]
     fn recompute_default_font_family_type_if_needed(&mut self) {
-        use crate::gecko_bindings::bindings;
+        use crate::gecko_bindings::{bindings, structs};
         use crate::values::computed::font::GenericFontFamily;
 
         if !self.seen.contains(LonghandId::XLang) &&
            !self.seen.contains(LonghandId::FontFamily) {
             return;
         }
 
-        let use_document_fonts = static_prefs::pref!("browser.display.use_document_fonts") != 0;
+        let use_document_fonts = unsafe { structs::StaticPrefs::sVarCache_browser_display_use_document_fonts != 0 };
         let builder = &mut self.context.builder;
         let (default_font_type, prioritize_user_fonts) = {
             let font = builder.get_font().gecko();
 
             // System fonts are all right, and should have the default font type
             // set to none already, so bail out early.
             if font.mFont.systemFont {
                 debug_assert_eq!(font.mFont.fontlist.mDefaultFontType, GenericFontFamily::None);
--- a/servo/components/style/stylesheets/document_rule.rs
+++ b/servo/components/style/stylesheets/document_rule.rs
@@ -248,28 +248,30 @@ impl DocumentCondition {
 
     #[cfg(feature = "servo")]
     fn allowed_in(&self, _: &ParserContext) -> bool {
         false
     }
 
     #[cfg(feature = "gecko")]
     fn allowed_in(&self, context: &ParserContext) -> bool {
+        use crate::gecko_bindings::structs;
         use crate::stylesheets::Origin;
-        use static_prefs::pref;
 
         if context.stylesheet_origin != Origin::Author {
             return true;
         }
 
-        if pref!("layout.css.moz-document.content.enabled") {
+        if unsafe { structs::StaticPrefs::sVarCache_layout_css_moz_document_content_enabled } {
             return true;
         }
 
-        if !pref!("layout.css.moz-document.url-prefix-hack.enabled") {
+        if !unsafe {
+            structs::StaticPrefs::sVarCache_layout_css_moz_document_url_prefix_hack_enabled
+        } {
             return false;
         }
 
         // Allow a single url-prefix() for compatibility.
         //
         // See bug 1446470 and dependencies.
         if self.0.len() != 1 {
             return false;
--- a/servo/components/style/stylesheets/supports_rule.rs
+++ b/servo/components/style/stylesheets/supports_rule.rs
@@ -318,17 +318,19 @@ impl ToCss for RawSelector {
     }
 }
 
 impl RawSelector {
     /// Tries to evaluate a `selector()` function.
     pub fn eval(&self, context: &ParserContext, namespaces: &Namespaces) -> bool {
         #[cfg(feature = "gecko")]
         {
-            if !static_prefs::pref!("layout.css.supports-selector.enabled") {
+            if unsafe {
+                !crate::gecko_bindings::structs::StaticPrefs::sVarCache_layout_css_supports_selector_enabled
+            } {
                 return false;
             }
         }
 
         let mut input = ParserInput::new(&self.0);
         let mut input = Parser::new(&mut input);
         input
             .parse_entirely(|input| -> Result<(), CssParseError<()>> {
--- a/servo/components/style/values/generics/easing.rs
+++ b/servo/components/style/values/generics/easing.rs
@@ -64,17 +64,18 @@ pub enum TimingKeyword {
     Ease,
     EaseIn,
     EaseOut,
     EaseInOut,
 }
 
 #[cfg(feature = "gecko")]
 fn step_position_jump_enabled(_context: &ParserContext) -> bool {
-    static_prefs::pref!("layout.css.step-position-jump.enabled")
+    use crate::gecko_bindings::structs;
+    unsafe { structs::StaticPrefs::sVarCache_layout_css_step_position_jump_enabled }
 }
 
 #[cfg(feature = "servo")]
 fn step_position_jump_enabled(_context: &ParserContext) -> bool {
     false
 }
 
 #[allow(missing_docs)]
--- a/servo/components/style/values/generics/text.rs
+++ b/servo/components/style/values/generics/text.rs
@@ -67,18 +67,21 @@ impl<Value> Spacing<Value> {
             return Ok(Spacing::Normal);
         }
         parse(context, input).map(Spacing::Value)
     }
 }
 
 #[cfg(feature = "gecko")]
 fn line_height_moz_block_height_enabled(context: &ParserContext) -> bool {
+    use crate::gecko_bindings::structs;
     context.in_ua_sheet() ||
-        static_prefs::pref!("layout.css.line-height-moz-block-height.content.enabled")
+        unsafe {
+            structs::StaticPrefs::sVarCache_layout_css_line_height_moz_block_height_content_enabled
+        }
 }
 
 /// A generic value for the `line-height` property.
 #[derive(
     Animate,
     Clone,
     ComputeSquaredDistance,
     Copy,
--- a/servo/components/style/values/specified/basic_shape.rs
+++ b/servo/components/style/values/specified/basic_shape.rs
@@ -53,17 +53,19 @@ pub type Ellipse =
 /// The specified value of `ShapeRadius`
 pub type ShapeRadius = generic::ShapeRadius<NonNegativeLengthPercentage>;
 
 /// The specified value of `Polygon`
 pub type Polygon = generic::GenericPolygon<LengthPercentage>;
 
 #[cfg(feature = "gecko")]
 fn is_clip_path_path_enabled(context: &ParserContext) -> bool {
-    context.chrome_rules_enabled() || static_prefs::pref!("layout.css.clip-path-path.enabled")
+    use crate::gecko_bindings::structs::mozilla;
+    context.chrome_rules_enabled() ||
+        unsafe { mozilla::StaticPrefs::sVarCache_layout_css_clip_path_path_enabled }
 }
 #[cfg(feature = "servo")]
 fn is_clip_path_path_enabled(_: &ParserContext) -> bool {
     false
 }
 
 impl Parse for ClippingShape {
     #[inline]
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -18,24 +18,28 @@ use crate::Atom;
 use cssparser::Parser;
 use selectors::parser::SelectorParseErrorKind;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 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() ||
-        static_prefs::pref!("layout.css.xul-display-values.content.enabled")
+        unsafe { structs::StaticPrefs::sVarCache_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() ||
-        static_prefs::pref!("layout.css.xul-box-display-values.content.enabled")
+        unsafe {
+            structs::StaticPrefs::sVarCache_layout_css_xul_box_display_values_content_enabled
+        }
 }
 
 #[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
 fn parse_unimplemented_in_servo_2020(_context: &ParserContext) -> bool {
     true
 }
 
 #[cfg(feature = "servo-layout-2020")]
--- a/servo/components/style/values/specified/grid.rs
+++ b/servo/components/style/values/specified/grid.rs
@@ -300,17 +300,18 @@ impl Parse for TrackList<LengthPercentag
             line_names: names.into(),
         })
     }
 }
 
 #[cfg(feature = "gecko")]
 #[inline]
 fn allow_grid_template_subgrids() -> bool {
-    static_prefs::pref!("layout.css.grid-template-subgrid-value.enabled")
+    use crate::gecko_bindings::structs::mozilla;
+    unsafe { mozilla::StaticPrefs::sVarCache_layout_css_grid_template_subgrid_value_enabled }
 }
 
 #[cfg(feature = "servo")]
 #[inline]
 fn allow_grid_template_subgrids() -> bool {
     false
 }
 
--- a/servo/components/style/values/specified/svg.rs
+++ b/servo/components/style/values/specified/svg.rs
@@ -27,17 +27,18 @@ pub type SVGLength = generic::SVGLength<
 pub type SVGWidth = generic::SVGLength<NonNegativeLengthPercentage>;
 
 /// [ <length> | <percentage> | <number> ]# | context-value
 pub type SVGStrokeDashArray = generic::SVGStrokeDashArray<NonNegativeLengthPercentage>;
 
 /// Whether the `context-value` value is enabled.
 #[cfg(feature = "gecko")]
 pub fn is_context_value_enabled() -> bool {
-    static_prefs::pref!("gfx.font_rendering.opentype_svg.enabled")
+    use crate::gecko_bindings::structs::mozilla;
+    unsafe { mozilla::StaticPrefs::sVarCache_gfx_font_rendering_opentype_svg_enabled }
 }
 
 /// Whether the `context-value` value is enabled.
 #[cfg(not(feature = "gecko"))]
 pub fn is_context_value_enabled() -> bool {
     false
 }