Product
axe-core
Product Version
4.4.3
Latest Version
Issue Description
Expectation
Elements marked aria-hidden="true" should be skipped by color-contrast rule as purely decorative (https://www.w3.org/TR/WCAG22/#contrast-minimum).
Actual
color-contrast rule fails on elements with low contrast intended to be decorative and marked aria-hidden="true".
How to Reproduce
html snippet
<i class="material-icon-i material-icons-extended _ngcontent-agc-196" role="img" aria-hidden="true">brightness_1</i>
sample unit test
// test/rule-matches/color-contrast-matches.js
it('should not match aria-hidden=true', function () {
fixture.innerHTML = '<i aria-hidden="true">hi</i>';
var target = fixture.querySelector('i');
axe.testUtils.flatTreeSetup(fixture);
assert.isFalse(rule.matches(target, axe.utils.getNodeFromTree(target)));
});
Additional context
https://www.w3.org/TR/WCAG22/#contrast-minimum
The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for the following:
...
- Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement.
...
Product
axe-core
Product Version
4.4.3
Latest Version
Issue Description
Expectation
Elements marked
aria-hidden="true"should be skipped bycolor-contrastrule as purely decorative (https://www.w3.org/TR/WCAG22/#contrast-minimum).Actual
color-contrastrule fails on elements with low contrast intended to be decorative and markedaria-hidden="true".How to Reproduce
html snippet
sample unit test
Additional context
https://www.w3.org/TR/WCAG22/#contrast-minimum