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

Update rule aria-required-parent #2012

Closed
jeeyyy opened this issue Feb 4, 2020 · 6 comments
Closed

Update rule aria-required-parent #2012

jeeyyy opened this issue Feb 4, 2020 · 6 comments
Assignees
Labels
Milestone

Comments

@jeeyyy
Copy link
Contributor

jeeyyy commented Feb 4, 2020

Expectation:
For examples below, the rule should fail because required parent role is not correct.

<div role="list">
	<div role="tabpanel">
		<div role="listitem">List item 1</div>
	</div>
</div>
<div role="list" aria-owns="item"></div>

<div id="host"></div>

<script>
	const host = document.querySelector('#host')
	const root = host.attachShadow({ mode: 'open' })
	root.innerHTML = '<div id="item" role="listitem">List item 1</div>'
</script>

Actual:
The rule only looks for parent with an allowed role, without intercepting nodes in between which can have over-ridding roles.

Motivation:
Required for implementation of rule in ACT Rule - https://act-rules.github.io/rules/ff89c9


axe-core version: X.Y.Z
axe-webdriver, extension or other integration version: X.Y.Z

Browser and Assistive Technology versions

For Tooling issues:
- Node version: XX  
- Platform:  
@straker
Copy link
Contributor

straker commented Feb 4, 2020

The check only uses findUp to find the ancestor role but doesn't check if there are any roles in between the ancestor and the current node.

@jeeyyy
Copy link
Contributor Author

jeeyyy commented Feb 28, 2020

Note: This may also need an update to the rule aria-required-children for the inverse scenario of the above example.

@jeeyyy jeeyyy added ACT Rules and removed has pr labels Mar 2, 2020
@jeeyyy jeeyyy changed the title Update rule aria-required-parent [PR] Update rule aria-required-parent Mar 2, 2020
@jeeyyy
Copy link
Contributor Author

jeeyyy commented Mar 2, 2020

Debugged aria-required-children rule and have created a new issue for this - #2076.

As the approach to solve this between these two rules will vary.

@straker straker changed the title [PR] Update rule aria-required-parent Update rule aria-required-parent Jun 17, 2020
@straker
Copy link
Contributor

straker commented Jul 28, 2020

This should be resolved now with latest axe-core (technically the aria-required-children rule fails, so maybe not).

@padmavemulapati
Copy link

aria-required-parent rule should fail when there is an intermediate role between the child and parent
<div role="list"><div role="tabpanel"><p role="listitem" id="target">Nothing here.</p></div></div>
aria-required-parent rule should pass when intermediate node is role=presentation
<div role="list"><div role="presentation"><p role="listitem" id="target">Nothing here.</p></div></div>
aria-required-parent rule should pass when intermediate node is role=none'
<div role="list"><div role="none"><p role="listitem" id="target">Nothing here.</p></div></div>
aria-required-parent rule should pass when intermediate node is not owned by parent
<div role="list" aria-owns="target"><div role="navigation"><p role="listitem" id="target">Nothing here.</p></div></div>

image

@straker
Copy link
Contributor

straker commented Sep 24, 2020

No docs required

@straker straker closed this as completed Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants