-
Notifications
You must be signed in to change notification settings - Fork 295
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
Attribute change steps should run after setting the value, not before #1190
Comments
Could you review #1176? I think there are a couple attribute listeners that might run script and they're not as bad as mutation events, but if there are multiple there could well be ordering issues I suppose. |
It solves the ordering problem. You still have synchronous notification of a node tree mutation. I think when I previously looked into such notifications I did not find them problematic for attributes. But maybe someone else should look into that again, especially with Chromium wanting to remove mutation events. |
Given #1176 was merged, this can be closed? |
I think so. @emilio please reopen or say something if you disagree. |
https://dom.spec.whatwg.org/#concept-element-attributes-change first runs the change steps, then sets the value.
That means that if the steps trigger something that then changes the relevant attribute, per spec we should keep the "old" value, which seems wrong.
Example:
Per spec, after clicking the value the
popover
attribute should not be there, which is wrong and doesn't match implementations.My guess is that modulo that case this is generally not very observable, because other attribute change steps are usually async.
It feels very weird tho that
removeAttribute
runs script synchronously for popover btw...cc @mbrodesser-Igalia, @mfreed7, @domenic, @annevk, @smaug----
The text was updated successfully, but these errors were encountered: