-
Notifications
You must be signed in to change notification settings - Fork 371
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
Does relatedTargetScoped need changes #486
Comments
For synthetic events, relatedTargetScoped should be false by default. The context is: Yeah, "true by default in all cases" is desired, I think. However, I could not do it for synthetic events because it would break the compatibility. Though this compatibility risk looks very low, IMO. I did not realize that relatedTargetScoped is violating layering. Can we have a hook in event path calculation in DOM events so that UI events spec can use it? |
Ah okay, if true by default is not possible I guess the flag is fine. And yeah, I'm wondering whether a hook would be better since |
What backwards compatibility issue are we talking about? This flag only affects events that cross a shadow boundary, which didn't exist in the past so I don't understand what kind of compatibility concern we have. |
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20017 explained that. |
@rniwa I think the issue would be synthetic events. @hayatoito isn't there some way that we could only do this of the original target was inside a shadow tree? That should avoid that concern I think. |
That could be possible if it is okay to have a special rule. Thus, by default:
Actually, Blink did a similar thing so that we do not break a compatibility in the past, AFAIR. Then, we can rename the flag to unScopedRelatedTarget ( I do not have any good name), whose value is false by default in all cases. |
I think if we flipped the default we don't need a flag at all for v1. And we just special case all events that have Also paging @smaug---- and @inscriber. |
Yeah there may not be any clean way around special-casing the dispatch of touch events here. That's what blink's implementation has to do already (EventPath::adjustForTouchEvent), so I guess it's not too surprising to require some parallel complexity in the spec. It's an interesting question to ask whether an event with multiple logical related elements is an inherently bad DOM event design or not. There are some reasons why this approach to handling multi touch is better for developers and for performance than (eg.) dispatching a separate event per touch point (like Pointer Event do), but it's quite debatable. |
I would like to solve this issue. I'm fine with Anne's proposal in #486 (comment)
Is there any objection to this idea? |
One more question: Should we do "relatedTargetScoped" for all kinds of events whenever they have relatedTarget property? e.g.
I am fine with "only for 1". WDYT? |
Event interface doesn't have relatedTarget property. |
Thanks. That matches my understanding! |
Yeah, only when there's an IDL-defined relatedTarget attribute. Ideally at some point that manifests itself as an internal slot [[relatedTarget]] which we can talk about in specifications and content cannot recreate, but until we reach that precision I guess we should just talk about a relatedTarget attribute... |
It seems for all user-agent-dispatched events this will be true. However, its value is false by default. If true is indeed the desired default, should we not name it differently?
unScopedRelatedTarget
or some such.It's also only relevant for UI events, not DOM events in general. It seems like a pretty bad layering violation, though it's not entirely clear to me if we can solve that. (We have a couple of those already with shadow trees, so it might not be too bad.)
The text was updated successfully, but these errors were encountered: