mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Make PropertyDeclarationBlock::important_count private.
This commit is contained in:
parent
460fd6eba8
commit
da4e5146e9
10 changed files with 183 additions and 219 deletions
|
@ -56,7 +56,7 @@ pub struct PropertyDeclarationBlock {
|
|||
pub declarations: Vec<(PropertyDeclaration, Importance)>,
|
||||
|
||||
/// The number of entries in `self.declaration` with `Importance::Important`
|
||||
pub important_count: usize,
|
||||
important_count: usize,
|
||||
}
|
||||
|
||||
impl PropertyDeclarationBlock {
|
||||
|
@ -68,6 +68,14 @@ impl PropertyDeclarationBlock {
|
|||
}
|
||||
}
|
||||
|
||||
/// Create a block with a single declaration
|
||||
pub fn with_one(declaration: PropertyDeclaration, importance: Importance) -> Self {
|
||||
PropertyDeclarationBlock {
|
||||
declarations: vec![(declaration, importance)],
|
||||
important_count: if importance.important() { 1 } else { 0 },
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns wheather this block contains any declaration with `!important`.
|
||||
///
|
||||
/// This is based on the `important_count` counter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue