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§

source

fn to_threadsafe(&self) -> Self::ConcreteThreadSafeLayoutNode

source

fn type_id(&self) -> LayoutNodeType

Returns the type ID of this node.

source

unsafe fn initialize_data(&self)

source

unsafe fn init_style_and_opaque_layout_data( &self, data: Box<StyleAndOpaqueLayoutData> )

source

unsafe fn take_style_and_opaque_layout_data( &self ) -> Box<StyleAndOpaqueLayoutData>

source

fn is_connected(&self) -> bool

Returns whether the node is connected.

Provided Methods§

Implementors§