IBMa / equal-access

IBM Equal Access Accessibility Checker contains tools to automate accessibility checking from a browser or in a continuous development/build environment
Apache License 2.0
617 stars 79 forks source link

[BUG]: label_name_visible bug with off screen content #1889

Open tombrunet opened 3 months ago

tombrunet commented 3 months ago

Project

accessibility-checker-engine

Browser

Chrome

Operating system

MacOS

Description

Issue triggering regarding label in name, but non-visible label is being used in the calculation

Steps to reproduce

Testcase:

<button aria-label="Visible label">
  <span style="position:absolute;left:-1000px">Offscreen content</span>
  Visible label
</button>

2.5.3 requires that the visible text is in the accessible name. The rule is also looking for the offscreen text (which isn't visible) to be included in the accessible name. While this particular scenario is odd in that there is screen reader specific text which is then overridden via aria-label to not expose the screen reader specific text, it's technically not a 2.5.3 violation.

philljenkins commented 3 months ago

One way to resolve this might be to separate the failure reasons when the item is off screen.

shunguoy commented 3 months ago

The rule input_label_visible calculates the off-screen label as part of the label.