dequelabs / dequelabs/axe-core
isVisibleOnScreen overflowHidden method does not take into account position parents
Open
commons
fix
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 17
Description
Take the following html
```html
Hello World
#parent {
overflow: hidden;
}
.container {
position: absolute;
top: 500px;
}
```
Running `axe.commons.dom.isVisibleOnScreen(target)` returns false even though the text is clearly visible. This is because our [overflowHidden](https://github.com/dequelabs/axe-core/blob/develop/lib/commons/dom/visibility-methods.js#L111) method doesn't consider the positioned parent in between the target and the `overflow: hidden` ancestor that causes it to be able to break out of the overflow (it only looks at the positioning of the overflowed ancestor).
Contributor guide
Assessment
This issue has not been assessed yet.