Skip to content

Clarify limitations of Element.checkVisibility()#44443

Merged
hamishwillee merged 2 commits into
mdn:mainfrom
tim-we:improve-check-visibility
Jun 16, 2026
Merged

Clarify limitations of Element.checkVisibility()#44443
hamishwillee merged 2 commits into
mdn:mainfrom
tim-we:improve-check-visibility

Conversation

@tim-we

@tim-we tim-we commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Description

I want to make the limitations of checkVisibility more obvious. For example when an element is occluded the checkVisibility method may still return true.

Motivation

The current version claims this:

checks whether the element is visible

while the spec uses more careful wording:

whether an element is potentially "visible"

I think this is slightly misleading as there are many cases in which an element is not visible to the user but this method still returns true. Even with all the optional checks enabled.

Additional details

Specification

Related issues and pull requests

No related PRs or issues.

@tim-we tim-we requested a review from a team as a code owner June 13, 2026 18:55
@tim-we tim-we requested review from hamishwillee and removed request for a team June 13, 2026 18:55
@github-actions github-actions Bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Jun 13, 2026
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

(comment last updated: 2026-06-16 02:08:14)

Comment thread files/en-us/web/api/element/checkvisibility/index.md Outdated

@hamishwillee hamishwillee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much @tim-we

@hamishwillee hamishwillee merged commit 9128682 into mdn:main Jun 16, 2026
9 checks passed
@tim-we

tim-we commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@hamishwillee thanks for the review. I think some minor mistakes snuck in the changes, I opened up a follow up PR here: #44492

@tim-we tim-we deleted the improve-check-visibility branch June 16, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants