Skip to content

Commit 8bf9391

Browse files
authored
Revert "fix(color-contrast): do not run on elements with font-size: 0 (dequelabs#4822)"
1 parent d0fbb8f commit 8bf9391

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

lib/rules/color-contrast-matches.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ function colorContrastMatches(node, virtualNode) {
137137
return false;
138138
}
139139

140-
if (!parseFloat(virtualNode.getComputedStylePropertyValue('font-size'))) {
141-
return false;
142-
}
143-
144140
const range = document.createRange();
145141
const childNodes = virtualNode.children;
146142
for (let index = 0; index < childNodes.length; index++) {

test/integration/rules/color-contrast/color-contrast.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,3 @@
465465
<div id="ignore13" style="padding-left: 65px">Hello World</div>
466466
</div>
467467
</div>
468-
469-
<div
470-
id="ignore13"
471-
style="background-color: gray; color: white; font-size: 0; font-weight: bold"
472-
>
473-
Ignore.
474-
</div>

test/rule-matches/color-contrast-matches.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,6 @@ describe('color-contrast-matches', function () {
431431
assert.isFalse(rule.matches(target, axe.utils.getNodeFromTree(target)));
432432
});
433433

434-
it('should not match text with font-size: 0', () => {
435-
fixture.innerHTML = '<div style="font-size: 0">hi</div>';
436-
const target = fixture.querySelector('div');
437-
axe.testUtils.flatTreeSetup(fixture);
438-
assert.isFalse(rule.matches(target, axe.utils.getNodeFromTree(target)));
439-
});
440-
441434
if (shadowSupport) {
442435
it('should match a descendant of an element across a shadow boundary', function () {
443436
fixture.innerHTML =

0 commit comments

Comments
 (0)