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

label-content-name-mismatch incorrectly fails close button with #4386

Closed
WilcoFiers opened this issue Mar 27, 2024 · 0 comments · Fixed by #4402
Closed

label-content-name-mismatch incorrectly fails close button with #4386

WilcoFiers opened this issue Mar 27, 2024 · 0 comments · Fixed by #4402
Assignees
Labels
experimental fix Bug fixes rules Issue or false result from an axe-core rule support

Comments

@WilcoFiers
Copy link
Contributor

WilcoFiers commented Mar 27, 2024

This should not fail the label-content-name-mismatch rule:

<button aria-label="Close">×</button>

I think sort of generally this rule should not fail on single character content elements. For this case I think the "×" needs to be added to the list of chars never to fail. I'm not sure why it isn't already. It would be good to go over the list of unicode characters we're always allowing. There are clearly some gaps there.

More generally, even if we encounter single-character texts (excluding digits) that are not on the list it would be better to incomplete them instead of failing. We do a similar thing in the color-contrast rule just to be on the safe side.

@WilcoFiers WilcoFiers added fix Bug fixes rules Issue or false result from an axe-core rule support experimental labels Mar 27, 2024
@WilcoFiers WilcoFiers added this to the Axe-core 4.10 milestone Mar 27, 2024
gaiety-deque added a commit that referenced this issue Apr 9, 2024
… text characters

adds exceptions for (dismiss) ×, wysiwyg characters b, aA, abc

fix: #4386
gaiety-deque added a commit that referenced this issue Apr 11, 2024
gaiety-deque added a commit that referenced this issue Apr 11, 2024
…s var -> const

isHumanInterpretable was getting lengthy, refactored into several small functions
unit test used var, switched to const

Refs: #4386
gaiety-deque added a commit that referenced this issue Apr 11, 2024
…, ignore cap

Addresses all feedback on PR #4402

- Simpler symbolic text check, ignoring case, with unit test for both
- Added back "x" and "X" in unit test
- Removed trim step, uneeded
- Reverted set to list, uneeded
- removed /i in non-digit regex
- test for a CJK character
- adjusted integration test labels for single character incompletes, noticed an ordering bug and corrected

Refs: #4386
gaiety-deque added a commit that referenced this issue Apr 11, 2024
Followed Steven's advice for a simpler non-digit single character check, added a test to show a digit isn't incompleted

Refs: #4386
gaiety-deque added a commit that referenced this issue Apr 15, 2024
… text characters (#4402)

adds exceptions for (dismiss) `×`, wysiwyg characters `b`, `aA`, `abc`

fix: #4386

---

This does _not_ handle all potential use cases. Potential shortcomings
worth discussing and opening further issues for are as follows:

- Considering other languages, such as [this example in German including
"UT", "AD" or "DGS"](w3c/wcag#3304)
- The original issue #4386 mentioned this being handled as a character
limit, but it's unclear if that's a valid option. Consider [the WCAG
`ABC`
example](https://www.w3.org/WAI/WCAG21/Understanding/images-of-text-no-exception#examples)
- **EDIT**: Does not specifically have test cases for [math expressions
and
formulae](https://www.w3.org/WAI/WCAG21/Understanding/label-in-name.html#mathematical-expressions-and-formulae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental fix Bug fixes rules Issue or false result from an axe-core rule support
Projects
None yet
2 participants