aria icon indicating copy to clipboard operation
aria copied to clipboard

Add command & commandfor attribute related mappings

Open keithamus opened this issue 1 year ago • 8 comments

This adds the mapping for command and commandfor attributes as per the Invokers Explainer.

Additions:

Test, Documentation and Implementation tracking

Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.

  • [ ] "author MUST" tests:
  • [ ] "user agent MUST" tests:
  • [x] Browser implementations (link to issue or commit):
    • WebKit: https://bugs.webkit.org/show_bug.cgi?id=269672
    • Gecko:
    • Blink: https://chromium-review.googlesource.com/c/chromium/src/+/5942728
  • [x] Does this need AT implementations? Yes
  • [ ] Related APG Issue/PR:
  • [ ] MDN Issue/PR:

WebKit internal tests: https://searchfox.org/wubkat/source/LayoutTests/accessibility/mac/expanded-notification-commandfor-popover.html

Chrome internal tests: https://source.chromium.org/chromium/chromium/src/+/main:content/test/data/accessibility/html/commandfor-api-popover.html;l=1?q=commandfor.*api&sq= & https://source.chromium.org/chromium/chromium/src/+/main:content/test/data/accessibility/html/commandfor-api-dialog.html


Preview | Diff

keithamus avatar Oct 11 '24 20:10 keithamus

Deploy Preview for wai-aria ready!

Name Link
Latest commit 956a062df8b71e2fbff2d4e33273fb98a57193bd
Latest deploy log https://app.netlify.com/sites/wai-aria/deploys/67ed49fd5315090008a88040
Deploy Preview https://deploy-preview-2354--wai-aria.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Oct 11 '24 20:10 netlify[bot]

Okay @scottaohara I've expanded it as you described, I think it makes a lot more sense. Now each state has its own table which prescibes how that state should map. I've included all currently specified states, toggle/show/hide popover, close, and show modal.

keithamus avatar Oct 17 '24 22:10 keithamus

ok i think this can work.

we still need attribute tables for command and command for. but as far as i'm concerned, those attribute tables could be simplified to just list the attribute, and point to the instances you made in the element section.

e.g., like how the type attribute for inputs is listed - but simpler... i could see that just removing all the individual mapping rows and in the comments, just link to the first of the button (command in the x state) tables you made.

(mental note to reduce redundancy and unnecessary page link by squashing all "not mapped" or "see ..." rows into a single comment row for other attributes too...)

scottaohara avatar Oct 18 '24 20:10 scottaohara

https://github.com/whatwg/html/pull/9841 is close to ready. Is this expected to be merged soon @scottaohara & @aleventhal? Ideally we can merge both around the same time.

annevk avatar Dec 04 '24 16:12 annevk

@keithamus i have taken some of aaron's feedback and reconfigured this a bit.

The related states are now their own mapping tables popover (toggle,show,hide) and dialog (close, show-modal). These have been moved to the attribute section, rather than in the element section. This was more just a partial re-consolidation and moving around, where the only major change I made was removed the mappings for aria-expanded for the close command. Exposing that state should have been similar to a close button within a popover, where the expanded state isnt' necessary to communicate in that context.

i added the missing commandfor table - but it's largely there to indicate that it serves as a way to associate the button and the element it commands - but again the mappings under the command states are where any programmatic associations that need to be exposed to users are defined.

cc @aleventhal @jcsteh @cookiecrook / @rahimabdi for reviews for your platforms - but not much should be different here since these mappings were already similarly specified for popover/popovertarget.

I'm particularly curious if Webkit is looking to implement any of the aria-details relationships that chrome/firefox have implemented, and if anything more specific needs to be added to the ax row of the command=show,hide,toggle (or popovertarget for that matter)

scottaohara avatar Dec 10 '24 19:12 scottaohara

@annevk pending reviews, i think @keithamus did a good job getting this setup, and i spent parts of today finishing it up. pinged reviewers in my previous comment.

scottaohara avatar Dec 10 '24 19:12 scottaohara

If https://github.com/whatwg/html/pull/11045 is merged this PR will need updating to handle the request-close command alongside the close command.

(or a follow-up if this gets merged per the HTML spec being merged)

lukewarlow avatar Feb 19 '25 16:02 lukewarlow

(non-authoritative non-a11y person) LGTM

lukewarlow avatar Mar 07 '25 18:03 lukewarlow

As this has landed in the html spec, is shipped in chrome/edge and is being implemented by other browsers, i'm merging this PR.

scottaohara avatar Apr 02 '25 14:04 scottaohara