#[repr(transparent)]pub struct ServoLayoutNode<'dom> {
pub(super) node: LayoutDom<'dom, Node>,
}
Expand description
A wrapper around a LayoutDom<Node>
which provides a safe interface that
can be used during layout. This implements the LayoutNode
trait as well as
several style and selectors traits for use during layout. This version
should only be used on a single thread. If you need to use nodes across
threads use ServoThreadSafeLayoutNode.
Fields§
§node: LayoutDom<'dom, Node>
The wrapped private DOM node.
Implementations§
Source§impl<'dom> ServoLayoutNode<'dom>
impl<'dom> ServoLayoutNode<'dom>
pub(super) fn from_layout_js(n: LayoutDom<'dom, Node>) -> Self
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.
pub(super) fn script_type_id(&self) -> NodeTypeId
Sourcepub(crate) fn get_jsmanaged(self) -> LayoutDom<'dom, Node>
pub(crate) fn get_jsmanaged(self) -> LayoutDom<'dom, Node>
Returns the interior of this node as a LayoutDom
.
pub(crate) fn assigned_slot(self) -> Option<ServoLayoutElement<'dom>>
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 Debug for ServoLayoutNode<'_>
impl Debug for ServoLayoutNode<'_>
Source§impl<'dom> LayoutNode<'dom> for ServoLayoutNode<'dom>
impl<'dom> LayoutNode<'dom> for ServoLayoutNode<'dom>
type ConcreteThreadSafeLayoutNode = ServoThreadSafeLayoutNode<'dom>
fn to_threadsafe(&self) -> Self::ConcreteThreadSafeLayoutNode
Source§fn type_id(&self) -> LayoutNodeType
fn type_id(&self) -> LayoutNodeType
Source§unsafe fn initialize_style_and_layout_data<RequestedLayoutDataType: LayoutDataTrait>(
&self,
)
unsafe fn initialize_style_and_layout_data<RequestedLayoutDataType: LayoutDataTrait>( &self, )
Source§fn initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
fn initialize_layout_data<RequestedLayoutDataType: LayoutDataTrait>(&self)
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Source§fn style_data(&self) -> Option<&'dom StyleData>
fn style_data(&self) -> Option<&'dom StyleData>
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>
fn rev_children(self) -> LayoutIterator<ReverseChildrenIterator<Self>>
fn traverse_preorder(self) -> TreeIterator<Self>
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>
Source§impl<'dom> TNode for ServoLayoutNode<'dom>
impl<'dom> TNode for ServoLayoutNode<'dom>
Source§type ConcreteDocument = ServoLayoutDocument<'dom>
type ConcreteDocument = ServoLayoutDocument<'dom>
TDocument
type.Source§type ConcreteElement = ServoLayoutElement<'dom>
type ConcreteElement = ServoLayoutElement<'dom>
TElement
type.Source§type ConcreteShadowRoot = ServoShadowRoot<'dom>
type ConcreteShadowRoot = ServoShadowRoot<'dom>
TShadowRoot
type.Source§fn parent_node(&self) -> Option<Self>
fn parent_node(&self) -> Option<Self>
Source§fn first_child(&self) -> Option<Self>
fn first_child(&self) -> Option<Self>
Source§fn last_child(&self) -> Option<Self>
fn last_child(&self) -> Option<Self>
Source§fn prev_sibling(&self) -> Option<Self>
fn prev_sibling(&self) -> Option<Self>
Source§fn next_sibling(&self) -> Option<Self>
fn next_sibling(&self) -> Option<Self>
Source§fn owner_doc(&self) -> Self::ConcreteDocument
fn owner_doc(&self) -> Self::ConcreteDocument
Source§fn traversal_parent(&self) -> Option<ServoLayoutElement<'dom>>
fn traversal_parent(&self) -> Option<ServoLayoutElement<'dom>>
Source§fn opaque(&self) -> OpaqueNode
fn opaque(&self) -> OpaqueNode
OpaqueNode
.Source§fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
fn as_element(&self) -> Option<ServoLayoutElement<'dom>>
Source§fn as_document(&self) -> Option<ServoLayoutDocument<'dom>>
fn as_document(&self) -> Option<ServoLayoutDocument<'dom>>
Source§fn as_shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
fn as_shadow_root(&self) -> Option<ServoShadowRoot<'dom>>
Source§fn is_in_document(&self) -> bool
fn is_in_document(&self) -> bool
Source§fn dom_children(&self) -> DomChildren<Self>
fn dom_children(&self) -> DomChildren<Self>
Source§fn dom_descendants(&self) -> DomDescendants<Self>
fn dom_descendants(&self) -> DomDescendants<Self>
Source§fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
Source§fn parent_element(&self) -> Option<Self::ConcreteElement>
fn parent_element(&self) -> Option<Self::ConcreteElement>
Source§fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
impl<'dom> Copy 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.
FIXME(mrobinson): These are required because Layout 2020 sends non-threadsafe nodes to different threads. This should be adressed in a comprehensive way.
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<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