pub struct ServoLayoutNode<'dom> {
pub(super) node: LayoutDom<'dom, Node>,
pub(super) pseudo_element_chain: PseudoElementChain,
}Expand description
A wrapper around a LayoutDom<Node> which provides a safe interface that
can be used during layout. This implements the LayoutNode trait.
Fields§
§node: LayoutDom<'dom, Node>The wrapped private DOM node.
pseudo_element_chain: PseudoElementChainThe possibly nested PseudoElementChain for this node.
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.
Sourcepub(super) unsafe fn dangerous_first_child(&self) -> Option<Self>
pub(super) unsafe fn dangerous_first_child(&self) -> Option<Self>
Get the first child of this node.
§Safety
This node should never be exposed directly to the layout interface, as that may allow
mutating a node that is being laid out in another thread. Thus, this should never be
made public or exposed in the LayoutNode trait.
Sourcepub(super) unsafe fn dangerous_next_sibling(&self) -> Option<Self>
pub(super) unsafe fn dangerous_next_sibling(&self) -> Option<Self>
Get the next sibling of this node.
§Safety
This node should never be exposed directly to the layout interface, as that may allow
mutating a node that is being laid out in another thread. Thus, this should never be
made public or exposed in the LayoutNode trait.
Sourcepub(super) unsafe fn dangerous_previous_sibling(&self) -> Option<Self>
pub(super) unsafe fn dangerous_previous_sibling(&self) -> Option<Self>
Get the previous sibling of this node.
§Safety
This node should never be exposed directly to the layout interface, as that may allow
mutating a node that is being laid out in another thread. Thus, this should never be
made public or exposed in the LayoutNode trait.
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>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'dom> Debug for ServoLayoutNode<'dom>
impl<'dom> Debug 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 ConcreteDangerousStyleNode = ServoDangerousStyleNode<'dom>
type ConcreteDangerousStyleNode = ServoDangerousStyleNode<'dom>
DangerousStyleNode implemented in script.Source§type ConcreteDangerousStyleElement = ServoDangerousStyleElement<'dom>
type ConcreteDangerousStyleElement = ServoDangerousStyleElement<'dom>
DangerousStyleElement implemented in script.Source§type ConcreteLayoutElement = ServoLayoutElement<'dom>
type ConcreteLayoutElement = ServoLayoutElement<'dom>
ConcreteLayoutElement] implemented in script.Source§type ChildIterator = ServoLayoutNodeChildrenIterator<'dom>
type ChildIterator = ServoLayoutNodeChildrenIterator<'dom>
ChildIterator] 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) -> Self::ConcreteDangerousStyleNode
unsafe fn dangerous_style_node(self) -> Self::ConcreteDangerousStyleNode
Source§unsafe fn dangerous_dom_parent(self) -> Option<Self>
unsafe fn dangerous_dom_parent(self) -> Option<Self>
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>
Self::dangerous_flat_tree_parent. Read moreSource§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Source§fn layout_data(&self) -> Option<&'dom GenericLayoutData>
fn layout_data(&self) -> Option<&'dom GenericLayoutData>
Source§fn opaque(&self) -> OpaqueNode
fn opaque(&self) -> OpaqueNode
OpaqueNode.Source§fn pseudo_element_chain(&self) -> PseudoElementChain
fn pseudo_element_chain(&self) -> PseudoElementChain
PseudoElementChain for this LayoutElement.Source§fn type_id(&self) -> Option<LayoutNodeType>
fn type_id(&self) -> Option<LayoutNodeType>
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>
Source§fn parent_style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
fn parent_style(&self, context: &SharedStyleContext<'_>) -> Arc<ComputedValues>
Source§fn selected_style(
&self,
context: &SharedStyleContext<'_>,
) -> Arc<ComputedValues>
fn selected_style( &self, context: &SharedStyleContext<'_>, ) -> Arc<ComputedValues>
: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)
Source§fn flat_tree_children(
&self,
) -> LayoutIterator<ServoLayoutNodeChildrenIterator<'dom>>
fn flat_tree_children( &self, ) -> LayoutIterator<ServoLayoutNodeChildrenIterator<'dom>>
Source§fn dom_children(&self) -> LayoutIterator<ServoLayoutNodeChildrenIterator<'dom>>
fn dom_children(&self) -> LayoutIterator<ServoLayoutNodeChildrenIterator<'dom>>
Self::flat_tree_children.Source§fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
LayoutElement if this is an element.Source§fn as_html_element(&self) -> Option<ServoLayoutElement<'dom>>
fn as_html_element(&self) -> Option<ServoLayoutElement<'dom>>
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>
Source§fn selection(&self) -> Option<SharedSelection>
fn selection(&self) -> Option<SharedSelection>
Source§fn image_url(&self) -> Option<ServoUrl>
fn image_url(&self) -> Option<ServoUrl>
Source§fn image_density(&self) -> Option<f64>
fn image_density(&self) -> Option<f64>
Source§fn showing_broken_image_icon(&self) -> bool
fn showing_broken_image_icon(&self) -> bool
Source§fn image_data(&self) -> Option<(Option<Image>, Option<ImageMetadata>)>
fn image_data(&self) -> Option<(Option<Image>, Option<ImageMetadata>)>
None.Source§fn canvas_data(&self) -> Option<HTMLCanvasData>
fn canvas_data(&self) -> Option<HTMLCanvasData>
HTMLCanvas] data for this node, if it is a canvas.Source§fn media_data(&self) -> Option<HTMLMediaData>
fn media_data(&self) -> Option<HTMLMediaData>
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>>
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>
Source§fn iframe_pipeline_id(&self) -> Option<PipelineId>
fn iframe_pipeline_id(&self) -> Option<PipelineId>
Source§fn table_span(&self) -> Option<u32>
fn table_span(&self) -> Option<u32>
Source§fn table_colspan(&self) -> Option<u32>
fn table_colspan(&self) -> Option<u32>
Source§fn table_rowspan(&self) -> Option<u32>
fn table_rowspan(&self) -> Option<u32>
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, )
content
attribute that uses attr.Source§fn is_single_line_text_input(&self) -> bool
fn is_single_line_text_input(&self) -> bool
Source§fn is_root_of_user_agent_widget(&self) -> bool
fn is_root_of_user_agent_widget(&self) -> bool
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
Source§fn is_text_node(&self) -> bool
fn is_text_node(&self) -> bool
Source§impl<'dom> PartialEq for ServoLayoutNode<'dom>
impl<'dom> PartialEq for ServoLayoutNode<'dom>
impl<'dom> Copy for ServoLayoutNode<'dom>
impl<'dom> Eq for ServoLayoutNode<'dom>
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> Freeze for ServoLayoutNode<'dom>
impl<'dom> !RefUnwindSafe for ServoLayoutNode<'dom>
impl<'dom> Unpin for ServoLayoutNode<'dom>
impl<'dom> !UnwindSafe 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
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
key and return true if they are equal.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
key and return true if they are equal.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>
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>
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>
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