`, piercing the shadow root, while `":light(article .in-the-shadow)"` does not match anything.
+- `":light(article div > span)"` does not match anything, because both light-dom `div` elements do not contain a `span`.
+- `"article div > span"` matches the `
`, piercing the shadow root.
+- `"article > .in-the-shadow"` does not match anything, because `` is not a direct child of `article`
+- `":light(article > .in-the-shadow)"` does not match anything.
+- `"article li#target"` matches the `
Deep in the shadow`, piercing two shadow roots.
## Selecting elements based on layout
@@ -268,12 +268,12 @@ page.fill('input:right-of(:text("Username"))')
page.click('button:near(.promo-card)')
```
-## XPpath selectors
+## XPath selectors
-XPath engine is equivalent to [`Document.evaluate`](https://developer.mozilla.org/en/docs/Web/API/Document/evaluate).
+XPath selectors are equivalent to calling [`Document.evaluate`](https://developer.mozilla.org/en/docs/Web/API/Document/evaluate).
Example: `xpath=//html/body`.
-Malformed selector starting with `//` or `..` is assumed to be an xpath selector. For example, Playwright
+Selector starting with `//` or `..` is assumed to be an xpath selector. For example, Playwright
converts `'//html/body'` to `'xpath=//html/body'`.
:::note