Open
Description
Version
tot
Steps to reproduce
it('repro', async ({ page }) => {
await page.setContent(`
<div style="visibility: hidden;">
<div style="visibility: visible;">
<button>Button</button>
</div>
</div>
`);
await checkAndMatchSnapshot(page.locator('body'), `
- button "Button"
`);
});
Expected behavior
I expect the inner button to be in the snapshot.
Actual behavior
The snapshot is empty.
Additional context
Chromium considers it visible:

Maybe it's this case that we don't implement:
playwright/packages/injected/src/roleUtils.ts
Lines 263 to 265 in 3c248ed
Environment
System:
OS: macOS 15.5
CPU: (12) arm64 Apple M3 Pro
Memory: 145.89 MB / 18.00 GB
Binaries:
Node: 23.11.0 - ~/.local/state/fnm_multishells/12301_1749718398620/bin/node
npm: 11.4.1 - ~/.local/state/fnm_multishells/12301_1749718398620/bin/npm
pnpm: 10.6.5 - /opt/homebrew/bin/pnpm
IDEs:
VSCode: 1.100.3 - /opt/homebrew/bin/code
Languages:
Bash: 3.2.57 - /bin/bash