Skip to content

Conversation

@cacieprins
Copy link
Contributor

@cacieprins cacieprins commented Dec 10, 2025

Expands the visibility section in "interacting with elements" to include the "fast" visibility algorithm heuristics/semantics. Cross-references with links, and links to the main github issue tracking this experiment.

@cacieprins cacieprins marked this pull request as ready for review December 10, 2025 17:37
@AtofStryker AtofStryker self-requested a review December 10, 2025 17:42
@cypress
Copy link

cypress bot commented Dec 10, 2025

cypress-documentation    Run #810

Run Properties:  status check passed Passed #810  •  git commit 7d81ab4afc: Merge branch 'release/15.8.0' into experimental-fast-visibility
Project cypress-documentation
Branch Review experimental-fast-visibility
Run status status check passed Passed #810
Run duration 05m 23s
Commit git commit 7d81ab4afc: Merge branch 'release/15.8.0' into experimental-fast-visibility
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 311
View all changes introduced in this branch ↗︎
UI Coverage  10.67%
  Untested elements 2546  
  Tested elements 3  
Accessibility  97.2%
  Failed rules  1 critical   3 serious   4 moderate   0 minor
  Failed elements 27  

#### An element is considered hidden if:

- Its `width` or `height` is `0`.
- Its CSS property (or ancestors) is `visibility: hidden`.
Copy link
Contributor

Choose a reason for hiding this comment

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

More of a nit but this reads kind of strange to me since elements can have multiple properties? Feel free to ignore this since you are just moving the section 😅

Suggested change
- Its CSS property (or ancestors) is `visibility: hidden`.
- It (or ancestors) has CSS property `visibility: hidden`.

hidden when
[asserting on the element's visibility directly](/app/references/assertions#Visibility).

However elements where the CSS property (or ancestors) is `opacity: 0` are
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
However elements where the CSS property (or ancestors) is `opacity: 0` are
However, elements where the CSS property (or ancestors) is `opacity: 0` are


#### Limitations

Experimental fast visibility is an experimental feature that is still under development. It is not yet fully compatible with the legacy visibility algorithm.
Copy link
Contributor

Choose a reason for hiding this comment

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

does this imply that we are trying to achieve backwards compatibility at some point?


The fast visibility algorithm provides several advantages over the legacy algorithm:

- **Better performance**: Constant-time in the best case, and bounded exponential in the worst case (when point sampling on a fully hidden element)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know how this compares directly to the current algorithm or is determining complexity for that incredibly challenging to distill briefly?


:::caution

The experimental fast visibility algorithm is not yet fully compatible with the legacy visibility algorithm. Tests that rely on edge-case behavior of the legacy visibility algorithm may fail or behave incorrectly.
Copy link
Contributor

Choose a reason for hiding this comment

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

This transition feels awkward but I don't love my suggestion.

Suggested change
The experimental fast visibility algorithm is not yet fully compatible with the legacy visibility algorithm. Tests that rely on edge-case behavior of the legacy visibility algorithm may fail or behave incorrectly.
The experimental fast visibility algorithm is not yet fully compatible with the legacy visibility algorithm. Tests that rely on edge-case behavior of the legacy visibility algorithm may fail or behave incorrectly. Remember, following apply to the experimental fast visibility algorithm:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants