Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-06-07 01:12:56 +02:00
parent 01c6eb3556
commit f39ab4ffc1
2 changed files with 7 additions and 5 deletions

View file

@ -468,7 +468,8 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
let name = KeyframesName::parse(self.context, input)?; let name = KeyframesName::parse(self.context, input)?;
AtRulePrelude::Keyframes(name, prefix) AtRulePrelude::Keyframes(name, prefix)
}, },
"page" if cfg!(feature = "gecko") => { #[cfg(feature = "gecko")]
"page" => {
AtRulePrelude::Page(if static_prefs::pref!("layout.css.named-pages.enabled") { AtRulePrelude::Page(if static_prefs::pref!("layout.css.named-pages.enabled") {
input.try_parse(|i| PageSelectors::parse(self.context, i)).unwrap_or_default() input.try_parse(|i| PageSelectors::parse(self.context, i)).unwrap_or_default()
} else { } else {

View file

@ -33,19 +33,19 @@ use crate::stylesheets::layer_rule::{LayerId, LayerName, LayerOrder};
use crate::stylesheets::viewport_rule::{self, MaybeNew, ViewportRule}; use crate::stylesheets::viewport_rule::{self, MaybeNew, ViewportRule};
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
use crate::stylesheets::{ use crate::stylesheets::{
CounterStyleRule, FontFaceRule, FontFeatureValuesRule, PageRule, ScrollTimelineRule, CounterStyleRule, FontFaceRule, FontFeatureValuesRule, ScrollTimelineRule,
}; };
use crate::stylesheets::{ use crate::stylesheets::{
CssRule, EffectiveRulesIterator, Origin, OriginSet, PerOrigin, PerOriginIter, CssRule, EffectiveRulesIterator, Origin, OriginSet, PageRule, PerOrigin, PerOriginIter,
}; };
use crate::stylesheets::{StyleRule, StylesheetContents, StylesheetInDocument}; use crate::stylesheets::{StyleRule, StylesheetContents, StylesheetInDocument};
use crate::thread_state::{self, ThreadState}; use crate::thread_state::{self, ThreadState};
use crate::AllocErr; use crate::AllocErr;
use crate::{Atom, LocalName, Namespace, ShrinkIfNeeded, WeakAtom}; use crate::{Atom, LocalName, Namespace, ShrinkIfNeeded, WeakAtom};
use fxhash::FxHashMap; use fxhash::FxHashMap;
use malloc_size_of::MallocSizeOf; use malloc_size_of::{MallocSizeOf, MallocShallowSizeOf, MallocSizeOfOps};
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
use malloc_size_of::{MallocShallowSizeOf, MallocSizeOfOps, MallocUnconditionalShallowSizeOf}; use malloc_size_of::MallocUnconditionalShallowSizeOf;
use selectors::attr::{CaseSensitivity, NamespaceConstraint}; use selectors::attr::{CaseSensitivity, NamespaceConstraint};
use selectors::bloom::BloomFilter; use selectors::bloom::BloomFilter;
use selectors::matching::VisitedHandlingMode; use selectors::matching::VisitedHandlingMode;
@ -1644,6 +1644,7 @@ pub struct PageRuleMap {
pub named: PrecomputedHashMap<Atom, SmallVec<[PageRuleData; 1]>>, pub named: PrecomputedHashMap<Atom, SmallVec<[PageRuleData; 1]>>,
} }
#[cfg(feature = "gecko")]
impl PageRuleMap { impl PageRuleMap {
#[inline] #[inline]
fn clear(&mut self) { fn clear(&mut self) {