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

Event path trimming should only happen for mouseover and mouseout #330

Closed
rniwa opened this issue Sep 26, 2015 · 9 comments
Closed

Event path trimming should only happen for mouseover and mouseout #330

rniwa opened this issue Sep 26, 2015 · 9 comments

Comments

@rniwa
Copy link
Collaborator

rniwa commented Sep 26, 2015

It's very strange for the event path trimming algorithm to apply trusted events with relatedTarget.

Why don't we just do this for all mouseover and mouseout events and nothing else. Alternatively, we can add a new constructor option to MouseEvent's init dictionary like stopsAtLowestCommonShadowRoot to explicitly set this behavior so that authors can adjust it. If we did the latter, we'd just make UAs create MouseEvents with that flag set to true when firing trusted events.

@travisleithead @annevk: any opinions?

@rniwa
Copy link
Collaborator Author

rniwa commented Sep 26, 2015

If we (in some off chance) were to keep the currently spec'ed behavior, then the following text belongs to an informative note, not a normative text since this trimming behavior applies to all trusted events.

to avoid the appearance of spurious mouseover and mouse out events firing from the same node

@annevk
Copy link
Collaborator

annevk commented Sep 27, 2015

Doing this flag-based does seem more sane. Since it would actually explain what is going on. (Where did I hear that before?)

@rniwa
Copy link
Collaborator Author

rniwa commented Sep 27, 2015

Yeah, I think I like the flag-based approach best. cc @hober @othermaciej

@hayatoito
Copy link
Contributor

This is the original bug for the current spec. https://www.w3.org/Bugs/Public/show_bug.cgi?id=20017

The flag-based approach is okay to me.
We need a better name than stopsAtLowestCommonShadowRoot. Any idea?

@rniwa
Copy link
Collaborator Author

rniwa commented Sep 28, 2015

An alternative to specify a boolean would be to specify a node at which the propagation stops: e.g. highestTarget. This way, mouseover and mouseout can supply the common ancestor as highestTarget instead. This feature will be slightly more powerful than what's needed by this use case. Although I'd imagine it could become handy in some cases, I'm not sure if it's worth the complexity.

@hayatoito
Copy link
Contributor

I'm not sure how we can resolve this issue. Does someone have a preference?

@rniwa
Copy link
Collaborator Author

rniwa commented Jan 13, 2016

My preference is to add a flag instead of treating trusted events differently since the rationale for trimming the event path is semantically nothing to do with whether event should be trusted or not.

@annevk
Copy link
Collaborator

annevk commented Jan 14, 2016

untilCommonShadowRoot?

@hayatoito
Copy link
Contributor

I think we agreed on using the flag. Let me update the spec so that it uses the flag in relevant sections.

Note that the flag name is not finalized. It could change if we find a better name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants