Skip to content

docs: fast visibility now supports Shadow DOM with documented caveats#6435

Open
mschile wants to merge 1 commit intomschile/fast-visibility-scroll-into-viewfrom
mschile/pensive-black-034995
Open

docs: fast visibility now supports Shadow DOM with documented caveats#6435
mschile wants to merge 1 commit intomschile/fast-visibility-scroll-into-viewfrom
mschile/pensive-black-034995

Conversation

@mschile
Copy link
Copy Markdown
Contributor

@mschile mschile commented May 5, 2026

Pairs with cypress-io/cypress#33737, which makes the experimentalFastVisibility algorithm shadow-DOM aware (resolves cypress-io/cypress#33046).

This PR is stacked on top of #6434 because it builds on that branch's clipping-ancestor docs.

What changed

  • Replaced the "Shadow DOM is not yet supported" limitation in two places (experiments.mdx and interacting-with-elements.mdx) with the new state: Shadow DOM is now supported. The remaining divergences from the legacy algorithm are documented as three concrete buckets, all rooted in fast's reliance on elementFromPoint:
    • Cover narrower than the underneath element — fast samples four corners and the center, while legacy samples only the center, so a subject with an uncovered corner can be reported visible by fast and hidden by legacy.
    • pointer-events: none on the subject — browsers skip such elements in elementFromPoint, so no sample point can land on them. Setting pointer-events: auto on the subject is the workaround.
    • Clipping ancestor between the subject and its containing block — legacy uses offsetParent rules to ignore that ancestor; fast does not.
  • Refined the existing clipping-ancestor paragraph from docs: fast visibility scrolls off-screen elements into view #6434 to (1) cover all four clipping overflow values (hidden, clip, scroll, auto), (2) note that in-bounds subjects merely below the fold are scrolled into view normally, and (3) state that the check now walks shadow root boundaries.

Steps to test

Render the docs locally and visit:

  • docs/app/references/experiments#Experimental-Fast-Visibility — confirm the caution block now points at the Limitations section.
  • docs/app/core-concepts/interacting-with-elements#Experimental-Fast-Visibility — confirm the Limitations bullets describe the three caveats and the clipping-ancestor paragraph reads correctly.

Note

Low Risk
Low risk: documentation-only updates that clarify behavior and known edge cases of experimentalFastVisibility, with no runtime or API changes.

Overview
Docs update for experimentalFastVisibility: Shadow DOM is now documented as supported, replacing the previous “not supported” limitation and adding concrete caveats tied to elementFromPoint (corner-only visibility, pointer-events: none, and clipping-ancestor semantics).

Clarifies scrolling/clipping behavior for overflow: hidden|clip|scroll|auto, including that in-bounds-but-offscreen subjects still scroll into view and that clipping checks traverse shadow roots, and updates the experiments page to link readers to the detailed limitations section.

Reviewed by Cursor Bugbot for commit 2aa82d6. Bugbot is set up for automated code reviews on this repo. Configure here.

Mirrors cypress-io/cypress#33737, which makes the
`experimentalFastVisibility` algorithm shadow-DOM aware. Five test
scenarios still diverge from the legacy algorithm because of fast's
reliance on `elementFromPoint` — they fall into three buckets:

1. Cover detection where the cover is narrower than the underneath
   element (corner sampling vs center-only).
2. `pointer-events: none` on the subject (browsers skip such elements
   in `elementFromPoint`, so no sample lands on them).
3. A clipping ancestor between the subject and its containing block
   (legacy uses `offsetParent` rules to ignore it).

Document each in the Limitations section. Also refine the existing
clipping-ancestor paragraph to (a) cover all four clipping `overflow`
values, (b) note that in-bounds-but-below-fold subjects are scrolled
normally, and (c) state that the check now walks shadow root
boundaries.

Pairs with cypress-io/cypress#33737.
@cypress
Copy link
Copy Markdown

cypress Bot commented May 5, 2026

cypress-documentation    Run #1075

Run Properties:  status check passed Passed #1075  •  git commit 2aa82d646a: docs: fast visibility now supports Shadow DOM with documented caveats
Project cypress-documentation
Branch Review mschile/pensive-black-034995
Run status status check passed Passed #1075
Run duration 05m 39s
Commit git commit 2aa82d646a: docs: fast visibility now supports Shadow DOM with documented caveats
Committer Matthew Schile
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 322
View all changes introduced in this branch ↗︎
UI Coverage  47.51%
  Untested elements 337  
  Tested elements 3  
Accessibility  96.88%
  Failed rules  1 critical   3 serious   4 moderate   1 minor
  Failed elements 35  

@mschile mschile requested a review from cacieprins May 6, 2026 14:47
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.

2 participants