Skip to content

fix(webkit): hide content of a details nested in a closed details - #42951

Closed
Yuriy Mikityuk (yuriy-mikityuk) wants to merge 1 commit into
microsoft:mainfrom
yuriy-mikityuk:fix-webkit-nested-details-visibility
Closed

Yuriy Mikityuk (yuriy-mikityuk) wants to merge 1 commit into
microsoft:mainfrom
yuriy-mikityuk:fix-webkit-nested-details-visibility

Conversation

@yuriy-mikityuk

@yuriy-mikityuk Yuriy Mikityuk (yuriy-mikityuk) commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

In WebKit, elements inside an open details that is nested in a closed one were treated as visible:

<details>
  <summary>outer</summary>
  <details open>
    <summary>inner</summary>
    <button>hidden button</button>
  </details>
</details>

The button isn't rendered, but in WebKit locator('button').isVisible() returned true, getByRole('button') found it and the aria snapshot included it. Chromium and Firefox use checkVisibility() and get it right.

The WebKit fallback only checked the closest details or summary. Now it checks all ancestors. I ran into this while comparing aria snapshots of generated pages across the three engines.

Fixes #43018

WebKit doesn't use checkVisibility(), so visibility falls back to a manual
check for details. It only looked at the closest details or summary, so an
open details inside a closed one was reported as visible together with
everything in it. Check all ancestors instead.
@dgozman

Copy link
Copy Markdown
Collaborator

Closing in favor of #42971.

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.

[Bug]: WebKit treats content of a details nested in a closed details as visible

2 participants