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

Prohibit authors from causing conflict resolutions #1288

Open
WilcoFiers opened this issue Jun 16, 2020 · 9 comments
Open

Prohibit authors from causing conflict resolutions #1288

WilcoFiers opened this issue Jun 16, 2020 · 9 comments
Assignees
Labels
clarification clarifying or correcting language that is either confusing, misleading or under-specified
Milestone

Comments

@WilcoFiers
Copy link
Contributor

I was on an ACT related call yesterday, where there was pretty unanimous agreement that accessibility tools should flag occurrences of presentational roles conflict resolution as a best practice issue. Something has clearly gone wrong if you put role="none" and aria-label on the same img element. Right now it seems like ARIA condones this, and just relies on UA to address it. it seems to me that in addition to having the UAs address the problem, authors should be prohibited from doing this in the first place.

As a comparison, in HTML, browsers always use the first title element as the page title, but despite that it is still invalid HTML to have more than one title element. I think that idea, of both prohibiting an obviously bad practice, while still ensuring UA handle things consistently is a good one to follow here too.

@pkra
Copy link
Member

pkra commented Jun 16, 2020

Something has clearly gone wrong if you put role="none" and aria-label on the same img element. Right now it seems like ARIA condones this,

In the current draft, role=presentation lists aria-label under "Prohibited States and Properties":

aria/index.html

Lines 6409 to 6416 in 646f093

<th class="role-disallowed-head" scope="row">Prohibited States and Properties:</th>
<td class="role-disallowed">
<ul>
<li><pref>aria-label</pref></li>
<li><pref>aria-labelledby</pref></li>
</ul>
</td>
</tr>

@jnurthen jnurthen added this to the ARIA 1.3 milestone Jun 16, 2020
@carmacleod
Copy link
Contributor

@jnurthen I think this issue can just be closed as "resolved in ARIA 1.2", and does not need to be deferred to ARIA 1.3?

As @pkra mentioned, the ARIA 1.2 Working Draft for role="presentation" explicitly prohibits aria-label and aria-labelledby in its Characteristics table.

@jnurthen
Copy link
Member

closing as suggested

@WilcoFiers
Copy link
Contributor Author

I don't think this should have been closed. Yes, aria-label is now explicitly prohibited on role=presentation. But the problem is just as valid on other global ARIA attributes. There is nothing in ARIA that prohibits content authors from doing stuff like this, which causes role=none to be ignored:

<h1 role="none" aria-hidden="false">

@pkra
Copy link
Member

pkra commented Jun 1, 2021

@WilcoFiers your #1489 was added to the v1.4 milestone on the last WG call (which is where most issues related to aria-hidden are right now).

@joanmarie
Copy link
Contributor

There's this example in our spec:

<!-- 1. [role="presentation"] is ignored due to the global aria-describedby property. -->
<h1 role="presentation" aria-describedby="comment-1"> Sample Content </h1>

I agree with @WilcoFiers that we don't want to encourage this. Setting none/presentation to having 0 properties in its characteristics table seems like it might be a way to discourage authors. Perhaps also we can add a note like, "If you make this focusable, you are a bad person." 😀

@WilcoFiers
Copy link
Contributor Author

I opened a PR that sort of fits with what I discussed with @jnurthen on Slack.

@joanmarie joanmarie reopened this Jun 1, 2021
@jnurthen jnurthen self-assigned this Jun 3, 2021
@jnurthen jnurthen added the clarification clarifying or correcting language that is either confusing, misleading or under-specified label Sep 13, 2022
@Jym77
Copy link

Jym77 commented Jan 10, 2023

Another case for this is when the conflict resolution is triggered by the (possibly) presentational element being focusable.

In ACT rules, we have a rule Element with presentational children has no focusable content. However, with ARIA 1.2, the conflict resolution tells to ignore the inherited presentational role and expose the focusable element (act-rules/act-rules.github.io#2000).

If causing the conflict resolution was an author error, we could keep flagging that (and map to ARIA rather than WCAG 4.1.2); but if it is not, we should probably just deprecate that rule.

Here's an example of a failure:

<button>
  Save
  <span role="button" aria-label="save options" aria-expanded="false" tabindex="0"></span>
</button>

@scottaohara
Copy link
Member

seems like deprecating the rule would be premature, since behavior is inconsistent depending on navigation method (virtual cursor vs tabbing), the platform and the screen reader / browser pairing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification clarifying or correcting language that is either confusing, misleading or under-specified
Projects
None yet
Development

No branches or pull requests

7 participants