-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Event dispatch/firing should reuse DOM terms better #1713
Comments
That seems a little weird. Once we have internal slots as a thing, we basically want HTML to set some internal slots, right? I'm not sure why [[cancelable]] and [[bubbles]] should be privileged above all other internal slots and have magic addressing. I agree with everything else and would like to put some time in some of this as it helps address some issues in DOM too. |
I think we don't need to have double-bracket notation to have internal slots. IMO the existing "that is cancelable" is a way of setting the already-existing implicit cancelable internal slot. (Most places would state this as "associated cancelable flag", but I guess DOM does not at the moment.) I don't feel strongly either way though, and I see you've already made the changes in #1886 in your preferred direction, so I'm happy to go along with that. Will try to review that later today. |
Sure, agreed on the double brackets, but we also have (And the main reason DOM doesn't define these as concepts at the moment is that I'd much rather have IDL do this automatically as internal slots (whatever the notation). Otherwise each new event basically needs a bunch of boilerplate to define its concepts and all the "automagic" language we have around the constructor would become way more involved or break down.) |
We already did for "trusted", I think? And yeah, I can see how events could be a special case given how they have such a generic internal structure/construction algorithm/re-initialization algorithm. |
Well, I'm just holding out with events due to their nature, but once we have automatic internal slots I'd use them everywhere. Not having to define "associated concepts" would be terrific. HTML does have something specific for trusted indeed although defined by reference to the |
Fixes #187. Follow up work in HTML is tracked in whatwg/html#1713.
Fixes #187. Follow up work in HTML is tracked in whatwg/html#1713.
This aligns firing and dispatching of events with updated terminology in the DOM Standard. Among the changes: * A lot less usage of "default action" which isn't really a thing. Instead we make use of the return value of the fire and dispatch algorithms. * Instead of saying things bubble or are cancelable we initialize the attributes as such. * We no longer re-state defaults for isTrusted, bubbles, and cancelable, as that only leads to confusion when they are *not* re-stated. * We now use the legacy target override flag rather than supplying a named argument. This fixes whatwg#1713, but plenty of follow up issues remain: * whatwg#805 for the remainder of "default action" usage * whatwg#1394 for updating synthetic click events * whatwg#1887 for removing "fire a simple event" usage * whatwg#1893 for updating when checkboxes get checked * whatwg#1900 for figuring out if event dispatch requires more hooks * whatwg#1912 for revisiting isTrusted usage * whatwg#1913 for updating synthetic mouse events * whatwg#1922 for making more events composed
https://html.spec.whatwg.org/#concept-event-fire defines firing an event and dispatching an event, but instead it should just link to the definitions in DOM: https://dom.spec.whatwg.org/#concept-event-fire and https://dom.spec.whatwg.org/#concept-event-dispatch
Things to consider:
The text was updated successfully, but these errors were encountered: