@@ -656,8 +656,14 @@ public FillOptions setTimeout(double timeout) {
656656 }
657657 class FilterOptions {
658658 /**
659- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
660- * For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
659+ * Narrows down the results of the method to those which contain elements matching this relative locator. For example,
660+ * {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
661+ *
662+ * <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
663+ * document root. For example, you can find {@code content} that has {@code div} in {@code
664+ * <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
665+ * article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
666+ * content}.
661667 *
662668 * <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
663669 */
@@ -683,8 +689,14 @@ class FilterOptions {
683689 public Object hasText ;
684690
685691 /**
686- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
687- * For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
692+ * Narrows down the results of the method to those which contain elements matching this relative locator. For example,
693+ * {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
694+ *
695+ * <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
696+ * document root. For example, you can find {@code content} that has {@code div} in {@code
697+ * <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
698+ * article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
699+ * content}.
688700 *
689701 * <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
690702 */
@@ -1262,8 +1274,14 @@ public IsVisibleOptions setTimeout(double timeout) {
12621274 }
12631275 class LocatorOptions {
12641276 /**
1265- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
1266- * For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1277+ * Narrows down the results of the method to those which contain elements matching this relative locator. For example,
1278+ * {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1279+ *
1280+ * <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
1281+ * document root. For example, you can find {@code content} that has {@code div} in {@code
1282+ * <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
1283+ * article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
1284+ * content}.
12671285 *
12681286 * <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
12691287 */
@@ -1289,8 +1307,14 @@ class LocatorOptions {
12891307 public Object hasText ;
12901308
12911309 /**
1292- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
1293- * For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1310+ * Narrows down the results of the method to those which contain elements matching this relative locator. For example,
1311+ * {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1312+ *
1313+ * <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
1314+ * document root. For example, you can find {@code content} that has {@code div} in {@code
1315+ * <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
1316+ * article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
1317+ * content}.
12941318 *
12951319 * <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
12961320 */
@@ -1483,6 +1507,12 @@ class ScreenshotOptions {
14831507 * <p> Defaults to {@code "device"}.
14841508 */
14851509 public ScreenshotScale scale ;
1510+ /**
1511+ * Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements
1512+ * invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM
1513+ * and applies to the inner frames.
1514+ */
1515+ public String style ;
14861516 /**
14871517 * Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
14881518 * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link
@@ -1568,6 +1598,15 @@ public ScreenshotOptions setScale(ScreenshotScale scale) {
15681598 this .scale = scale ;
15691599 return this ;
15701600 }
1601+ /**
1602+ * Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements
1603+ * invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM
1604+ * and applies to the inner frames.
1605+ */
1606+ public ScreenshotOptions setStyle (String style ) {
1607+ this .style = style ;
1608+ return this ;
1609+ }
15711610 /**
15721611 * Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
15731612 * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link
0 commit comments