Trait selectors::Element[][src]

pub trait Element: Sized + Clone + Debug {
    type Impl: SelectorImpl;
Show methods 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 is_pseudo_element(&self) -> bool;
fn prev_sibling_element(&self) -> Option<Self>;
fn next_sibling_element(&self) -> Option<Self>;
fn is_html_element_in_html_document(&self) -> bool;
fn has_local_name(
        &self,
        local_name: &<Self::Impl as SelectorImpl>::BorrowedLocalName
    ) -> bool;
fn has_namespace(
        &self,
        ns: &<Self::Impl as SelectorImpl>::BorrowedNamespaceUrl
    ) -> bool;
fn is_same_type(&self, other: &Self) -> bool;
fn attr_matches(
        &self,
        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>(
        &self,
        pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
        context: &mut MatchingContext<'_, Self::Impl>,
        flags_setter: &mut F
    ) -> bool
    where
        F: FnMut(&Self, ElementSelectorFlags)
;
fn match_pseudo_element(
        &self,
        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(
        &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;
fn imported_part(
        &self,
        name: &<Self::Impl as SelectorImpl>::Identifier
    ) -> Option<<Self::Impl as SelectorImpl>::Identifier>;
fn is_part(&self, name: &<Self::Impl as SelectorImpl>::Identifier) -> 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

fn opaque(&self) -> OpaqueElement[src]

Converts self into an opaque representation.

fn parent_element(&self) -> Option<Self>[src]

fn parent_node_is_shadow_root(&self) -> bool[src]

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

fn containing_shadow_host(&self) -> Option<Self>[src]

The host of the containing shadow root, if any.

fn is_pseudo_element(&self) -> bool[src]

Whether we’re matching on a pseudo-element.

fn prev_sibling_element(&self) -> Option<Self>[src]

Skips non-element nodes

fn next_sibling_element(&self) -> Option<Self>[src]

Skips non-element nodes

fn is_html_element_in_html_document(&self) -> bool[src]

fn has_local_name(
    &self,
    local_name: &<Self::Impl as SelectorImpl>::BorrowedLocalName
) -> bool
[src]

fn has_namespace(
    &self,
    ns: &<Self::Impl as SelectorImpl>::BorrowedNamespaceUrl
) -> bool
[src]

Empty string for no namespace

fn is_same_type(&self, other: &Self) -> bool[src]

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>::LocalName,
    operation: &AttrSelectorOperation<&<Self::Impl as SelectorImpl>::AttrValue>
) -> bool
[src]

fn match_non_ts_pseudo_class<F>(
    &self,
    pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass,
    context: &mut MatchingContext<'_, Self::Impl>,
    flags_setter: &mut F
) -> bool where
    F: FnMut(&Self, ElementSelectorFlags), 
[src]

fn match_pseudo_element(
    &self,
    pe: &<Self::Impl as SelectorImpl>::PseudoElement,
    context: &mut MatchingContext<'_, Self::Impl>
) -> bool
[src]

Whether this element is a link.

fn is_html_slot_element(&self) -> bool[src]

Returns whether the element is an HTML element.

fn has_id(
    &self,
    id: &<Self::Impl as SelectorImpl>::Identifier,
    case_sensitivity: CaseSensitivity
) -> bool
[src]

fn has_class(
    &self,
    name: &<Self::Impl as SelectorImpl>::Identifier,
    case_sensitivity: CaseSensitivity
) -> bool
[src]

fn imported_part(
    &self,
    name: &<Self::Impl as SelectorImpl>::Identifier
) -> Option<<Self::Impl as SelectorImpl>::Identifier>
[src]

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[src]

fn is_empty(&self) -> bool[src]

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

fn is_root(&self) -> bool[src]

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

fn pseudo_element_originating_element(&self) -> Option<Self>[src]

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

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

fn assigned_slot(&self) -> Option<Self>[src]

Returns the assigned element this element is assigned to.

Necessary for the ::slotted pseudo-class.

fn ignores_nth_child_selectors(&self) -> bool[src]

Returns whether this element should ignore matching nth child selector.

Loading content...

Implementors

Loading content...