mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Reduce the size of ApplicableDeclarationBlock.
The level is a u8, so on 64-bit it packs nicely after the u32 specificity.
This commit is contained in:
parent
3616b8f0c3
commit
6601ae2810
2 changed files with 7 additions and 4 deletions
|
@ -1524,9 +1524,9 @@ impl Rule {
|
|||
-> ApplicableDeclarationBlock {
|
||||
ApplicableDeclarationBlock {
|
||||
source: StyleSource::Style(self.style_rule.clone()),
|
||||
level: level,
|
||||
source_order: self.source_order,
|
||||
specificity: self.specificity(),
|
||||
level: level,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1557,12 +1557,12 @@ pub struct ApplicableDeclarationBlock {
|
|||
/// The style source, either a style rule, or a property declaration block.
|
||||
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
|
||||
pub source: StyleSource,
|
||||
/// The cascade level this applicable declaration block is in.
|
||||
pub level: CascadeLevel,
|
||||
/// The source order of this block.
|
||||
pub source_order: usize,
|
||||
/// The specificity of the selector this block is represented by.
|
||||
pub specificity: u32,
|
||||
/// The cascade level this applicable declaration block is in.
|
||||
pub level: CascadeLevel,
|
||||
}
|
||||
|
||||
impl ApplicableDeclarationBlock {
|
||||
|
@ -1574,9 +1574,9 @@ impl ApplicableDeclarationBlock {
|
|||
-> Self {
|
||||
ApplicableDeclarationBlock {
|
||||
source: StyleSource::Declarations(declarations),
|
||||
level: level,
|
||||
source_order: 0,
|
||||
specificity: 0,
|
||||
level: level,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue