dequelabs / dequelabs/axe-core

isVisibleOnScreen overflowHidden method does not take into account position parents

Open
#4,539 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.