Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/rules/color-contrast-matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ function colorContrastMatches(node, virtualNode) {
return false;
}

if (!parseFloat(virtualNode.getComputedStylePropertyValue('font-size'))) {
return false;
}

const range = document.createRange();
const childNodes = virtualNode.children;
for (let index = 0; index < childNodes.length; index++) {
Expand Down
7 changes: 0 additions & 7 deletions test/integration/rules/color-contrast/color-contrast.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,3 @@
<div id="ignore13" style="padding-left: 65px">Hello World</div>
</div>
</div>

<div
id="ignore13"
style="background-color: gray; color: white; font-size: 0; font-weight: bold"
>
Ignore.
</div>
7 changes: 0 additions & 7 deletions test/rule-matches/color-contrast-matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,6 @@ describe('color-contrast-matches', function () {
assert.isFalse(rule.matches(target, axe.utils.getNodeFromTree(target)));
});

it('should not match text with font-size: 0', () => {
fixture.innerHTML = '<div style="font-size: 0">hi</div>';
const target = fixture.querySelector('div');
axe.testUtils.flatTreeSetup(fixture);
assert.isFalse(rule.matches(target, axe.utils.getNodeFromTree(target)));
});

if (shadowSupport) {
it('should match a descendant of an element across a shadow boundary', function () {
fixture.innerHTML =
Expand Down