mirror of
https://github.com/servo/servo.git
synced 2025-06-24 00:54:32 +01:00
Auto merge of #15918 - munyari:whitespace, r=emilio
PropertyDeclaration with CSSWideKeyword is parsed Addresses #15401 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15918) <!-- Reviewable:end -->
This commit is contained in:
commit
4a63581fad
2 changed files with 24 additions and 1 deletions
|
@ -1175,7 +1175,9 @@ impl PropertyDeclaration {
|
|||
pub fn value_is_unparsed(&self) -> bool {
|
||||
match *self {
|
||||
PropertyDeclaration::WithVariables(..) => true,
|
||||
PropertyDeclaration::Custom(..) => true,
|
||||
PropertyDeclaration::Custom(_, ref value) => {
|
||||
!matches!(value.borrow(), DeclaredValue::CSSWideKeyword(..))
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1130,4 +1130,25 @@ mod shorthand_serialization {
|
|||
assert_eq!(serialization, block_text);
|
||||
}
|
||||
}
|
||||
|
||||
mod keywords {
|
||||
pub use super::*;
|
||||
#[test]
|
||||
fn css_wide_keywords_should_be_parsed() {
|
||||
let block_text = "--a:inherit;";
|
||||
let block = parse_declaration_block(block_text);
|
||||
|
||||
let serialization = block.to_css_string();
|
||||
assert_eq!(serialization, "--a: inherit;");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_keyword_custom_property_should_be_unparsed() {
|
||||
let block_text = "--main-color: #06c;";
|
||||
let block = parse_declaration_block(block_text);
|
||||
|
||||
let serialization = block.to_css_string();
|
||||
assert_eq!(serialization, block_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue