-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Decide which form events need to be scoped #1160
Comments
Actually, maybe input and change should be scoped too, and if a shadow dom thingie wants to expose input and change to the outer world, it could itself dispatch non-scoped input and change events. |
Yeah, I was thinking that might be more logical. I think the main thing we don't want scoped by default is UI events, such as mouse input, keyboard input, focus(?). Cannot really imagine other kind of events that should escape. |
Why is the input event special? |
What would be the criteria of deciding which events will be scoped? |
I think the question is other way round, "which events dispatched in shadow DOM shouldn't be scoped?". In general it is stuff like mousemove. Hmm, I wonder if the flag should have different name, like unscoped, and default to false. |
Yeah, I was gonna about to suggest that re: flip the question. It seems that we want most events to be scoped. |
Why is mousemove special? I'm not agreeing or disagreeing. I'm just trying to get at what the principle underlying your intuition is. |
Because mousemove is user input to the page, not some shadow DOM internal thing being dispatched. |
@smaug---- But I think the principle is mostly that externally generated events are unscoped, whereas events part of some feature or API are scoped. Since feature/API events are much more common than external events, I tend to agree we should change the default here. |
Why don't we call the flag |
Good suggestion. If we go with |
|
|
piercing sounds odd to my non-native-English-speaker ears, also from semantic point of view. What are we piercing here? I'd prefer composed or something similar to that. |
Piercing through the shadow tree root to the shadow host. I'm happy either way. @hayatoito? |
(Japan is having a week long holiday this week so we might need to wait until next Monday to get proper responses) |
Given that:
We are assuming that |Set(2)| > |Set(1) - Set(2)|, right? However, for synthetic events,
We are assuming that developers would set true to the flag explicitly, mostly, right? |
That entirely depends on how developers use events. If they use them in the same way that the platform does, than for them the common case should also be to not set that flag. But if usage as a communication mechanism from a component starts to dominate, they might very well mostly set that flag. Hard to say. I also don't think libraries use synthetic events much, other than for testing events normally dispatched by the user agent. |
Yeah, that's a good point. AFAIK, Polymer uses custom synthetic events as a communication mechanism between components. I guess that's unscoped in most cases. Even if that's true, I do not oppose to flipping a flag. Setting true to the flag should not be a serious burden for developers. Thus, the renaming problem is its naming?
Hmm. I am fan of neither of them. :) However, I can not think of better name, as of now... |
The idea was that if we did |
See whatwg/html#1160 for context.
Not surprisingly I prefer 'composed'. |
See whatwg/html#1160 for context.
I'm working on documenting this on MDN, and during the discussions there is a lot of confusion about the name Event.composed. It doesn't really mean anything obvious. Yeah, it's related to composedPath() but if you don't already know that, you're likely to assume it means something like "the event was automatically created" or who knows what. A name more like Event.bubblePastShadowRoot would be more descriptive of what this property actually seems to do based on my reading of the spec and some code. FWIW. // cc @annevk, @smaug---- |
I think that ship has already sailed. Safari and Chrome have shipped |
.composed has quite little to do with bubble, but plenty to do with propagation. And to be consistent with composedPath, .composed makes sense to me. |
Yeah, chrome has already shipped |
@rniwa @hayatoito @smaug---- @inscriber @travisleithead
So far in #1135 I've marked "submit", "reset", and "invalid" as needing to be scoped. I tend to think we should scope "input" and "change" too, but @smaug---- suggested otherwise. What do other people think?
The text was updated successfully, but these errors were encountered: