diff --git a/components/style/applicable_declarations.rs b/components/style/applicable_declarations.rs index 168aae643cd..a704741ff0b 100644 --- a/components/style/applicable_declarations.rs +++ b/components/style/applicable_declarations.rs @@ -6,6 +6,7 @@ use crate::properties::PropertyDeclarationBlock; use crate::rule_tree::{CascadeLevel, StyleSource}; +use crate::stylesheets::layer_rule::LayerOrder; use crate::shared_lock::Locked; use servo_arc::Arc; use smallvec::SmallVec; @@ -72,7 +73,7 @@ pub struct ApplicableDeclarationBlock { /// The specificity of the selector. pub specificity: u32, /// The layer order of the selector. - pub layer_order: u32, + pub layer_order: LayerOrder, } impl ApplicableDeclarationBlock { @@ -87,13 +88,13 @@ impl ApplicableDeclarationBlock { source: StyleSource::from_declarations(declarations), bits: ApplicableDeclarationBits::new(0, level), specificity: 0, - layer_order: 0, + layer_order: LayerOrder::first(), } } /// Constructs an applicable declaration block from the given components #[inline] - pub fn new(source: StyleSource, source_order: u32, level: CascadeLevel, specificity: u32, layer_order: u32) -> Self { + pub fn new(source: StyleSource, source_order: u32, level: CascadeLevel, specificity: u32, layer_order: LayerOrder) -> Self { ApplicableDeclarationBlock { source, bits: ApplicableDeclarationBits::new(source_order, level), diff --git a/components/style/stylist.rs b/components/style/stylist.rs index ddcf77140e7..7e2b820498e 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -2184,7 +2184,7 @@ impl CascadeData { self.rules_source_order, CascadeLevel::UANormal, selector.specificity(), - current_layer_order.raw(), + current_layer_order, )); continue; } @@ -2767,7 +2767,7 @@ impl Rule { level: CascadeLevel, ) -> ApplicableDeclarationBlock { let source = StyleSource::from_rule(self.style_rule.clone()); - ApplicableDeclarationBlock::new(source, self.source_order, level, self.specificity(), self.layer_order.raw()) + ApplicableDeclarationBlock::new(source, self.source_order, level, self.specificity(), self.layer_order) } /// Creates a new Rule.