pub(crate) trait LayoutNodeHelpers<'dom> {
Show 35 methods
// Required methods
fn type_id_for_layout(self) -> NodeTypeId;
fn parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>;
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 assigned_slot_for_layout(
self,
) -> Option<LayoutDom<'dom, HTMLSlotElement>>;
fn is_element_for_layout(&self) -> bool;
fn is_text_node_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 is_text_input(&self) -> bool;
fn is_single_line_text_inner_editor(&self) -> bool;
fn is_text_container_of_single_line_input(&self) -> bool;
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<Image>, Option<ImageMetadata>)>;
fn canvas_data(self) -> Option<HTMLCanvasData>;
fn media_data(self) -> Option<HTMLMediaData>;
fn svg_data(self) -> Option<SVGElementData>;
fn iframe_browsing_context_id(self) -> Option<BrowsingContextId>;
fn iframe_pipeline_id(self) -> Option<PipelineId>;
fn opaque(self) -> OpaqueNode;
fn implemented_pseudo_element(&self) -> Option<PseudoElement>;
fn is_in_ua_widget(&self) -> bool;
}
Required Methods§
fn type_id_for_layout(self) -> NodeTypeId
fn parent_node_ref(self) -> Option<LayoutDom<'dom, Node>>
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 assigned_slot_for_layout(self) -> Option<LayoutDom<'dom, HTMLSlotElement>>
fn is_element_for_layout(&self) -> bool
fn is_text_node_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.
Sourcefn is_text_input(&self) -> bool
fn is_text_input(&self) -> bool
Whether this element is a <input>
rendered as text or a <textarea>
.
This is used for the rendering of text control element in the past
where the necessities is being handled within layout. With the current
implementation of Shadow DOM, we are able to move and expand this kind
of behavior in the previous pipelines (i.e. DOM, style traversal).
Sourcefn is_single_line_text_inner_editor(&self) -> bool
fn is_single_line_text_inner_editor(&self) -> bool
Whether this element serve as a container of editable text for a text input that is implemented as an UA widget.
Sourcefn is_text_container_of_single_line_input(&self) -> bool
fn is_text_container_of_single_line_input(&self) -> bool
Whether this element serve as a container of any text inside a text input that is implemented as an UA widget.