fix(label-in-name): remove SC-failing inapplicable examples - #2443
Open
WilcoFiers wants to merge 2 commits into
Open
WilcoFiers wants to merge 2 commits into
WilcoFiers wants to merge 2 commits into
Conversation
Removed inapplicable examples regarding abbreviations and non-standard terms from the document.
✅ Deploy Preview for act-rules ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
dan-tripp-siteimprove
approved these changes
Sep 3, 2026
HelenBurge
approved these changes
Sep 3, 2026
HelenBurge
left a comment
Collaborator
There was a problem hiding this comment.
This one is interesting as I know the use of ABBR is not supported by mobile screen readers, but agree this is not inapplicable.
kengdoj
previously requested changes
Sep 3, 2026
kengdoj
left a comment
Collaborator
There was a problem hiding this comment.
Because these are inapplicable for the rule, I added an explanation as to why they are not included on line 53.
chutchins25
added a commit
to dequelabs/axe-core
that referenced
this pull request
Sep 10, 2026
…rd (#5345) ## Summary Implements the comparison at the core of ACT rule 2ee8b8's [label in name algorithm](https://www.w3.org/WAI/standards-guidelines/act/rules/2ee8b8/proposed/#label-in-name-algorithm). The check compared the accessible name and the visible label as raw character substrings, so `Discover It` matched `Discover Italy`. Both strings are now tokenized into words at non-text characters — replaced with a space rather than deleted — and the label's words must form a **contiguous run** within the name. Supporting change: a backward-compatible `replaceWith` option on `removeUnicode`, built from axe's explicit unicode ranges rather than a `\p{…}` property escape, to keep Safari 7+ and IE11 working. ## Scope Per @straker on #5203, abbreviation and hyphenation differences are an **accepted divergence** from ACT: > We are accepting that Inapplicable 5 & 6 will fail instead of incomplete and should be skipped. See act-rules/act-rules.github.io#2443 So the check reports those as violations and the two testcases stay skipped. There is no `incomplete` branch for punctuation. Three algorithm steps remain unimplemented: 1. Parenthetical-content removal — tracked on #5207, which also covers the `Passed Example 11` whitespace case 2. Unicode case folding + NFKD normalization — the CJK and full-width half of this is tracked on #5308 3. Language-aware word segmentation (this splits on whitespace) — not tracked The `wcag-act-rules` dependency bump called out on #5203 is tracked as #5346. ## ACT 2ee8b8 results The `act` nightly installs `wcag-act-rules#main` (38 2ee8b8 testcases), not the pinned dependency (15). Verified against `main`: **34 passing / 4 pending / 0 failing**. | Skipped testcase | Reason | | --- | --- | | Inapplicable 5 — `University Ave.` | Accepted divergence (abbreviation) | | Inapplicable 6 — `non-standard` | Accepted divergence (hyphenation) | | Passed 11 — `<span>Download</span><span> </span><span>specification</span>` | #5207. `visibleVirtual` recurses per child and `sanitize()`s each result, so a whitespace-only inline element is trimmed to `''` and the words join into `downloadspecification`. A `commons/text` fix, not a rule fix. | | Passed 14 — `Search by date (YYYY-MM-DD)` | #5207. Needs the parenthetical-removal step. | `Failed Example 3` and `Failed Example 15` were previously skipped under #5207 and are fixed by word-level matching, so their skips are removed. I confirmed the two accepted-divergence skips are load-bearing: unskipping them against `main` produces exactly two failures. ## Notes Supersedes #5302, which was opened against #4311 before @straker closed that as a duplicate of #5203. The tokenizer here is the part of #5302 that survived review; the punctuation `incomplete` branch it grew is dropped per the ruling above. The `publish-metadata.js` change from #5302 is not carried over — it is out of scope for a rule PR, and the underlying defect is now tracked as #5344. Ref #5203
Co-authored-by: Kathy Eng <kengdoj@users.noreply.github.com>
G0dwin
approved these changes
Sep 14, 2026
kengdoj
approved these changes
Sep 14, 2026
straker
pushed a commit
to dequelabs/axe-core
that referenced
this pull request
Sep 14, 2026
## Summary Implements step 1 of ACT 2ee8b8's [label in name algorithm](https://www.w3.org/WAI/standards-guidelines/act/rules/2ee8b8/proposed/#label-in-name-algorithm) — *"Remove parentheses … and all characters that are between a left and right parenthesis"* — applied to both the visible label and the accessible name before tokenising. So `Search by date (YYYY-MM-DD)` now matches an accessible name of `Search by date`, where previously the parenthesised suffix produced extra tokens and failed the contiguous-subsequence check. Nested pairs collapse by removing innermost pairs repeatedly; the loop terminates because every pass strictly shortens the string. ## ACT 2ee8b8 Verified against `wcag-act-rules#main`, which is what the nightly installs: **35 passing / 3 pending / 0 failing**, up from 34/3/1 — `Passed Example 14` now passes and its `skipTests` entry is removed. Pinned dependency stays at 14 passing / 1 pending. Remaining skips are unchanged: `Inapplicable Example 5` and `6` (accepted divergence, act-rules/act-rules.github.io#2443) and `Passed Example 11`, which is not an algorithm problem — see below. ## Known gap The algorithm names U+0028 and U+0029 specifically, so full-width parentheses `()` used in CJK content are not removed. NFKD normalisation would map them to their ASCII forms; that's step 2 of the algorithm, tracked on #5308. ## Scope This is step 1 only. #5207 also covers `Passed Example 11`, where `visibleVirtual` recurses per child and `sanitize()`s each result, trimming a whitespace-only inline element to `''` so `Download` and `specification` join into one token. That fix lives in `lib/commons/text/visible-virtual.js` and changes what "visible text" means for every rule that reads it, so it needs a separate decision — asked on #5207. Refs #5207
sorinfratila
approved these changes
Sep 15, 2026
|
Should they be moved to failure examples then? |
straker
pushed a commit
to dequelabs/axe-core
that referenced
this pull request
Sep 15, 2026
…every level (#5368) ## Summary `visibleVirtual` ends every recursive call with `sanitize()`, which trims. A whitespace-only child therefore collapses to `''` before the parent joins its children, gluing together the words on either side: ```html <a aria-label="Download specification" ><span>Download</span><span id="space"> </span><span>specification</span></a > ``` produced `downloadspecification`, which no downstream tokenizing can recover. Per the decision on #5207 — keep using `visibleVirtual` rather than writing a rule-specific text function — nested calls now return their text as-is and only the outermost call sanitizes. The recursion passes an internal `skipSanitize` option, so the public signature and every existing call site are unchanged. ## Effect ACT `2ee8b8` against `wcag-act-rules#main`, which is what the nightly installs: **36 passing / 2 pending / 0 failing**, up from 35/3/0. `Passed Example 11` passes with its `skipTests` entry removed; the two remaining pendings are the accepted abbreviation/hyphenation divergence (act-rules/act-rules.github.io#2443). Against the pinned dependency: 14 passing / 1 pending, unchanged. Whitespace at the edge of a child element is now also kept as a word separator — `<span>Hello </span><span>world</span>` returns `Hello world` where it previously returned `Helloworld`. That is the same defect, and it is what the algorithm's "maintaining space between spans" requires. ## Testing Three unit tests in `test/commons/text/visible-virtual.js`, each confirmed red before the change. `visibleVirtual` feeds `color-contrast` (`noRecursing: true`, unaffected), `duplicate-img-label`, `form-control-value`, `aria.labelVirtual`, `text.labelVirtual` and `label-content-name-mismatch`. Locally green: every unit suite, the 136-page selenium integration run, `test:node`, `test:jsdom`, `test:locales`, `test:tsc` and `eslint`, with no existing test needing a change. Closes issue #5207
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed inapplicable examples regarding abbreviations and non-standard terms from the document. These two may be inapplicable to the rule, but IMO they fail the success criterion. There is are no exceptions for abbreviations in this WCAG criterion. By having these as inapplicable examples we prohibit implementors from failing these.
Need for Call for Review: 1 week
How to Review And Approve