Trait script::dom::node::LayoutNodeHelpers
source · pub trait LayoutNodeHelpers<'dom> {
Show 27 methods
// Required methods
fn type_id_for_layout(self) -> NodeTypeId;
fn composed_parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn first_child_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn last_child_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn prev_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn next_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>;
fn owner_doc_for_layout(self) -> LayoutDom<'dom, Document>;
fn containing_shadow_root_for_layout(
self,
) -> Option<LayoutDom<'dom, ShadowRoot>>;
fn is_element_for_layout(&self) -> bool;
unsafe fn get_flag(self, flag: NodeFlags) -> bool;
unsafe fn set_flag(self, flag: NodeFlags, value: bool);
fn style_data(self) -> Option<&'dom StyleData>;
fn layout_data(self) -> Option<&'dom GenericLayoutData>;
unsafe fn initialize_style_data(self);
unsafe fn initialize_layout_data(self, data: Box<GenericLayoutData>);
unsafe fn clear_style_and_layout_data(self);
fn text_content(self) -> Cow<'dom, str>;
fn selection(self) -> Option<Range<usize>>;
fn image_url(self) -> Option<ServoUrl>;
fn image_density(self) -> Option<f64>;
fn image_data(
self,
) -> Option<(Option<StdArc<Image>>, Option<ImageMetadata>)>;
fn canvas_data(self) -> Option<HTMLCanvasData>;
fn media_data(self) -> Option<HTMLMediaData>;
fn svg_data(self) -> Option<SVGSVGData>;
fn iframe_browsing_context_id(self) -> Option<BrowsingContextId>;
fn iframe_pipeline_id(self) -> Option<PipelineId>;
fn opaque(self) -> OpaqueNode;
}
Required Methods§
fn type_id_for_layout(self) -> NodeTypeId
fn composed_parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>
fn first_child_ref(self) -> Option<LayoutDom<'dom, Node>>
fn last_child_ref(self) -> Option<LayoutDom<'dom, Node>>
fn prev_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>
fn next_sibling_ref(self) -> Option<LayoutDom<'dom, Node>>
fn owner_doc_for_layout(self) -> LayoutDom<'dom, Document>
fn containing_shadow_root_for_layout( self, ) -> Option<LayoutDom<'dom, ShadowRoot>>
fn is_element_for_layout(&self) -> bool
unsafe fn get_flag(self, flag: NodeFlags) -> bool
unsafe fn set_flag(self, flag: NodeFlags, value: bool)
fn style_data(self) -> Option<&'dom StyleData>
fn layout_data(self) -> Option<&'dom GenericLayoutData>
sourceunsafe fn initialize_style_data(self)
unsafe fn initialize_style_data(self)
Initialize the style data of this node.
§Safety
This method is unsafe because it modifies the given node during layout. Callers should ensure that no other layout thread is attempting to read or modify the opaque layout data of this node.
sourceunsafe fn initialize_layout_data(self, data: Box<GenericLayoutData>)
unsafe fn initialize_layout_data(self, data: Box<GenericLayoutData>)
Initialize the opaque layout data of this node.
§Safety
This method is unsafe because it modifies the given node during layout. Callers should ensure that no other layout thread is attempting to read or modify the opaque layout data of this node.
sourceunsafe fn clear_style_and_layout_data(self)
unsafe fn clear_style_and_layout_data(self)
Clear the style and opaque layout data of this node.
§Safety
This method is unsafe because it modifies the given node during layout. Callers should ensure that no other layout thread is attempting to read or modify the opaque layout data of this node.