Class SelectorExtensions
- Namespace
- AngleSharp.Css.Dom
- Assembly
- AngleSharp.dll
A set of extension methods for selectors.
public static class SelectorExtensions
- Inheritance
-
SelectorExtensions
- Inherited Members
Methods
Match(ISelector, IElement)
Provides an alternate to Match(IElement, IElement?) that sets the scope to the owning document element (if there is one).
public static bool Match(this ISelector selector, IElement element)
Parameters
Returns
- bool
The result of the match.
MatchAll(ISelector, IEnumerable<IElement>, IElement?)
Returns the elements within the given elements (using depth-first pre-order traversal) that match the selectors with the given scope.
public static IHtmlCollection<IElement> MatchAll(this ISelector selector, IEnumerable<IElement> elements, IElement? scope)
Parameters
selector
ISelectorA selector object.
elements
IEnumerable<IElement>The elements to take as source.
scope
IElementThe element to take as scope.
Returns
- IHtmlCollection<IElement>
The collection containing the resulting elements.
MatchAny(ISelector, IEnumerable<IElement>, IElement?)
Returns the first element within the given elements (using depth-first pre-order traversal) that match the selectors with the given scope.
public static IElement? MatchAny(this ISelector selector, IEnumerable<IElement> elements, IElement? scope)
Parameters
selector
ISelectorA selector object.
elements
IEnumerable<IElement>The elements to take as source.
scope
IElementThe element to take as scope.
Returns
- IElement
The resulting element or null.