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

ARIA role="presentation" not supported #149

Closed
Hywan opened this issue Jan 22, 2016 · 2 comments
Closed

ARIA role="presentation" not supported #149

Hywan opened this issue Jan 22, 2016 · 2 comments

Comments

@Hywan
Copy link
Contributor

Hywan commented Jan 22, 2016

Hello :-),

The role="presentation" definition is the following:

The DOM descendants are presentational. User agents SHOULD NOT expose descendants of this element through the platform accessibility API. If user agents do not hide the descendant nodes, some information may be read twice.

A more detailed explanation can be found.

So, for instance, we can write this:

<a href="" role="presentation">…</a>

and it is a valid HTML from the accessibility point of view.

What is the strategy to implement this in HTML_CodeSniffer? The goal is to check that any selected element in no a child or an element with a role="presentation" attribute.

@Hywan
Copy link
Contributor Author

Hywan commented Jan 22, 2016

The rule F92 from WCAG 2.0 can be worth to notice.

Hywan added a commit to Hywan/TheA11yMachine that referenced this issue Jan 22, 2016
Hywan added a commit to Hywan/TheA11yMachine that referenced this issue Jan 29, 2016
ironikart added a commit that referenced this issue Aug 24, 2016
…aria-hidden attributes for #149 and #151.

isAccessibilityHidden() tests whether a given element is visible to an accessibility API.

isVisuallyHidden() was previously isHidden() and tests only if the element is visible in the browser.

getAllElements() replaces a private method in HTMLCS called _getAllTags(). The function accepts a parent element and returns an array of child elements that are not hidden from accessibility APIs. HTMLCS uses this as an initial gather of elements to test, but there are still many core query selectors used in individual sniffs which may need to be made aware of hidden elements and react accordingly.

Intially these seems to work with most common use case of avoiding tests of an element and all of it's children.
@ironikart ironikart self-assigned this Aug 25, 2016
@ironikart
Copy link
Contributor

Resolved in master branch by filtering presentation elements out of the main loop of elements to sniff and individually testing these elements for F92.

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

Successfully merging a pull request may close this issue.

3 participants