Skip to content

Conversation

@zcorpan
Copy link
Contributor

@zcorpan zcorpan commented Oct 10, 2019

Fixes #4407.

Tests: web-platform-tests/wpt#18390


@annevk are some of the terms here not exported in DOM but should be?

@zcorpan zcorpan requested review from annevk and emilio October 10, 2019 09:50
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|.
Copy link
Collaborator

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.

Copy link
Contributor Author

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>.
Copy link
Member

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".

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@zcorpan zcorpan merged commit aa73c4d into w3c:master Oct 11, 2019
@zcorpan zcorpan deleted the cssom-view-addListener branch October 11, 2019 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cssom-view] The addListener(listener) spec doesn't match with current DOM spec

3 participants