mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
style: Store a LayerOrder in ApplicableDeclarationBlock
This shouldn't change behavior jut yet. Differential Revision: https://phabricator.services.mozilla.com/D129380
This commit is contained in:
parent
77078dd660
commit
5f2a29659f
2 changed files with 6 additions and 5 deletions
|
@ -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),
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue