Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dom.isVisible does not take into account 0 width element #3171

Closed
straker opened this issue Sep 28, 2021 · 1 comment
Closed

dom.isVisible does not take into account 0 width element #3171

straker opened this issue Sep 28, 2021 · 1 comment
Labels
fix Bug fixes pr A pr has been created for the issue

Comments

@straker
Copy link
Contributor

straker commented Sep 28, 2021

Consider the following dom:

<style>
  .target {
    width: 0;
    height: 50px;
    overflow-y: scroll;
  }

  .sub {
    height: 200px;
    width: 200px;
    background: blue;
  }
  </style>

  <div class="target">
    <div class="sub">Hello World</div>
  </div>

Calling axe.commons.dom.isVisible on the .target element results in true, even though visually the element is hidden. However, if we swap the width/height values, the element is then considered hidden. It seems our isVisible function only looks at height as a way to hide the element but does not consider width.

.target {
    width: 50px;
    height: 0;
    overflow-y: scroll;
  }

This is the cause of #2674

@straker straker added the fix Bug fixes label Sep 28, 2021
@straker straker added the pr A pr has been created for the issue label Oct 7, 2021
@padmavemulapati
Copy link

Validated with the latest axe-core develop branch code base,
seeing scrollable-region-focusible failing when width of scroll regions is zero (0), using color-constrast
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes pr A pr has been created for the issue
Projects
None yet
Development

No branches or pull requests

3 participants