-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
@emilio did you want to have a final look at this as well?
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
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
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