Skip to content
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

Should "If target's root is a shadow root, then set event’s target attribute and event’s relatedTarget to null. " be based on the path before dispatch #562

Closed
smaug---- opened this issue Jan 15, 2018 · 2 comments
Labels
topic: events topic: shadow Relates to shadow trees (as defined in DOM)

Comments

@smaug----
Copy link
Collaborator

.

@smaug---- smaug---- changed the title Should "If target's root is a shadow root, then set event’s target attribute and event’s relatedTarget to null. " be based on target's root before dispatch Should "If target's root is a shadow root, then set event’s target attribute and event’s relatedTarget to null. " be based on the path before dispatch Jan 15, 2018
@annevk annevk added the topic: shadow Relates to shadow trees (as defined in DOM) label Jan 16, 2018
@annevk
Copy link
Member

annevk commented Mar 8, 2018

This was initially added for #511 by @TakayoshiKochi.

If we move target out of a shadow tree, relatedTarget would still leak, so yeah, we should probably change the logic here.

I also think my logic in #513 (comment) was wrong with respect to relatedTarget not able to leak something. If you dispatch a synthetic event and set relatedTarget yourself you would be able to leak something. It's a little unclear if we should guard against that, but it seems reasonable?

Another problem here is that we don't reset anything for touch events. I'm not sure how to address them.

@whatwg/components

annevk added a commit that referenced this issue Mar 8, 2018
We cannot set them to null based on post-dispatch conditions.

And we need to check each of them rather only the target.

Tests: ...

Fixes #562.
@annevk
Copy link
Member

annevk commented Mar 8, 2018

To be clear, #585 is the PR for this, which builds on #584 which provides better infrastructure for touch events.

annevk added a commit to web-platform-tests/wpt that referenced this issue Mar 8, 2018
annevk added a commit that referenced this issue Mar 14, 2018
We cannot set them to null based on post-dispatch conditions.

And we need to check each of them rather only the target.

Tests: ...

Fixes #562.
annevk added a commit that referenced this issue Mar 27, 2018
We cannot set them to null based on post-dispatch conditions.

And we need to check each of them rather only the target.

Tests: ...

Fixes #562.
@annevk annevk closed this as completed in fc16564 Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: events topic: shadow Relates to shadow trees (as defined in DOM)
Development

No branches or pull requests

2 participants