mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Refactor CSSStyleDeclaration::setProperty to not synthesize a name: value
string to parse.
This commit is contained in:
parent
e2984349ed
commit
d2bd070dc3
3 changed files with 23 additions and 20 deletions
|
@ -5534,6 +5534,15 @@ pub fn parse_style_attribute(input: &str, base_url: &Url) -> PropertyDeclaration
|
|||
parse_property_declaration_list(&context, &mut Parser::new(input))
|
||||
}
|
||||
|
||||
pub fn parse_one_declaration(name: &str, input: &str, base_url: &Url)
|
||||
-> Result<Vec<PropertyDeclaration>, ()> {
|
||||
let context = ParserContext::new(Origin::Author, base_url);
|
||||
let mut results = vec![];
|
||||
match PropertyDeclaration::parse(name, &context, &mut Parser::new(input), &mut results) {
|
||||
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => Ok(results),
|
||||
_ => Err(())
|
||||
}
|
||||
}
|
||||
|
||||
struct PropertyDeclarationParser<'a, 'b: 'a> {
|
||||
context: &'a ParserContext<'b>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue