-
Notifications
You must be signed in to change notification settings - Fork 756
[cssom-view] Update {add,remove}Listener() to hook into DOM correctly #4408
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
Conversation
| 1. <a spec=dom>Add an event listener</a> with the <a spec=dom>context object</a> | ||
| and an <a spec=dom>event listener</a> whose | ||
| <a spec=dom for="event listener">type</a> is <code>change</code>, | ||
| and <a spec=dom for="event listener">callback</a> is |callback|. |
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 should probably specify what happens when callback is null explicitly, which is nothing?
Though I guess per https://dom.spec.whatwg.org/#add-an-event-listener step 2 we're alright, so maybe not worth it.
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.
Yeah, no need to check it multiple times.
| <a spec=dom for="event listener">callback</a> is |callback|, | ||
| and <a spec=dom for="event listener">capture</a> is false, | ||
| then <a spec=dom>remove an event listener</a> with | ||
| the <a spec=dom>context object</a> and that <a spec=dom>event listener</a>. |
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.
I wonder if we should fold this conditional into "remove an event listener".
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.
That would make sense to me.
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.
I think currently it does not because HTML doesn't need it, but it would effectively be a no-op for HTML so probably okay. Alternative we have this and an inner variant that HTML invokes directly.
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.
No strong opinion. But I don't think we need to block this PR on this tweak. We can always change again in a followup.
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.
I filed whatwg/dom#788.
Fixes #4407.
Tests: web-platform-tests/wpt#18390
@annevk are some of the terms here not exported in DOM but should be?