axe-core icon indicating copy to clipboard operation
axe-core copied to clipboard

Color contrast does not accurately assess overflow

Open WilcoFiers opened this issue 4 years ago • 2 comments

This code causes a color contrast issue to be reported, even though the element with low contrast is hidden because of overflow. This type of thing can happen in carousels for example, when the opacity is reduced as the end state of a fade-out effect.

<style>
  .container {
    width: 200px;
    height: 200px;
    overflow: hidden;
  }
  .foo * {
    width: 200px;
    height: 200px;
  }
  #two {
    color: #eee;
  }
</style>
<div class="container">
  <div class="foo" id="foo">
    <div id="one">hello</div>
    <div id="two">goodbye</div>
  </div>
</div>

WilcoFiers avatar Feb 16 '21 11:02 WilcoFiers

Hi Wilco,

We're seeing the transition issue as well. Here's a simple codepen that can repro it: https://codepen.io/dbjorge/pen/mdRopqe

The related issue on our end pertains to a carousel specifically, here: https://github.com/microsoft/accessibility-insights-web/issues/4144

waabid avatar Apr 27 '21 01:04 waabid

Unfortunately this hasn't quite made the cut for 4.3. We'll push it to 4.4.

WilcoFiers avatar Jul 07 '21 15:07 WilcoFiers

Validated with the latest develop branch axe-core code base, the test script:

<style>
  .container {
    width: 200px;
    height: 200px;
    overflow: hidden;
  }
  .foo * {
    width: 200px;
    height: 200px;
  }
  #two {
    color: #eee;
  }
</style>
<div class="container">
  <div class="foo" id="foo">
    <div id="one">hello</div>
    <div id="two">goodbye</div>
  </div>
</div>

is passing color-contrast rule

image

padmavemulapati avatar Oct 17 '22 16:10 padmavemulapati