[][src]Trait selectors::Element

pub trait Element: Sized + Clone + Debug {
    type Impl: SelectorImpl;
    fn opaque(&self) -> OpaqueElement;
fn parent_element(&self) -> Option<Self>;
fn parent_node_is_shadow_root(&self) -> bool;
fn containing_shadow_host(&self) -> Option<Self>;
fn prev_sibling_element(&self) -> Option<Self>;
fn next_sibling_element(&self) -> Option<Self>;
fn is_html_element_in_html_document(&self) -> bool;
fn local_name(&self) -> &<Self::Impl as SelectorImpl>::BorrowedLocalName;
fn namespace(&self) -> &<Self::Impl as SelectorImpl>::BorrowedNamespaceUrl;
fn attr_matches(
        ns: &NamespaceConstraint<&<Self::Impl as SelectorImpl>::NamespaceUrl>,
        local_name: &<Self::Impl as SelectorImpl>::LocalName,
        operation: &AttrSelectorOperation<&<Self::Impl as SelectorImpl>::AttrValue>
    ) -> bool;
fn match_non_ts_pseudo_class<F>(
        pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
        context: &mut MatchingContext<Self::Impl>,
        flags_setter: &mut F
    ) -> bool
        F: FnMut(&Self, ElementSelectorFlags)
fn match_pseudo_element(
        pe: &<Self::Impl as SelectorImpl>::PseudoElement,
        context: &mut MatchingContext<Self::Impl>
    ) -> bool;
fn is_link(&self) -> bool;
fn is_html_slot_element(&self) -> bool;
fn has_id(
        id: &<Self::Impl as SelectorImpl>::Identifier,
        case_sensitivity: CaseSensitivity
    ) -> bool;
fn has_class(
        name: &<Self::Impl as SelectorImpl>::ClassName,
        case_sensitivity: CaseSensitivity
    ) -> bool;
fn is_empty(&self) -> bool;
fn is_root(&self) -> bool; fn pseudo_element_originating_element(&self) -> Option<Self> { ... }
fn assigned_slot(&self) -> Option<Self> { ... }
fn ignores_nth_child_selectors(&self) -> bool { ... } }

Associated Types

Loading content...

Required methods

Converts self into an opaque representation.

Whether the parent node of this element is a shadow root.

The host of the containing shadow root, if any.

Skips non-element nodes

Skips non-element nodes

Empty string for no namespace

Whether this element is a link.

Returns whether the element is an HTML element.

Returns whether this element matches :empty.

That is, whether it does not contain any child element or any non-zero-length text node. See http://dev.w3.org/csswg/selectors-3/#empty-pseudo

Returns whether this element matches :root, i.e. whether it is the root element of a document.

Note: this can be false even if .parent_element() is None if the parent node is a DocumentFragment.

Loading content...

Provided methods

The parent of a given pseudo-element, after matching a pseudo-element selector.

This is guaranteed to be called in a pseudo-element.

Returns the assigned element this element is assigned to.

Necessary for the ::slotted pseudo-class.

Returns whether this element should ignore matching nth child selector.

Loading content...


Loading content...