Return true in set_property only when declaration block is changed

This commit is contained in:
Xidorn Quan 2017-03-06 22:21:59 +11:00
parent c62973b77b
commit 4f07826837
3 changed files with 13 additions and 10 deletions

View file

@ -266,11 +266,9 @@ impl CSSStyleDeclaration {
// Step 8
// Step 9
// We could try to be better I guess?
*changed = !declarations.is_empty();
*changed = false;
for declaration in declarations {
// TODO(emilio): We could check it changed
pdb.set_parsed_declaration(declaration.0, importance);
*changed |= pdb.set_parsed_declaration(declaration.0, importance);
}
Ok(())