playwright
playwright copied to clipboard
[Docs]: Document the css:light locators
Page(s)
https://playwright.dev/docs/next/other-locators#css-locator
Description
https://github.com/microsoft/playwright/issues/1375#issuecomment-614032900 mentions that there's a css:light locator engine, but it's not documented in the locators page. There's a mention of the :light suffix in https://playwright.dev/docs/next/other-locators#id-data-testid-data-test-id-data-test-selectors, but that's about non-CSS selectors.
We consider css:light an internal selector engine, hence its not documented properly.
Do you have a specific use-case for what you need it for?
I don't have a strong use case: I could handle the cases where the default CSS locators found something in shadow dom by adding precision to exclude those shadow dom elements. It looked from the bugs like css:light was supported, but when I read them again, it was always external folks who brought up the engine, not project members.
The asymmetry of having locators pierce into shadow dom by default but not pierce out (through slots, #29357) is a bit awkward, but I don't yet have evidence that css:light is actually the right level of control to help with that. So I won't object if you close this, and I can reopen it or file a new bug if I find that evidence.
css:light predates modern a11y-based locators and we are slowly walking away from them. We are likely to clean up the docs to remove their mentions altogether. We won't be breaking them, but we'd like to discourage them to the extent of eliminating docs and deprecating in code.