From f39ab4ffc1b5354a12efdeac7722bd5372673c5c Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Wed, 7 Jun 2023 01:12:56 +0200 Subject: Further changes required by Servo --- components/style/stylesheets/rule_parser.rs | 3 ++- components/style/stylist.rs | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/style/stylesheets/rule_parser.rs b/components/style/stylesheets/rule_parser.rs index 868137b52cd..9c0095bc32d 100644 --- a/components/style/stylesheets/rule_parser.rs +++ b/components/style/stylesheets/rule_parser.rs @@ -468,7 +468,8 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> { let name = KeyframesName::parse(self.context, input)?; AtRulePrelude::Keyframes(name, prefix) }, - "page" if cfg!(feature = "gecko") => { + #[cfg(feature = "gecko")] + "page" => { AtRulePrelude::Page(if static_prefs::pref!("layout.css.named-pages.enabled") { input.try_parse(|i| PageSelectors::parse(self.context, i)).unwrap_or_default() } else { diff --git a/components/style/stylist.rs b/components/style/stylist.rs index dffc2e849ce..a1ad4aab659 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -33,19 +33,19 @@ use crate::stylesheets::layer_rule::{LayerId, LayerName, LayerOrder}; use crate::stylesheets::viewport_rule::{self, MaybeNew, ViewportRule}; #[cfg(feature = "gecko")] use crate::stylesheets::{ - CounterStyleRule, FontFaceRule, FontFeatureValuesRule, PageRule, ScrollTimelineRule, + CounterStyleRule, FontFaceRule, FontFeatureValuesRule, ScrollTimelineRule, }; use crate::stylesheets::{ - CssRule, EffectiveRulesIterator, Origin, OriginSet, PerOrigin, PerOriginIter, + CssRule, EffectiveRulesIterator, Origin, OriginSet, PageRule, PerOrigin, PerOriginIter, }; use crate::stylesheets::{StyleRule, StylesheetContents, StylesheetInDocument}; use crate::thread_state::{self, ThreadState}; use crate::AllocErr; use crate::{Atom, LocalName, Namespace, ShrinkIfNeeded, WeakAtom}; use fxhash::FxHashMap; -use malloc_size_of::MallocSizeOf; +use malloc_size_of::{MallocSizeOf, MallocShallowSizeOf, MallocSizeOfOps}; #[cfg(feature = "gecko")] -use malloc_size_of::{MallocShallowSizeOf, MallocSizeOfOps, MallocUnconditionalShallowSizeOf}; +use malloc_size_of::MallocUnconditionalShallowSizeOf; use selectors::attr::{CaseSensitivity, NamespaceConstraint}; use selectors::bloom::BloomFilter; use selectors::matching::VisitedHandlingMode; @@ -1644,6 +1644,7 @@ pub struct PageRuleMap { pub named: PrecomputedHashMap>, } +#[cfg(feature = "gecko")] impl PageRuleMap { #[inline] fn clear(&mut self) { -- cgit v1.2.3