Skip to content

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

Description

Version

1.63.0 (also reproduces on current main)

Steps to reproduce

Repo: https://github.com/yuriy-mikityuk/playwright-webkit-nested-details-repro

  1. npm ci
  2. npx playwright install
  3. npx playwright test

The test renders an open <details> inside a closed one and expects the button inside it to be hidden.

Expected behavior

toBeHidden() passes, like in Chromium and Firefox. The button isn't rendered.

Actual behavior

In WebKit the button is reported as visible: isVisible() returns true, getByRole('button') finds it and the aria snapshot includes it.

Additional context

WebKit doesn't use checkVisibility(), and the fallback in isElementStyleVisibilityVisible (packages/injected/src/domUtils.ts) only checks the closest details or summary, so the closed outer one is ignored. I'd like to work on this. I already have a fix with a test in #42951, which I opened before reading the contributing guide, sorry about that.

Environment

System:
  OS: macOS 26.7
  CPU: (14) arm64 Apple M4 Pro
Binaries:
  Node: 20.20.2
  npm: 10.8.2
npmPackages:
  @playwright/test: 1.63.0 => 1.63.0

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions