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

Add invokers (invoketarget & invokeaction) #9841

Open
wants to merge 69 commits into
base: main
Choose a base branch
from

Conversation

keithamus
Copy link
Contributor

@keithamus keithamus commented Oct 8, 2023

This adds the invoketarget & invokeaction attributes and an "invoke" event using the InvokeEvent interface.

Button activation checks if the button has an invoke target and if so performs invoke behaviour depending on invokeaction and the target element.

(See WHATWG Working Mode: Changes for more details.)


/browsers.html ( diff )
/form-elements.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/input.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/popover.html ( diff )
/rendering.html ( diff )
/web-messaging.html ( diff )
/webappapis.html ( diff )
/webstorage.html ( diff )
/workers.html ( diff )
/invokers.html ( diff )

@keithamus keithamus changed the title Add invoke Add InvokeElement & InvokeEvent IDLs for Invoke proposal Oct 9, 2023
@keithamus keithamus changed the title Add InvokeElement & InvokeEvent IDLs for Invoke proposal Add InvokeElement & InvokeEvent IDLs & invocation steps for Invoke proposal Oct 9, 2023
@keithamus keithamus marked this pull request as ready for review October 10, 2023 22:28
@keithamus keithamus force-pushed the add-invoke branch 3 times, most recently from 45e4032 to 9579336 Compare October 17, 2023 20:32
@scottaohara
Copy link
Collaborator

scottaohara commented Oct 18, 2023

I realize this is also in the steps for getting the popover target element, but in both cases I'm wondering why its specified to return null if the node is in the disable state?

Doing so, at least with <button popovertarget=foo disabled> testing in chrome, results in that element not exposing whether the popover is in the expanded or collapsed state - as I'm assuming due to

"If node is disabled, then return null."

that state gets removed. That's unexpected, to have that state removed based on whether the button is disabled or not. And for invokertarget - if it is really is going to do more than just show/hide content - there are a lot of other states that should still be exposed, regarless of if the element is in the disabled state or not.

edit: I can file a bug for disabled / popovertarget if necessary - i just wanted to get insight on this first, before I went and made that issue. cc @mfreed7

@keithamus

This comment was marked as outdated.

@lukewarlow
Copy link
Member

Fwiw HTML requires a positive standards position or for chrome LGTMs on an intent to ship to be considered supportive.

Saying that Mozilla have marked their position as positive so that's 1 implementor interested.

I do wonder how this requirement works for a feature such as this which will require multiple PRs to add to the spec?

@domenic
Copy link
Member

domenic commented Nov 5, 2023

a feature such as this which will require multiple PRs to add to the spec?

I'm confused why this feature is being done as multiple PRs; it makes review a good deal harder.

@keithamus
Copy link
Contributor Author

If it makes it easier to review I’m happy to put more into one PR. I figured it would be worthwhile splitting it into the core vs each elements behaviour as I imagine there will be more to discuss with each elements behaviour.

@domenic
Copy link
Member

domenic commented Nov 5, 2023

Well, it'd make it easier for me, but I haven't signed up to review yet, so no need to make any changes until we get some more opinions :)

Edited to add: the reason it makes it more difficult is that I don't think we want to accept the feature piecemeal.

@lukewarlow
Copy link
Member

As per openui/open-ui#900 (comment) this'll need updating to only fire the event when the action is custom (has a hypen) or is recognised and valid (correct action name on correct element).

TLDR is that this will allow us to add default actions in future without conflicting with user land code.

@lukewarlow
Copy link
Member

In openui/open-ui#952 (comment) we resolved that "Invokers v1 will be popover and dialog invoking."

This should help keep this initial PR as small as possible while also avoid the issue of reviewing stuff piecemeal.

So #9875 can be merged into this along with dialog related changes.

@mfreed7
Copy link
Collaborator

mfreed7 commented Jan 17, 2024

Fwiw HTML requires a positive standards position or for chrome LGTMs on an intent to ship to be considered supportive.

Saying that Mozilla have marked their position as positive so that's 1 implementor interested.

Chromium is explicitly supportive of this proposal, so I believe it has two implementer support (including Mozilla).

Is this PR in a state that it can get a review? I'm happy to do so, if it'd help.

@keithamus
Copy link
Contributor Author

I'd be happy to get reviews, I think this is in a good position for that.

source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated Show resolved Hide resolved
@mfreed7
Copy link
Collaborator

mfreed7 commented Jan 17, 2024

I'd be happy to get reviews, I think this is in a good position for that.

Done - I added a first set of comments.

@keithamus
Copy link
Contributor Author

I've got about half way through your new commentary, but I'll tackle the rest later. I've pushed up what I have so far.

@foolip
Copy link
Member

foolip commented May 7, 2024

@keithamus Thank you! Please let me know when I should review again! (I see you pushed some commits after your last comment, but I'm not sure if there's more coming.)

@keithamus
Copy link
Contributor Author

I think I've addressed all your commentary @foolip if you would kindly review again.

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the changes and noticed a few small additional things.

source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Show resolved Hide resolved
@foolip
Copy link
Member

foolip commented May 7, 2024

These are the remaining loose ends in addition to the last round of review comments:

That's all, I think this is ready to merge very soon!

@keithamus
Copy link
Contributor Author

All of the above review comments have been addressed @foolip (including adding the assert), thanks again and as always. I'll go add some WPTs for currentTarget in the meantime.

@foolip foolip changed the title (Invokers Proposal) Add InvokeElement & InvokeEvent IDLs & invocation steps for Dialog & Popover Add invokers (invoketarget & invokeaction) May 8, 2024
@lukewarlow
Copy link
Member

Before merging this I think it would be good to get a resolution on the naming discussions @annevk bought up in the webkit standards position issue. Specifically on if "invoke" is the right name for this feature.

@foolip
Copy link
Member

foolip commented May 8, 2024

@keithamus would you mind providing a simplified commit message? Is something like this enough information?

This adds the invoketarget & invokeaction attributes and an "invoke" event using the InvokeEvent interface.

Button activation checks if the button has an invoke target and if so performs invoke behavior depending on invokeaction and the target element.

@foolip
Copy link
Member

foolip commented May 8, 2024

@annevk Are you OK with invokers as the name of this feature? We have two implementers in support of this.

@past past added the agenda+ To be discussed at a triage meeting label May 9, 2024
keithamus added a commit to keithamus/wpt that referenced this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agenda+ To be discussed at a triage meeting
Development

Successfully merging this pull request may close these issues.

None yet

8 participants