Struct script::layout_dom::node::ServoThreadSafeLayoutNode

source ·
pub struct ServoThreadSafeLayoutNode<'dom> {
    pub(super) node: ServoLayoutNode<'dom>,
    pub(super) pseudo: PseudoElementType,
}
Expand description

A wrapper around a ServoLayoutNode that can be used safely on different threads. It’s very important that this never mutate anything except this wrapped node and never access any other node apart from its parent.

Fields§

§node: ServoLayoutNode<'dom>

The wrapped ServoLayoutNode.

§pseudo: PseudoElementType

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

Implementations§

source§

impl<'dom> ServoThreadSafeLayoutNode<'dom>

source

pub fn new(node: ServoLayoutNode<'dom>) -> Self

Creates a new ServoThreadSafeLayoutNode from the given ServoLayoutNode.

source

unsafe fn get_jsmanaged(&self) -> LayoutDom<'dom, Node>

Returns the interior of this node as a LayoutDom. This is highly unsafe for layout to call and as such is marked unsafe.

source

unsafe fn dangerous_first_child(&self) -> Option<Self>

Get the first child of this node. Important: this is not safe for layout to call, so it should never be made public.

source

unsafe fn dangerous_next_sibling(&self) -> Option<Self>

Get the next sibling of this node. Important: this is not safe for layout to call, so it should never be made public.

Trait Implementations§

source§

impl<'dom> Clone for ServoThreadSafeLayoutNode<'dom>

source§

fn clone(&self) -> ServoThreadSafeLayoutNode<'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 ServoThreadSafeLayoutNode<'dom>

source§

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

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

impl<'dom> NodeInfo for ServoThreadSafeLayoutNode<'dom>

source§

fn is_element(&self) -> bool

Whether this node is an element.
source§

fn is_text_node(&self) -> bool

Whether this node is a text node.
source§

impl<'dom> PartialEq for ServoThreadSafeLayoutNode<'dom>

source§

fn eq(&self, other: &ServoThreadSafeLayoutNode<'dom>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'dom> ThreadSafeLayoutNode<'dom> for ServoThreadSafeLayoutNode<'dom>

§

type ConcreteNode = ServoLayoutNode<'dom>

§

type ConcreteThreadSafeLayoutElement = ServoThreadSafeLayoutElement<'dom>

§

type ConcreteElement = ServoLayoutElement<'dom>

§

type ChildrenIterator = ServoThreadSafeLayoutNodeChildrenIterator<'dom>

source§

fn opaque(&self) -> OpaqueNode

Converts self into an OpaqueNode.
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 parent_style(&self) -> Arc<ComputedValues>

Returns the style for a text node. This is computed on the fly from the parent style to avoid traversing text nodes in the style system. Read more
source§

fn debug_id(self) -> usize

source§

fn children(&self) -> LayoutIterator<Self::ChildrenIterator>

Returns an iterator over this node’s children.
source§

fn as_element(&self) -> Option<ServoThreadSafeLayoutElement<'dom>>

Returns a ThreadSafeLayoutElement if this is an element, None otherwise.
source§

fn as_html_element(&self) -> Option<ServoThreadSafeLayoutElement<'dom>>

Returns a ThreadSafeLayoutElement if this is an element in an HTML namespace, None otherwise.
source§

fn style_data(&self) -> Option<&'dom StyleData>

Get the StyleData for this node. Returns None if the node is unstyled.
source§

fn layout_data(&self) -> Option<&'dom GenericLayoutData>

Get the layout data of this node, attempting to downcast it to the desired type. Returns None if there is no layout data or it isn’t of the desired type.
source§

fn is_ignorable_whitespace(&self, context: &SharedStyleContext<'_>) -> bool

source§

fn unsafe_get(self) -> Self::ConcreteNode

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

fn node_text_content(self) -> Cow<'dom, str>

source§

fn selection(&self) -> Option<Range<ByteIndex>>

If the insertion point is within this node, returns it. Otherwise, returns None.
source§

fn image_url(&self) -> Option<ServoUrl>

If this is an image element, returns its URL. If this is not an image element, fails.
source§

fn image_density(&self) -> Option<f64>

If this is an image element, returns its current-pixel-density. If this is not an image element, fails.
source§

fn image_data(&self) -> Option<(Option<StdArc<Image>>, Option<ImageMetadata>)>

If this is an image element, returns its image data. Otherwise, returns None.
source§

fn canvas_data(&self) -> Option<HTMLCanvasData>

source§

fn media_data(&self) -> Option<HTMLMediaData>

source§

fn svg_data(&self) -> Option<SVGSVGData>

source§

fn iframe_browsing_context_id(&self) -> Option<BrowsingContextId>

If this node is an iframe element, returns its browsing context ID. If this node is not an iframe element, fails. Returns None if there is no nested browsing context.
source§

fn iframe_pipeline_id(&self) -> Option<PipelineId>

If this node is an iframe element, returns its pipeline ID. If this node is not an iframe element, fails. Returns None if there is no nested browsing context.
source§

fn get_span(&self) -> Option<u32>

source§

fn get_colspan(&self) -> Option<u32>

source§

fn get_rowspan(&self) -> Option<u32>

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 get_pseudo_element_type(&self) -> PseudoElementType

source§

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

source§

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

source§

fn is_content(&self) -> bool

Returns true if this node contributes content. This is used in the implementation of empty_cells per CSS 2.1 § 17.6.1.1.
source§

fn fragment_type(&self) -> FragmentType

source§

impl<'dom> Copy for ServoThreadSafeLayoutNode<'dom>

source§

impl<'dom> StructuralPartialEq for ServoThreadSafeLayoutNode<'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

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,