pub struct ElementWrapper<'a> { /* private fields */ }Expand description
Adapter wrapping a DOM node for selector matching.
This type implements the selectors::Element trait, allowing our
arena-based DOM to be matched against CSS selectors.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for ElementWrapper<'a>
impl<'a> Clone for ElementWrapper<'a>
Source§fn clone(&self) -> ElementWrapper<'a>
fn clone(&self) -> ElementWrapper<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ElementWrapper<'a>
impl<'a> Debug for ElementWrapper<'a>
Source§impl Element for ElementWrapper<'_>
impl Element for ElementWrapper<'_>
type Impl = ScrapeSelector
Source§fn opaque(&self) -> OpaqueElement
fn opaque(&self) -> OpaqueElement
Converts self into an opaque representation.
fn parent_element(&self) -> Option<Self>
Source§fn parent_node_is_shadow_root(&self) -> bool
fn parent_node_is_shadow_root(&self) -> bool
Whether the parent node of this element is a shadow root.
Source§fn containing_shadow_host(&self) -> Option<Self>
fn containing_shadow_host(&self) -> Option<Self>
The host of the containing shadow root, if any.
Source§fn is_pseudo_element(&self) -> bool
fn is_pseudo_element(&self) -> bool
Whether we’re matching on a pseudo-element.
Source§fn prev_sibling_element(&self) -> Option<Self>
fn prev_sibling_element(&self) -> Option<Self>
Skips non-element nodes
Source§fn next_sibling_element(&self) -> Option<Self>
fn next_sibling_element(&self) -> Option<Self>
Skips non-element nodes
Source§fn first_element_child(&self) -> Option<Self>
fn first_element_child(&self) -> Option<Self>
Skips non-element nodes
fn is_html_element_in_html_document(&self) -> bool
fn has_local_name( &self, local_name: &<Self::Impl as SelectorImpl>::BorrowedLocalName, ) -> bool
Source§fn has_namespace(
&self,
_ns: &<Self::Impl as SelectorImpl>::BorrowedNamespaceUrl,
) -> bool
fn has_namespace( &self, _ns: &<Self::Impl as SelectorImpl>::BorrowedNamespaceUrl, ) -> bool
Empty string for no namespace
Source§fn is_same_type(&self, other: &Self) -> bool
fn is_same_type(&self, other: &Self) -> bool
Whether this element and the
other element have the same local name and namespace.fn attr_matches( &self, ns: &NamespaceConstraint<&<Self::Impl as SelectorImpl>::NamespaceUrl>, local_name: &<Self::Impl as SelectorImpl>::BorrowedLocalName, operation: &AttrSelectorOperation<&<Self::Impl as SelectorImpl>::AttrValue>, ) -> bool
fn match_non_ts_pseudo_class( &self, pc: &NonTSPseudoClass, _context: &mut MatchingContext<'_, Self::Impl>, ) -> bool
fn match_pseudo_element( &self, _pe: &PseudoElement, _context: &mut MatchingContext<'_, Self::Impl>, ) -> bool
Source§fn is_html_slot_element(&self) -> bool
fn is_html_slot_element(&self) -> bool
Returns whether the element is an HTML element.
fn has_id( &self, id: &<Self::Impl as SelectorImpl>::Identifier, case_sensitivity: CaseSensitivity, ) -> bool
fn has_class( &self, name: &<Self::Impl as SelectorImpl>::Identifier, case_sensitivity: CaseSensitivity, ) -> bool
Source§fn imported_part(
&self,
_name: &<Self::Impl as SelectorImpl>::Identifier,
) -> Option<<Self::Impl as SelectorImpl>::Identifier>
fn imported_part( &self, _name: &<Self::Impl as SelectorImpl>::Identifier, ) -> Option<<Self::Impl as SelectorImpl>::Identifier>
Returns the mapping from the
exportparts attribute in the reverse
direction, that is, in an outer-tree -> inner-tree direction.fn is_part(&self, _name: &<Self::Impl as SelectorImpl>::Identifier) -> bool
Source§fn is_root(&self) -> bool
fn is_root(&self) -> bool
Returns whether this element matches
:root,
i.e. whether it is the root element of a document. Read moreSource§fn apply_selector_flags(&self, _flags: ElementSelectorFlags)
fn apply_selector_flags(&self, _flags: ElementSelectorFlags)
Sets selector flags on the elemnt itself or the parent, depending on the
flags, which indicate what kind of work may need to be performed when
DOM state changes.
Source§fn add_element_unique_hashes(&self, _filter: &mut BloomFilter) -> bool
fn add_element_unique_hashes(&self, _filter: &mut BloomFilter) -> bool
Add hashes unique to this element to the given filter, returning true
if any got added.
fn has_custom_state( &self, _name: &<Self::Impl as SelectorImpl>::Identifier, ) -> bool
Source§fn pseudo_element_originating_element(&self) -> Option<Self>
fn pseudo_element_originating_element(&self) -> Option<Self>
The parent of a given pseudo-element, after matching a pseudo-element
selector. Read more
fn has_attr_in_no_namespace( &self, local_name: &<Self::Impl as SelectorImpl>::LocalName, ) -> bool
Source§fn assigned_slot(&self) -> Option<Self>
fn assigned_slot(&self) -> Option<Self>
Returns the assigned element this element is assigned to. Read more
Source§fn ignores_nth_child_selectors(&self) -> bool
fn ignores_nth_child_selectors(&self) -> bool
Returns whether this element should ignore matching nth child
selector.
Source§impl PartialEq for ElementWrapper<'_>
impl PartialEq for ElementWrapper<'_>
impl<'a> Copy for ElementWrapper<'a>
impl Eq for ElementWrapper<'_>
Auto Trait Implementations§
impl<'a> Freeze for ElementWrapper<'a>
impl<'a> RefUnwindSafe for ElementWrapper<'a>
impl<'a> Send for ElementWrapper<'a>
impl<'a> Sync for ElementWrapper<'a>
impl<'a> Unpin for ElementWrapper<'a>
impl<'a> UnwindSafe for ElementWrapper<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more