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 command & commandfor attribute related mappings #2354

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

Conversation

keithamus
Copy link
Member

@keithamus keithamus commented Oct 11, 2024

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:
  • Browser implementations (link to issue or commit):
    • WebKit:
    • Gecko:
    • Blink:
  • Does this need AT implementations?
  • Related APG Issue/PR:
  • MDN Issue/PR:

Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit bf0440a
🔍 Latest deploy log https://app.netlify.com/sites/wai-aria/deploys/671281a46c02b2000847a701
😎 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.

Copy link
Member

@scottaohara scottaohara left a comment

Choose a reason for hiding this comment

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

feel free to reach out if you have questions / want to talk through what i was suggesting

html-aam/index.html Outdated Show resolved Hide resolved
html-aam/index.html Outdated Show resolved Hide resolved
html-aam/index.html Outdated Show resolved Hide resolved
html-aam/index.html Outdated Show resolved Hide resolved
html-aam/index.html Outdated Show resolved Hide resolved
html-aam/index.html Outdated Show resolved Hide resolved
@keithamus
Copy link
Member Author

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 keithamus force-pushed the add-commandfor-attribute-related-mappings branch from 345eeda to 0b1053c Compare October 17, 2024 22:29
@scottaohara
Copy link
Member

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

<li>The element is a descendant of the `popover` it is associated with.</li>
<!-- accessibility sibling will be defined in the ARIA specification -->
</ul>
<p class="note">A button that has a [=button/form owner=] without `type` in the "`button`" state cannot invoke a command.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

A plain old <button> is not enough? IT has to have a type attribute?

Copy link
Member Author

Choose a reason for hiding this comment

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

Discussing further in whatwg/html#9841 I think I misunderstood past decisions, but a form owner button with an implicit type should revert to button when it has the command/commandfor attributes so this is actually wrong, I'll fix.

@@ -1257,6 +1257,328 @@ <h4 id="el-button">`button`</h4>
</tr>
</tbody>
</table>
<h4 id="el-button-command-togglepopover">`button` <span class="el-context">(`command` attribute in the Toggle popover state)</span></h4>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a difference in what we expose for toggle vs show? Can we the combine mapping entries for those into one?

<td><a class="core-mapping" href="#role-map-button">`button`</a> role.</td>
</tr>
<tr>
<th>
Copy link
Contributor

Choose a reason for hiding this comment

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

No mappings for this one? What about the details relation?

Copy link
Member

Choose a reason for hiding this comment

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

being a button that opens a modal dialog and where focus will automatically be put into the dialog once it's opened, there's no need for any additional mappings.

Copy link
Contributor

Choose a reason for hiding this comment

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

I probably need to apply the patch and view the HTML to make sure this fact stands out enough.

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

Successfully merging this pull request may close these issues.

3 participants