Repository navigation
[cssom] Add a test for mutation records when CSSStyleDeclaration.setPropertyValue is invoked. - #10429
Conversation
…ropertyValue is invoked. https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setpropertyvalue always ends up in https://drafts.csswg.org/cssom/#update-style-attribute-for (step 8), which calls https://dom.spec.whatwg.org/#concept-element-attributes-set-value, which does queue a mutation record even if the value doesn't change. This makes this consistent with setAttribute("style", getAttribute("style")), for example.
upsuper
left a comment
There was a problem hiding this comment.
Could you add another test for removing non-existing property (ideally from a declaration with some declarations, because Gecko optimizes the case where the declaration doesn't exist at all).
| }); | ||
|
|
||
| m.observe(document.documentElement, { attributes: true }); | ||
| document.documentElement.style.top = "0px"; |
There was a problem hiding this comment.
I'm less sure about whether we should optimize this case, since it's not really changing the value. But detecting equivalence of value is probably not that trivial spec-wise... so given the spec currently, I guess this is fine.
|
It's fine to optimize that afaict. Removing a property goes through https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty, which only calls "update the style attribute" if |
|
Ok, added tests for all those. |
upsuper
left a comment
There was a problem hiding this comment.
All the tests can really be done in a single file with multiple subtests... but it's not a big problem anyway.
|
Yeah, the issue is that it complicates the tests, and if one times out or something then the rest of the tests wouldn't run. |
1 similar comment
|
Yeah, the issue is that it complicates the tests, and if one times out or something then the rest of the tests wouldn't run. |
Even if it doesn't mutate the block.
https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setpropertyvalue always
ends up in https://drafts.csswg.org/cssom/#update-style-attribute-for (step 8),
which calls https://dom.spec.whatwg.org/#concept-element-attributes-set-value,
which does queue a mutation record even if the value doesn't change.
This makes this consistent with
setAttribute("style", getAttribute("style")),for example.