You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Accessibility snapshot drops button name when text is nested inside spans with aria-hidden SVG #41985
When a <button> has its text content nested inside <span> elements alongside an aria-hidden="true" SVG icon, the accessibility snapshot (page.accessibility.snapshot() and Playwright MCP's browser_snapshot) reports the button with no accessible name — even though:
getByRole('button', { name: 'Add New Item' }) successfully locates it
Chromium's CDP Accessibility.getFullAXTree reports the correct name
This makes the button invisible to AI agents using Playwright MCP's snapshot-based navigation.
Call page.accessibility.snapshot() or use Playwright MCP browser_snapshot
Observe the button node has no name property in the output
Expected
- button "Add New Item" [ref=e5] [cursor=pointer]
Actual
- button [ref=e5] [cursor=pointer]
Evidence that the name IS computable
// This works — Playwright can find the button by name internallyconstbtn=page.getByRole('button',{name: 'Add New Item'});awaitexpect(btn).toBeVisible();// passes// CDP also reports the correct nameconstclient=awaitpage.context().newCDPSession(page);const{ nodes }=awaitclient.send('Accessibility.getFullAXTree');constbutton=nodes.find(n=>n.role?.value==='button'&&n.name?.value?.includes('Add New Item'));// button.name.value === "Add New Item" ✓
Impact
This affects AI agents using Playwright MCP for browser automation. When a button's name is missing from the snapshot, agents cannot identify the button's purpose via browser_find or browser_snapshot, even though the button is clearly labeled visually and has a valid computed accessible name.
Likely cause
The snapshot serializer may not be traversing text content through nested <span> elements when an aria-hidden SVG sibling is present, or the name computation in the serializer diverges from the one used by getByRole.
Environment
Playwright MCP: 0.0.78
Playwright: (bundled with MCP)
Browser: Chromium (headless)
OS: macOS
System Info
System:
OS: macOS 26.5.2
CPU: (14) arm64 Apple M4 Pro
Binaries:
Node: 26.0.0
npm: 11.16.0
Packages:
@playwright/mcp: 0.0.78
Activity
Update dependency playwright to v1.64.0 (#1822)
⬆️ Update dependency @playwright/test to ^1.64.0
⬆️ Update dependency @playwright/test to ^1.64.1
Update all non-major dependencies (#14)
⬆️ Update dependency @playwright/test to ^1.64.1