Match on PropertyId (not strings) to parse a declaration.

This commit is contained in:
Simon Sapin 2016-12-09 09:23:01 -10:00
parent 58d452fa4e
commit 433c33c4df
6 changed files with 49 additions and 42 deletions

View file

@ -165,8 +165,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
}
// Step 3
// FIXME: give ownership on `property` here when parse_one_declaration can take &PropertyId
let id = if let Ok(id) = PropertyId::parse((&*property).into()) {
let id = if let Ok(id) = PropertyId::parse(property.into()) {
id
} else {
// Unkwown property
@ -203,7 +202,7 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
// Step 6
let window = window_from_node(&*self.owner);
let declarations =
parse_one_declaration(&property, &value, &window.get_url(), window.css_error_reporter(),
parse_one_declaration(id, &value, &window.get_url(), window.css_error_reporter(),
ParserContextExtraData::default());
// Step 7