act-rules / act-rules.github.io

Accessibility conformance testing rules for HTML
https://act-rules.github.io/
Other
136 stars 67 forks source link

ACT 23a2a8 Image has non-empty accessible name: Pass 6 & 7 test cases do not follow ARIA in HTML spec #2062

Closed philljenkins closed 1 year ago

philljenkins commented 1 year ago

ACT 23a2a8 Image has non-empty accessible name

https://www.w3.org/WAI/standards-guidelines/act/rules/23a2a8/#test-cases

These test cases do not follow the latest spec in ARIA in HTML https://www.w3.org/TR/html-aria/ (see screenshot below) which says that

So, either the spec needs to change or test cases 6 & 7 need to change.

Background - Equal Access Accessibility Checker

The Checker rules "_aria_rolevalid" and "_img_altvalid" currently fail both of these test cases with a couple of issue messages each:

The help guidance for "_aria_rolevalid" says:

What to do

ARIA in HTML https://www.w3.org/TR/html-aria/ (see screenshot below) image

philljenkins commented 1 year ago

This issue closes the duplicate at https://github.com/w3c/wcag-act-rules/issues/218

WilcoFiers commented 1 year ago

I think HTML in ARIA is stricter than WCAG here. I think that's okay, this isn't good code. Lots of things HTML in ARIA says you shouldn't do don't result in WCAG violations. I think these are important examples to have in this rule, which tests for WCAG conformance issues. It doesn't test HTML in ARIA, but if we ever add such a rule I would think it fails that.

Personally, I think nothing is needed here, but if you want we can certainly add some note or additional description to those examples.

Jym77 commented 1 year ago

I have mixed feelings about this one…

One one hand, I agree that the rule check WCAG, not ARIA in HTML and that these examples are important to test the limit of the rule (and adding alt="" to them wouldn't make them as unitary).

On the other hand, we normally try to avoid Passed Examples that go against official specs, and ARIA in HTML being a W3C Recommendation, we should probably respect it 🤔 This feels a bit like <img role="none" aria-label="hello" src="foo.jpg"> which would be OK as far as WCAG 1.1.1 is concerned (because the presentational conflict triggers and the role is ignored). But it goes against ARIA spec by using a prohibited aria-label attribute. I feel like we would change that example precisely because the attribute is prohibited and then I'm not sure why we'd keep examples going against the ARIA in HTML spec.

I guess we need to discuss that within the group.

philljenkins commented 1 year ago

we normally try to avoid Passed Examples that go against official specs, and ARIA in HTML being a W3C Recommendation, we should probably respect it 🤔

"we" should include the browsers and AT developers too, not only the ACT working group and rules. If all three resect the "official specification" the web will be more interoperable and predictable and harmonize the checking rules to achieve such for our end users.

tombrunet commented 1 year ago

I talked to Scott O'Hara about this one. It looks like there's a PR to change this on the ARIA in HTML side: https://github.com/w3c/html-aria/pull/453/files . He said the current spec was due to some issues with HTML validation, but seems the industry has chosen to ignore that.

philljenkins commented 1 year ago

We will implement a change to the Checker rules as follows: <img role="presentation"> is allowed. <img alt="" role="presentation"> is allowed, but not recommended. <img alt="something" role="presentation"> is not allowed.

Jym77 commented 1 year ago

Let's close this since ARIA in HTML is going to update.