pub struct ServoLayoutNode<'dom> { /* private fields */ }Expand description
A wrapper around a LayoutDom<Node> which provides a safe interface that
can be used during layout. This implements the LayoutNode trait.
Implementations§
Source§impl<'dom> ServoLayoutNode<'dom>
impl<'dom> ServoLayoutNode<'dom>
Sourcepub unsafe fn new(address: &TrustedNodeAddress) -> Self
pub unsafe fn new(address: &TrustedNodeAddress) -> Self
Create a new ServoLayoutNode for this given TrustedNodeAddress.
§Safety
The address pointed to by address should point to a valid node in memory.
Trait Implementations§
Source§impl<'dom> Clone for ServoLayoutNode<'dom>
impl<'dom> Clone for ServoLayoutNode<'dom>
Source§fn clone(&self) -> ServoLayoutNode<'dom>
fn clone(&self) -> ServoLayoutNode<'dom>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'dom> Copy for ServoLayoutNode<'dom>
Source§impl<'dom> Debug for ServoLayoutNode<'dom>
impl<'dom> Debug for ServoLayoutNode<'dom>
impl<'dom> Eq for ServoLayoutNode<'dom>
Source§impl<'dom> Hash for ServoLayoutNode<'dom>
impl<'dom> Hash for ServoLayoutNode<'dom>
Source§impl<'dom> LayoutNode<'dom> for ServoLayoutNode<'dom>
impl<'dom> LayoutNode<'dom> for ServoLayoutNode<'dom>
Source§type ConcreteTypeBundle = ServoLayoutDomTypeBundle<'dom>
type ConcreteTypeBundle = ServoLayoutDomTypeBundle<'dom>
The concrete implementation of
LayoutDomTypeBundle implemented in script.Source§fn with_pseudo(&self, pseudo_element_type: PseudoElement) -> Option<Self>
fn with_pseudo(&self, pseudo_element_type: PseudoElement) -> Option<Self>
Source§unsafe fn dangerous_style_node(self) -> ServoDangerousStyleNode<'dom>
unsafe fn dangerous_style_node(self) -> ServoDangerousStyleNode<'dom>
Returns access to a version of this LayoutNode that can be used by stylo
and selectors. This is dangerous as it allows more access to ancestors nodes
than LayoutNode. This should only be used when handing a node to stylo
or selectors. Read more
Source§unsafe fn dangerous_dom_parent(self) -> Option<Self>
unsafe fn dangerous_dom_parent(self) -> Option<Self>
Returns access to the DOM parent node of this node. This does not take
into account shadow tree children and slottables. For that use
Self::dangerous_flat_tree_parent. Read moreSource§unsafe fn dangerous_flat_tree_parent(self) -> Option<Self>
unsafe fn dangerous_flat_tree_parent(self) -> Option<Self>
Returns access to the flat tree parent node of this node. This takes
into account shadow tree children and slottables. For that use
Self::dangerous_flat_tree_parent. Read moreSource§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns whether the node is connected.
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 opaque(&self) -> OpaqueNode
fn opaque(&self) -> OpaqueNode
Converts self into an
OpaqueNode.Source§fn pseudo_element_chain(&self) -> PseudoElementChain
fn pseudo_element_chain(&self) -> PseudoElementChain
Returns the
PseudoElementChain for this [LayoutElement].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 style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
fn style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
Returns the computed style for the given node, properly handling pseudo-elements. For
elements this returns their style and for other nodes, this returns the style of the parent
element, if one exists. Read more
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 selected_style(
&self,
context: &SharedStyleContext<'_>,
) -> Arc<ComputedValues>
fn selected_style( &self, context: &SharedStyleContext<'_>, ) -> Arc<ComputedValues>
Returns the computed
:selected style for the given node, properly handling
pseudo-elements. For elements this returns their style and for other nodes, this
returns the style of the parent element, if one exists. Read moreSource§fn initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
fn initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
Initialize this node with empty opaque layout data.
Source§fn flat_tree_children(&self) -> impl Iterator<Item = Self>
fn flat_tree_children(&self) -> impl Iterator<Item = Self>
Returns an iterator over this node’s children in the flat tree. This
takes into account shadow tree children and slottables.
Source§fn dom_children(&self) -> impl Iterator<Item = Self>
fn dom_children(&self) -> impl Iterator<Item = Self>
Returns an iterator over this node’s children in the DOM. This
does not take shadow roots and assigned slottables into account.
For that use
Self::flat_tree_children.Source§fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
Returns a [
LayoutElement] if this is an element.Source§fn as_html_element(&self) -> Option<ServoLayoutElement<'dom>>
fn as_html_element(&self) -> Option<ServoLayoutElement<'dom>>
Returns a [
LayoutElement] if this is an element in the HTML namespace, None otherwise.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.Source§fn canvas_data(&self) -> Option<HTMLCanvasData>
fn canvas_data(&self) -> Option<HTMLCanvasData>
Return the [
HTMLCanvas] data for this node, if it is a canvas.Source§fn media_data(&self) -> Option<HTMLMediaData>
fn media_data(&self) -> Option<HTMLMediaData>
Return the
HTMLMediaData for this node, if it is a media element.Source§fn svg_data(&self) -> Option<SVGElementData<'dom>>
fn svg_data(&self) -> Option<SVGElementData<'dom>>
Return the
SVGElementData for this node, if it is an SVG subtree.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.
Source§fn table_span(&self) -> Option<u32>
fn table_span(&self) -> Option<u32>
Return the table span property if it is an element that supports it.
Source§fn table_colspan(&self) -> Option<u32>
fn table_colspan(&self) -> Option<u32>
Return the table colspan property if it is an element that supports it.
Source§fn table_rowspan(&self) -> Option<u32>
fn table_rowspan(&self) -> Option<u32>
Return the table rowspan property if it is an element that supports it.
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, )
Set whether or not this node has an active pseudo-element style with a
content
attribute that uses attr.Source§fn is_single_line_text_input(&self) -> bool
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
Source§fn is_root_of_user_agent_widget(&self) -> bool
fn is_root_of_user_agent_widget(&self) -> bool
Whether or not this
LayoutNode is in a user agent widget shadow DOM.Source§impl NodeInfo for ServoLayoutNode<'_>
impl NodeInfo for ServoLayoutNode<'_>
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 ServoLayoutNode<'dom>
impl<'dom> PartialEq for ServoLayoutNode<'dom>
Source§fn eq(&self, other: &ServoLayoutNode<'dom>) -> bool
fn eq(&self, other: &ServoLayoutNode<'dom>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Send for ServoLayoutNode<'_>
Those are supposed to be sound, but they aren’t because the entire system between script and layout so far has been designed to work around their absence. Switching the entire thing to the inert crate infra will help.
impl<'dom> StructuralPartialEq for ServoLayoutNode<'dom>
impl Sync for ServoLayoutNode<'_>
Auto Trait Implementations§
impl<'dom> !RefUnwindSafe for ServoLayoutNode<'dom>
impl<'dom> !UnwindSafe for ServoLayoutNode<'dom>
impl<'dom> Freeze for ServoLayoutNode<'dom>
impl<'dom> Unpin for ServoLayoutNode<'dom>
impl<'dom> UnsafeUnpin for ServoLayoutNode<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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