Repository navigation
Conversation
…readable alt in image-redundant-alt #1249 #1273 Signed-off-by: Nik Cubrilovic <[email protected]>
Contributor
Author
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.
Fixes #1249
Fixes #1273
What changed
a11y/form-field-multiple-labels: labels are collected as a set of label elements, as a browser'sinput.labelsdoes. A<label for="a">that wrapsid="a"is one label. A wrapping label whosefornames another control does not label this one, and a wrapping label labels only its first labelable control (HTML's labeled control rule).forids are matched as strings, not spliced into a selector. Two real labels on one control still warn with an accurate count.a11y/image-redundant-alt: the filename test now needs the alt to look like a raw filename or slug (a single token, or the decoded filename spelled exactly).alt="Google Partner Logo"ongoogle-partner-logo.svgpasses;alt="arrow-downwards"onarrow-downwards.svgstill warns; the redundant-prefix, surrounding-text and figcaption checks are untouched. Percent-escapes in the filename are decoded before comparing.perRuleTallychange.Tests (failing first)
packages/rules/tests/form-field-multiple-labels-1249.test.ts(6 of its 10 cases failed before the fix) andpackages/rules/tests/image-redundant-alt-1273.test.ts(2 failed before).rule-verdict-scope,template-verdict-inputs,template-verdict-page-independence,docs-rule-pages,docs-category-table,streaming-rules-canonical-golden(no pin moved),make validateindocs/.scripts/test-suites.ts --run rulessuite and an end-to-endsquirrel auditof the issue pages; no real-site smoke test.Docs:
docs/rules/a11y/form-field-multiple-labels.mdx,docs/rules/a11y/image-redundant-alt.mdx. Skill: none.Note (review)
image-redundant-alt: an alt written as a spaced raw filename that is not the decoded filename exactly (for examplealt="IMG 1234"onIMG_1234.jpg) no longer warns, because whitespace now marks a readable description. Accepted trade-off.