mirror of
https://github.com/servo/servo.git
synced 2025-08-29 09:08:20 +01:00
Only cascade at a priority level rules that have declarations of that priority.
This commit is contained in:
parent
16bbc2f26e
commit
a175c9981e
6 changed files with 99 additions and 36 deletions
|
@ -46,6 +46,8 @@ fn property_declaration_block_should_serialize_correctly() {
|
|||
|
||||
let block = PropertyDeclarationBlock {
|
||||
declarations: Arc::new(declarations),
|
||||
any_important: true,
|
||||
any_normal: true,
|
||||
};
|
||||
|
||||
let css_string = block.to_css_string();
|
||||
|
@ -62,6 +64,8 @@ mod shorthand_serialization {
|
|||
pub fn shorthand_properties_to_string(properties: Vec<PropertyDeclaration>) -> String {
|
||||
let block = PropertyDeclarationBlock {
|
||||
declarations: Arc::new(properties.into_iter().map(|d| (d, Importance::Normal)).collect()),
|
||||
any_important: false,
|
||||
any_normal: true,
|
||||
};
|
||||
|
||||
block.to_css_string()
|
||||
|
|
|
@ -93,6 +93,8 @@ fn test_parse_stylesheet() {
|
|||
longhands::display::SpecifiedValue::none)),
|
||||
Importance::Important),
|
||||
]),
|
||||
any_normal: false,
|
||||
any_important: true,
|
||||
},
|
||||
}),
|
||||
CSSRule::Style(StyleRule {
|
||||
|
@ -138,6 +140,8 @@ fn test_parse_stylesheet() {
|
|||
longhands::display::SpecifiedValue::block)),
|
||||
Importance::Normal),
|
||||
]),
|
||||
any_normal: true,
|
||||
any_important: false,
|
||||
},
|
||||
}),
|
||||
CSSRule::Style(StyleRule {
|
||||
|
@ -192,6 +196,8 @@ fn test_parse_stylesheet() {
|
|||
(PropertyDeclaration::BackgroundClip(DeclaredValue::Initial),
|
||||
Importance::Normal),
|
||||
]),
|
||||
any_normal: true,
|
||||
any_important: false,
|
||||
},
|
||||
}),
|
||||
CSSRule::Keyframes(KeyframesRule {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue