You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In whatwg/html#9841 (comment)@annevk and I discussed some of the spec around the CommandEvent as part of command/commandfor. The source attribute on the CommandEvent performs logic to retarget the element based on its currentTarget, however while this works in browsers it doesn't work so well in the spec. To quote the conversation there:
@annevk: How does this work when it's initialized synthetically? There's also a wrapping problem.
@keithamus: I am unsure how to answer this, as far as I know this just kind of works? If the currentTarget is an element and its tree-root is not the same as the document then it'll be retargeted to the tree-root host. Therefore currentTarget won't return elements that cross a shadow boundary. Is this not the correct way to express that in the spec?
@annevk: If the source attribute is initialized to something it can't also have a getter. I'm not really sure how to make this work specification-wise. This would require some kind of internal slot, but since those are not formalized it would currently clash with how event constructors are defined...
What is missing is the ability to have associated event data. @annevk mentioned in a DM:
I have an idea of sorts that I think can work. I used to think we needed IDL stuff for this, but we can do this by defining an internal "extras" map on event objects that we fill with these data members.
Hopefully I've captured this properly, and we have an idea of what needs to happen to proceed.
The text was updated successfully, but these errors were encountered:
Thanks! Yeah, this is a longstanding issue where we don't define the internal layout of event objects and instead pretend you can set their public API somehow. Using an Infra map we can fully define the internal layout in a way that's extensible without needing IDL to generate this internal layout for us.
(And the reason I mention IDL is that I previously thought we'd need IDL for this: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27354#c10. With Infra maps and IDL dictionaries mapping to maps I don't think that's true anymore.)
What is the issue with the DOM Standard?
In whatwg/html#9841 (comment) @annevk and I discussed some of the spec around the
CommandEvent
as part ofcommand/commandfor
. Thesource
attribute on theCommandEvent
performs logic to retarget the element based on itscurrentTarget
, however while this works in browsers it doesn't work so well in the spec. To quote the conversation there:What is missing is the ability to have associated event data. @annevk mentioned in a DM:
Hopefully I've captured this properly, and we have an idea of what needs to happen to proceed.
The text was updated successfully, but these errors were encountered: