Handle attribute changes after changing attribute#1176
Conversation
At least in chromium, synchronous internal listeners for attribute changes which are run as "attribute change steps" are run after the attribute is actually changed, not before. This affects popover attribute related algorithms in HTML: whatwg/html#9048 (comment)
annevk
left a comment
There was a problem hiding this comment.
@josepharhar you want to change all call sites of "Handle attribute changes" presumably.
@smaug---- @rniwa I assume this is the same everywhere and this was just a bug.
|
In Gecko one can handle attribute changes before the value has been added/changed/removed or after, depending on the case. And both are useful. The reason is mostly that BeforeSetAttr can still access the old value (which can be used for unregistering the element from some data structures or cancelling loads etc.), and AfterSetAttr can then trigger whatever the new value should do. But I'm not sure if this is all just implementation detail. Would need to read through how And at least the pr would make the spec inconsistent. Why only |
|
Right, I agree that we should change all of them together. |
Ok, I changed all of them |
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880 UltraBlame original commit: 00b027478170756439b780282f9cfdf15edea985
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880 UltraBlame original commit: 00b027478170756439b780282f9cfdf15edea985
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880 UltraBlame original commit: 00b027478170756439b780282f9cfdf15edea985
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880
whatwg/dom#1176 https://dom.spec.whatwg.org/#concept-element-attributes-change-ext "attribute change steps" at https://html.spec.whatwg.org/multipage/popover.html#attr-popover Differential Revision: https://phabricator.services.mozilla.com/D181880
At least in chromium, synchronous internal listeners for attribute changes which are run as "attribute change steps" are run after the attribute is actually changed, not before.
This affects popover attribute related algorithms in HTML: whatwg/html#9048 (comment)
Preview | Diff