Bug 231038

Summary: Web Inspector: Audit: testForLinkLabels Accessibility audit should ignore anchors if aria-hidden
Product: WebKit Reporter: bugmenot
Component: Web InspectorAssignee: Razvan Caliman <rcaliman>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, cfleizach, ews-watchlist, hi, inspector-bugzilla-changes, kevin_neal, pangle, rcaliman, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch v1.0 none

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 BJ 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].