Open Jym77 opened 2 years ago
this also seems to be an issue for 2.5.3 (Visible labels included in accessible names). Visible labels sometimes include icons made with Material or something similar, but when comparing the visible label with aria-label, the icon text is included when doing the comparison (which of course is misleading, because the icon text is often very unrelated to the matter of the label)
Perhaps we should consider whether <i>
tags should be ignored from all checks that relates to text?
Yes, that will pretty much affect R14 which checks for 2.5.3.
I'm not up for straight out ignoring <i>
elements, since they can be used for other things that icons (and the use for icons is already borderline and mostly a trick to have CSS i { font: font-awesome }
). According to one of my favourite part of the HTML specs:
The
i
element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts.
So, <i>For Søren</i>, this is the <i>Millenium Falcon!</i>
is the correct way to write things and is definitely text content…
Some fonts, like Font Awesome, or Material Icons Two Tone, are replacing text by icons.
Check that these two fonts are indeed always non-text content, and ignore corresponding text in R14, R66, R69.
We can add morefont exception later.
May bring to the point where we'll want a isNonTextContent
predicate or something.
Some fonts, like Font Awesome, or Material Icons Two Tone, are replacing text by icons. We should probably consider them as non-text content (assuming the font loads) to avoid false positives on SC and rules that only consider text (e.g. 1.4.4), …