Bug 231038 - Web Inspector: Audit: testForLinkLabels Accessibility audit should ignore anchors if aria-hidden
Summary: Web Inspector: Audit: testForLinkLabels Accessibility audit should ignore anc...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Safari 15
Hardware: All All
: P2 Normal
Assignee: Razvan Caliman
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-30 14:14 PDT by bugmenot
Modified: 2021-10-28 09:28 PDT (History)
9 users (show)

See Also:


Attachments
Patch v1.0 (1.93 KB, patch)
2021-10-26 06:25 PDT, Razvan Caliman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bugmenot 2021-09-30 14:14:05 PDT
Currently, the Accessibility audit "testForLinkLabels" applies to anchors even if aria-hidden="true". This makes little sense, since a aria-label has no effect if the element is aria-hidden.


Steps to Reproduce

1. Create an HTML file with an anchor that has the aria-hidden attribute set to "true", e.g.

<a aria-hidden="true" tabindex="-1" href="#">foobar</a>

2. Run the Audit


Expected Result

testForLinkLabels passes.


Actual Result

testForLinkLabels fails.
Comment 1 Kevin Neal 2021-10-01 15:00:01 PDT
Thank you for filing. The appropriate engineers have been notified.
Comment 2 Radar WebKit Bug Importer 2021-10-01 15:00:14 PDT
<rdar://problem/83783868>
Comment 3 Razvan Caliman 2021-10-26 06:25:17 PDT
Created attachment 442483 [details]
Patch v1.0
Comment 4 Razvan Caliman 2021-10-26 06:29:03 PDT
If the link has text content, it will be used as the label. 
A better test case is to skip the text completely:

```
<a aria-hidden="true" tabindex="-1" href="#"></a>
```
Comment 5 Patrick Angle 2021-10-26 08:33:05 PDT
Comment on attachment 442483 [details]
Patch v1.0

Can we add a test case to `LayoutTests/inspector/audit/run-accessibility.html`?
Comment 6 Patrick Angle 2021-10-28 09:15:27 PDT
(In reply to Patrick Angle from comment #5)
> Comment on attachment 442483 [details]
> Patch v1.0
> 
> Can we add a test case to
> `LayoutTests/inspector/audit/run-accessibility.html`?

Discussed with Razvan offline; I was incorrect - these tests test the special WebInspectorAudit.Accessibility functions, not the audits themselves.
Comment 7 Blaze Burg 2021-10-28 09:24:31 PDT
Comment on attachment 442483 [details]
Patch v1.0

rs=me
Comment 8 EWS 2021-10-28 09:28:10 PDT
Committed r284986 (243633@main): <https://commits.webkit.org/243633@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442483 [details].