Skip to content

Update the aria-required-owned rule [bc4a75] to include the elements with implicit roles #2318

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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

shunguoy
Copy link
Collaborator

@shunguoy shunguoy commented Apr 1, 2025

The original description limits the rule to the elements with explicit semantic roles only. The rule should apply to elements with either explicit or implicit roles.
The changes include the following updates: (1) the description of implicit roles; (2) test cases accordingly; and (3) other minor code cleanups.

Need for Call for Review:
This can be merged with 1 approval

How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Call for Review period. In case of disagreement, the longer period wins.

@CLAassistant
Copy link

CLAassistant commented Apr 1, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

netlify bot commented Apr 1, 2025

Deploy Preview for act-rules ready!

Name Link
🔨 Latest commit 488c53a
🔍 Latest deploy log https://app.netlify.com/sites/act-rules/deploys/681e1125244ab900085c6d4f
😎 Deploy Preview https://deploy-preview-2318--act-rules.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.

@shunguoy shunguoy added Rule Update Use this label for an existing rule that is being updated and removed act-rules-impl labels Apr 1, 2025
@shunguoy shunguoy requested a review from WilcoFiers April 1, 2025 19:59
Copy link
Collaborator

@daniel-montalvo daniel-montalvo left a comment

Choose a reason for hiding this comment

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

Thanks @shunguoy

Approving. Except that I think this does require a regular 2-week Call for review period.

Comment on lines -96 to +97
<li role="none"></li>
<li role="menuitem">Item 1</li>
<div role="none"></div>
<div role="menuitem">Item 1</div>
Copy link
Member

Choose a reason for hiding this comment

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

I see no reason to change this. This is an important example to demonstrate explicit roles override implicit ones.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change was in the original suggestion, I didn't hear objection during the discussion (I could be wrong). Per HTML 5, the li can only be used as a child of ul, ol, or menu. Otherwise, no list relationship is defined:

The li element represents a list item. If its parent element is an ol, ul, or menu element, then the element is an item of the parent element's list, as defined for those elements. Otherwise, the list item has no defined list-related relationship to any other li element.

This change is to make sure no confusion on the relationship, and maintain the purpose of the example at the same time.

@shunguoy
Copy link
Collaborator Author

@WilcoFiers added more Pass/Fail test cases for native elements. Please review again.

@shunguoy shunguoy added the Review call 2 weeks Call for review for new rules and big changes label Apr 17, 2025
Copy link
Collaborator

@giacomo-petri giacomo-petri left a comment

Choose a reason for hiding this comment

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

The applicability now includes implicit roles, but we currently lack any failing examples of them. IMO, if we intend this new applicability to focus on "semantic roles" rather than "explicit roles" only, we should include additional examples that illustrate implicit roles.

@shunguoy
Copy link
Collaborator Author

shunguoy commented May 8, 2025

@giacomo-petri if you review the changes for the rule, I added a few examples with implicit roles: Passed Examples 7 - 9, Failed Examples 8 & 9, some with mixed explicit and implicit roles.

@giacomo-petri
Copy link
Collaborator

@shunguoy, yes, I've noticed the improvements. I was specifically talking and curious if we could have something similar to the Passed Example 9:

<table>
	<tr>
		<td>Item 1</td>
		<td>Item 2</td>
		<td>Item 3</td>
	</tr>
</table>

but for failing examples.

For instance, this scenario is now matching the applicability (and previously it wasn't):

<ul>
    <div></div>
    <div></div>
</ul>

however, we don’t have any examples with this kind of issue.

@shunguoy
Copy link
Collaborator Author

shunguoy commented May 9, 2025

@giacomo-petri added this as Failed Example 10. Also added a note Note that this example is for demonstration purpose only because it's not a valid HTML 5 structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review call 2 weeks Call for review for new rules and big changes Rule Update Use this label for an existing rule that is being updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants