public class CssSelector extends AbstractCssSelector
ICssSelector implementation for CSS selectors.selectorItems| Constructor and Description |
|---|
CssSelector(List<ICssSelectorItem> selectorItems)
Creates a new
CssSelector instance. |
CssSelector(String selector)
Creates a new
CssSelector instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
matches(INode element)
Checks if a node matches the selector.
|
boolean |
matchesWithinScope(INode element,
INode scope)
Checks if the node matches this selector, but limits ancestor traversal so that it never
goes above the provided
scope node. |
boolean |
notMatches(INode element)
Checks if the node not matches all the selectors.
|
calculateSpecificity, getSelectorItems, toStringpublic CssSelector(List<ICssSelectorItem> selectorItems)
CssSelector instance.selectorItems - the selector itemspublic CssSelector(String selector)
CssSelector instance.selector - the selectorpublic boolean matches(INode element)
ICssSelectorelement - the nodepublic boolean matchesWithinScope(INode element, INode scope)
scope node.
This is primarily used to implement :has(...) correctly: when matching a candidate
descendant against an argument selector, ancestor combinators must not escape the :has()
scope element.
element - the element to matchscope - the scope boundary (inclusive). If null, behaves like matches(INode).public boolean notMatches(INode element)
element - the nodeCopyright © 1998–2026 Apryse Group NV. All rights reserved.