pub trait LayoutNode<'dom>: Copy + Debug + GetStyleAndOpaqueLayoutData<'dom> + TNode + Send + Sync {
type ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<'dom>;
// Required methods
fn to_threadsafe(&self) -> Self::ConcreteThreadSafeLayoutNode;
fn type_id(&self) -> LayoutNodeType;
unsafe fn initialize_data(&self);
unsafe fn init_style_and_opaque_layout_data(
&self,
data: Box<StyleAndOpaqueLayoutData>
);
unsafe fn take_style_and_opaque_layout_data(
&self
) -> Box<StyleAndOpaqueLayoutData>;
fn is_connected(&self) -> bool;
// Provided methods
fn rev_children(self) -> LayoutIterator<ReverseChildrenIterator<Self>> { ... }
fn traverse_preorder(self) -> TreeIterator<Self> ⓘ { ... }
}
Expand description
A wrapper so that layout can access only the methods that it should have access to. Layout must
only ever see these and must never see instances of LayoutDom
.
FIXME(mrobinson): Send + Sync
is required here for Layout 2020, but eventually it
should stop sending LayoutNodes to other threads and rely on ThreadSafeLayoutNode
or some other mechanism to ensure thread safety.
Required Associated Types§
Required Methods§
fn to_threadsafe(&self) -> Self::ConcreteThreadSafeLayoutNode
sourcefn type_id(&self) -> LayoutNodeType
fn type_id(&self) -> LayoutNodeType
Returns the type ID of this node.
unsafe fn initialize_data(&self)
unsafe fn init_style_and_opaque_layout_data( &self, data: Box<StyleAndOpaqueLayoutData> )
unsafe fn take_style_and_opaque_layout_data( &self ) -> Box<StyleAndOpaqueLayoutData>
sourcefn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns whether the node is connected.