color-contrast returns elmPartiallyObscured due to subpixel rounding in fullyEncompasses (Firefox/Linux)
Maintainers usually reply within 1 day
@darshpatel1052 is already working on this.
Since Nov 3, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- html, javascript
- Domain
- accessibility, testing-qa
Research direction
Start by locating fullyEncompasses() and its tests, then trace how getBackgroundColor uses the containment check for the color-contrast rule. Reproduce the Firefox/Linux case from the issue and check whether a small tolerance fixes the fractional boundary comparison. Done means the low contrast text is reported as a violation in Firefox as it is in Chrome, with relevant tests passing.
Written by the indexing model from the issue text.
Description
Product
axe-core
Product Version
4.14.0 (also reproduces on 4.10.3)
Latest Version
- I have tested the issue with the latest version of the product
Issue Description
Expectation
On Firefox/Linux, color-contrast should report the low-contrast text as a violation, the same as Chrome does on the same page.
Actual
On Firefox 158 / Linux, color-contrast returns 0 violations and 4 incomplete (elmPartiallyObscured). Chrome reports the violation.
Users testing on Linux Firefox (common in CI) will miss real contrast violations.
How to Reproduce
- Firefox 158 on Linux
- Open https://qateam.dequecloud.com/attest/api/test.html
- Inject axe-core 4.14.0 and run:
axe.run({ runOnly: ['color-contrast'] }) - Result: 0 violations, 4 incomplete (
elmPartiallyObscured). Chrome reports the violation.
Additional context
Root cause: fullyEncompasses() (used by getBackgroundColor) checks whether the text sits inside the coloured background element with an exact comparison, rect.bottom <= bottom, with no allowance for rounding.
On Linux, Firefox's layout lands on fractional pixel values. The red <p> is the last child of #wcag2aa:
| Element | bottom |
|---|---|
text box of <p> |
732.9000244 px |
#wcag2aa |
732.9000091 px |
That ~0.00002 px rounding difference makes axe decide the element is partially obscured. It only affects text that is the last thing inside a coloured box.
Ruled out: same result with and without a display, with a 1920×3000 window, with Times-compatible fonts installed, and on axe-core 4.10.3 and 4.14.0.
Proof / suggested fix: adding a 0.01 px tolerance to that one comparison makes Firefox/Linux report color-contrast (1 violation), matching Chrome.
- Dominant language
- HTML
- Stars
- 7.8k
- Forks
- 998
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 16
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dequelabs/axe-core
-
aria-roles: the invalidrole failure message reads as if the role it names is validPossibly taken @gilsonator claimed this 7 days ago. Openfix rule metadata
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
dequelabs/axe-core#5541 · 1 comment ·
Maintainers usually reply within 1 day
-
docs ungroomed
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
ci
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dequelabs/axe-core#5487 · 2 comments ·
Maintainers usually reply within 1 day
-
Map summary-name to ACT rule 2t702hPossibly taken @KyPython claimed this 34 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
ungroomed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dequelabs/axe-core#5455 · 2 comments ·
Maintainers usually reply within 1 day
All issues in dequelabs/axe-core
Similar issues
-
bug good first issue needs-review
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Battle-Cattle/BCUK-Bot-4#1127 ·
Maintainers usually reply within 1 day
-
desktop grp:ui-blocks type:graphics-bug ui-public
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
w3c/wcag-act-rules#484 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
pydata/pydata-sphinx-theme#2589 ·
Maintainers usually reply within 2 days