From 620799877c832bc65088528739e556b58991e555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Holot=C3=ADk?= Date: Mon, 27 Apr 2026 15:03:06 +0200 Subject: [PATCH] AIS 49: Add boolean matches(String selectors) method --- user/src/com/google/gwt/dom/client/Element.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/user/src/com/google/gwt/dom/client/Element.java b/user/src/com/google/gwt/dom/client/Element.java index ef8bf34f758..7a6235beca8 100644 --- a/user/src/com/google/gwt/dom/client/Element.java +++ b/user/src/com/google/gwt/dom/client/Element.java @@ -530,6 +530,15 @@ public final boolean hasTagName(String tagName) { return tagName.equalsIgnoreCase(getTagName()); } + /** + * Tests whether the element would be selected by the specified CSS selector. + * @param selectors A string containing valid CSS selectors to test the Element against. + * @return true if the Element matches the selectors. Otherwise, false. + */ + public final native boolean matches(String selectors) /*-{ + return this.matches && this.matches(selectors); + }-*/; + /** * Removes an attribute by name. */