Struct script::layout_dom::ServoThreadSafeLayoutElement

source ·
pub struct ServoThreadSafeLayoutElement<'dom> {
    pub(super) element: ServoLayoutElement<'dom>,
    pub(super) pseudo: PseudoElementType,
}
Expand description

A wrapper around elements that ensures layout can only ever access safe properties and cannot race on elements.

Fields§

§element: ServoLayoutElement<'dom>§pseudo: PseudoElementType

The pseudo-element type, with (optionally) a specified display value to override the stylesheet.

Trait Implementations§

source§

impl<'dom> Clone for ServoThreadSafeLayoutElement<'dom>

source§

fn clone(&self) -> ServoThreadSafeLayoutElement<'dom>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'dom> Debug for ServoThreadSafeLayoutElement<'dom>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'dom> Element for ServoThreadSafeLayoutElement<'dom>

This implementation of ::selectors::Element is used for implementing lazy pseudo-elements.

Lazy pseudo-elements in Servo only allows selectors using safe properties, i.e., local_name, attributes, so they can only be used for private pseudo-elements (like ::-servo-details-content).

Probably a few more of this functions can be implemented (like has_class, etc.), but they have no use right now.

Note that the element implementation is needed only for selector matching, not for inheritance (styles are inherited appropriately).

§

type Impl = SelectorImpl

source§

fn opaque(&self) -> OpaqueElement

Converts self into an opaque representation.
source§

fn is_pseudo_element(&self) -> bool

Whether we’re matching on a pseudo-element.
source§

fn parent_element(&self) -> Option<Self>

source§

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>

The host of the containing shadow root, if any.
source§

fn prev_sibling_element(&self) -> Option<Self>

Skips non-element nodes
source§

fn next_sibling_element(&self) -> Option<Self>

Skips non-element nodes
source§

fn first_element_child(&self) -> Option<Self>

Skips non-element nodes
source§

fn is_html_slot_element(&self) -> bool

Returns whether the element is an HTML element.
source§

fn is_html_element_in_html_document(&self) -> bool

source§

fn has_local_name(&self, name: &LocalName) -> bool

source§

fn has_namespace(&self, ns: &Namespace) -> bool

Empty string for no namespace
source§

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

Whether this element and the other element have the same local name and namespace.
source§

fn match_pseudo_element( &self, _pseudo: &PseudoElement, _context: &mut MatchingContext<'_, Self::Impl>, ) -> bool

source§

fn attr_matches( &self, ns: &NamespaceConstraint<&Namespace>, local_name: &LocalName, operation: &AttrSelectorOperation<&AtomString>, ) -> bool

source§

fn match_non_ts_pseudo_class( &self, _: &NonTSPseudoClass, _: &mut MatchingContext<'_, Self::Impl>, ) -> bool

Whether this element is a link.
source§

fn has_id(&self, _id: &AtomIdent, _case_sensitivity: CaseSensitivity) -> bool

source§

fn is_part(&self, _name: &AtomIdent) -> bool

source§

fn imported_part(&self, _: &AtomIdent) -> Option<AtomIdent>

Returns the mapping from the exportparts attribute in the reverse direction, that is, in an outer-tree -> inner-tree direction.
source§

fn has_class( &self, _name: &AtomIdent, _case_sensitivity: CaseSensitivity, ) -> bool

source§

fn is_empty(&self) -> bool

Returns whether this element matches :empty. Read more
source§

fn is_root(&self) -> bool

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

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

Add hashes unique to this element to the given filter, returning true if any got added.
source§

fn has_custom_state(&self, _name: &AtomIdent) -> bool

source§

fn pseudo_element_originating_element(&self) -> Option<Self>

The parent of a given pseudo-element, after matching a pseudo-element selector. Read more
source§

fn has_attr_in_no_namespace( &self, local_name: &<Self::Impl as SelectorImpl>::LocalName, ) -> bool

source§

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

Returns whether this element should ignore matching nth child selector.
source§

impl<'dom> ThreadSafeLayoutElement<'dom> for ServoThreadSafeLayoutElement<'dom>

§

type ConcreteThreadSafeLayoutNode = ServoThreadSafeLayoutNode<'dom>

§

type ConcreteElement = ServoLayoutElement<'dom>

This type alias is just a work-around to avoid writing Read more
source§

fn as_node(&self) -> ServoThreadSafeLayoutNode<'dom>

source§

fn get_pseudo_element_type(&self) -> PseudoElementType

source§

fn with_pseudo(&self, pseudo: PseudoElementType) -> Self

Creates a new ThreadSafeLayoutElement for the same LayoutElement with a different pseudo-element type.
source§

fn type_id(&self) -> Option<LayoutNodeType>

Returns the type ID of this node. Returns None if this is a pseudo-element; otherwise, returns Some.
source§

fn unsafe_get(self) -> ServoLayoutElement<'dom>

Returns access to the underlying TElement. This is breaks the abstraction barrier of ThreadSafeLayout wrapper layer, and can lead to races if not used carefully. Read more
source§

fn get_local_name(&self) -> &LocalName

Get the local name of this element. See https://dom.spec.whatwg.org/#concept-element-local-name.
source§

fn get_attr_enum( &self, namespace: &Namespace, name: &LocalName, ) -> Option<&AttrValue>

source§

fn get_attr<'a>( &'a self, namespace: &Namespace, name: &LocalName, ) -> Option<&'a str>

source§

fn style_data(&self) -> AtomicRef<'_, ElementData>

source§

fn is_shadow_host(&self) -> bool

source§

fn is_body_element_of_html_element_root(&self) -> bool

Returns whether this node is a body element of an html element root in an HTML element document. Read more
source§

fn get_before_pseudo(&self) -> Option<Self>

source§

fn get_after_pseudo(&self) -> Option<Self>

source§

fn get_details_summary_pseudo(&self) -> Option<Self>

source§

fn get_details_content_pseudo(&self) -> Option<Self>

source§

fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>

Returns the style results for the given node. If CSS selector matching has not yet been performed, fails. Read more
source§

fn selected_style(&self) -> Arc<ComputedValues>

source§

fn resolved_style(&self) -> Arc<ComputedValues>

Returns the already resolved style of the node. Read more
source§

impl<'dom> Copy for ServoThreadSafeLayoutElement<'dom>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T