pub struct ServoThreadSafeLayoutNode<'dom> { /* private fields */ }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.
Implementations§
Source§impl<'dom> ServoThreadSafeLayoutNode<'dom>
impl<'dom> ServoThreadSafeLayoutNode<'dom>
Sourcepub fn new(node: ServoLayoutNode<'dom>) -> Self
pub fn new(node: ServoLayoutNode<'dom>) -> Self
Creates a new ServoThreadSafeLayoutNode from the given ServoLayoutNode.
Sourcepub fn is_single_line_text_input(&self) -> bool
pub fn is_single_line_text_input(&self) -> bool
Whether this is a container for the text within a single-line text input. This is used to solve the special case of line height for a text entry widget. https://html.spec.whatwg.org/multipage/#the-input-element-as-a-text-entry-widget
pub fn selected_style( &self, context: &SharedStyleContext<'_>, ) -> Arc<ComputedValues>
Trait Implementations§
Source§impl<'dom> Clone for ServoThreadSafeLayoutNode<'dom>
impl<'dom> Clone for ServoThreadSafeLayoutNode<'dom>
Source§fn clone(&self) -> ServoThreadSafeLayoutNode<'dom>
fn clone(&self) -> ServoThreadSafeLayoutNode<'dom>
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<'dom> Debug for ServoThreadSafeLayoutNode<'dom>
impl<'dom> Debug for ServoThreadSafeLayoutNode<'dom>
Source§impl NodeInfo for ServoThreadSafeLayoutNode<'_>
impl NodeInfo for ServoThreadSafeLayoutNode<'_>
Source§fn is_element(&self) -> bool
fn is_element(&self) -> bool
Whether this node is an element.
Source§fn is_text_node(&self) -> bool
fn is_text_node(&self) -> bool
Whether this node is a text node.
Source§impl<'dom> PartialEq for ServoThreadSafeLayoutNode<'dom>
impl<'dom> PartialEq for ServoThreadSafeLayoutNode<'dom>
Source§fn eq(&self, other: &ServoThreadSafeLayoutNode<'dom>) -> bool
fn eq(&self, other: &ServoThreadSafeLayoutNode<'dom>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'dom> ThreadSafeLayoutNode<'dom> for ServoThreadSafeLayoutNode<'dom>
impl<'dom> ThreadSafeLayoutNode<'dom> for ServoThreadSafeLayoutNode<'dom>
Source§fn set_uses_content_attribute_with_attr(
&self,
uses_content_attribute_with_attr: bool,
)
fn set_uses_content_attribute_with_attr( &self, uses_content_attribute_with_attr: bool, )
§Safety
This function accesses and modifies the underlying DOM object and should not be used by more than a single thread at once.
type ConcreteNode = ServoLayoutNode<'dom>
type ConcreteThreadSafeLayoutElement = ServoThreadSafeLayoutElement<'dom>
type ConcreteElement = ServoLayoutElement<'dom>
type ChildrenIterator = ServoThreadSafeLayoutNodeChildrenIterator<'dom>
Source§fn opaque(&self) -> OpaqueNode
fn opaque(&self) -> OpaqueNode
Converts self into an
OpaqueNode.fn pseudo_element_chain(&self) -> PseudoElementChain
Source§fn type_id(&self) -> Option<LayoutNodeType>
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, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
fn parent_style(&self, context: &SharedStyleContext<'_>) -> 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 initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
fn initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
Initialize this node with empty opaque layout data. Read more
fn debug_id(self) -> usize
Source§fn children(&self) -> LayoutIterator<Self::ChildrenIterator>
fn children(&self) -> LayoutIterator<Self::ChildrenIterator>
Returns an iterator over this node’s children.
Source§fn as_element(&self) -> Option<ServoThreadSafeLayoutElement<'dom>>
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>>
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>
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>
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 unsafe_get(self) -> Self::ConcreteNode
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 text_content(self) -> Cow<'dom, str>
fn text_content(self) -> Cow<'dom, str>
Get the text content of this node, if it is a text node. Read more
Source§fn selection(&self) -> Option<SharedSelection>
fn selection(&self) -> Option<SharedSelection>
If this node manages a selection, this returns the shared selection for the node.
Source§fn image_url(&self) -> Option<ServoUrl>
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>
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 showing_broken_image_icon(&self) -> bool
fn showing_broken_image_icon(&self) -> bool
Whether or not this is an image element that is showing a broken image icon.
Source§fn image_data(&self) -> Option<(Option<Image>, Option<ImageMetadata>)>
fn image_data(&self) -> Option<(Option<Image>, Option<ImageMetadata>)>
If this is an image element, returns its image data. Otherwise, returns
None.fn canvas_data(&self) -> Option<HTMLCanvasData>
fn media_data(&self) -> Option<HTMLMediaData>
fn svg_data(&self) -> Option<SVGElementData<'dom>>
Source§fn iframe_browsing_context_id(&self) -> Option<BrowsingContextId>
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>
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.
fn get_span(&self) -> Option<u32>
fn get_colspan(&self) -> Option<u32>
fn get_rowspan(&self) -> Option<u32>
fn with_pseudo_element_chain( &self, pseudo_element_chain: PseudoElementChain, ) -> Self
fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
Source§fn is_content(&self) -> bool
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.fn with_pseudo(&self, pseudo_element_type: PseudoElement) -> Option<Self>
impl<'dom> Copy for ServoThreadSafeLayoutNode<'dom>
impl<'dom> StructuralPartialEq for ServoThreadSafeLayoutNode<'dom>
Auto Trait Implementations§
impl<'dom> Freeze for ServoThreadSafeLayoutNode<'dom>
impl<'dom> !RefUnwindSafe for ServoThreadSafeLayoutNode<'dom>
impl<'dom> Send for ServoThreadSafeLayoutNode<'dom>
impl<'dom> Sync for ServoThreadSafeLayoutNode<'dom>
impl<'dom> Unpin for ServoThreadSafeLayoutNode<'dom>
impl<'dom> UnsafeUnpin for ServoThreadSafeLayoutNode<'dom>
impl<'dom> !UnwindSafe for ServoThreadSafeLayoutNode<'dom>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert