Skip to content

Add Locator.Within and fix frame-relative highlights and table roles - #91

Open
kblok wants to merge 1 commit into
mainfrom
port/locator-misc
Open

kblok wants to merge 1 commit into
mainfrom
port/locator-misc

Conversation

@kblok

@kblok kblok commented Oct 6, 2026

Copy link
Copy Markdown
Member

Upstream added locator.within(parent). It is now available as a Within extension that reads in natural order. page.GetByRole("cell").Nth(1).Within(page.GetByRole("row")) picks the second cell of every row. While porting it, I found that our role engine had no implicit roles for tables, lists, landmarks and many other elements, so GetByRole("cell") matched nothing. The engine now uses upstream's full implicit-role map, including presentation-role inheritance.

Highlights now resolve relative to the locator's frame. frame.Locator(...).HideHighlightAsync() clears the overlay in that frame, and page.HideHighlightAsync() clears every frame. Custom selector engine names can now contain -, as upstream allows.

The regex-flags test is ported too. .NET Regex has no g or y flag, so the /foo/g and /foo/y lines use the same pattern as /foo/. The local getBy scripts already reset lastIndex.

Closes #36, closes #59, closes #69

🤖 Generated with Claude Code

Add Locator.Within as a compat extension (upstream locator.within).
Port upstream implicit ARIA role mapping so getByRole finds table
cells, rows, lists and other elements. Resolve hideHighlight relative
to the locator's frame and clear highlights in every frame on
page.hideHighlight. Allow '-' in custom selector engine names, as
upstream does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant