mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #15338 - upsuper:parse_one_decl, r=emilio
Parse value entirely for setting property via CSSOM Fixes #15037 <!-- 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/15338) <!-- Reviewable:end -->
This commit is contained in:
commit
812a3a1c46
1 changed files with 7 additions and 5 deletions
|
@ -520,11 +520,13 @@ pub fn parse_one_declaration(id: PropertyId,
|
|||
extra_data: ParserContextExtraData)
|
||||
-> Result<Vec<(PropertyDeclaration, Importance)>, ()> {
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author, base_url, error_reporter, extra_data);
|
||||
let mut results = vec![];
|
||||
match PropertyDeclaration::parse(id, &context, &mut Parser::new(input), &mut results, false) {
|
||||
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => Ok(results),
|
||||
_ => Err(())
|
||||
}
|
||||
Parser::new(input).parse_entirely(|parser| {
|
||||
let mut results = vec![];
|
||||
match PropertyDeclaration::parse(id, &context, parser, &mut results, false) {
|
||||
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => Ok(results),
|
||||
_ => Err(())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// A struct to parse property declarations.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue