Skip to content

Missing machinery for associated Event data #1328

Open
@keithamus

Description

@keithamus

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 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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions