Changing update_inline_style to process multiple declarations at once to handle shorthand serialization better

This commit is contained in:
David Raifaizen 2016-04-24 01:43:59 -04:00 committed by Simon Sapin
parent f38607967e
commit 3dafd558c5
3 changed files with 131 additions and 81 deletions

View file

@ -157,7 +157,9 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
self.0.next().map(|r| &**r)
}
}
let serialized_value = shorthand.serialize_shorthand_to_string(Map(list.iter()));
// TODO: important is hardcoded to false because method does not implement it yet
let serialized_value = shorthand.serialize_shorthand_value_to_string(Map(list.iter()), false);
return DOMString::from(serialized_value);
}
@ -241,10 +243,8 @@ impl CSSStyleDeclarationMethods for CSSStyleDeclaration {
let element = self.owner.upcast::<Element>();
// Step 8
for decl in declarations {
// Step 9
element.update_inline_style(decl, priority);
}
// Step 9
element.update_inline_style(declarations, priority);
Ok(())
}