pub struct LayoutContext<'a, T: ParsedFontTrait> {
pub styled_dom: &'a StyledDom,
pub font_manager: &'a FontManager<T>,
pub selections: &'a BTreeMap<DomId, SelectionState>,
pub text_selections: &'a BTreeMap<DomId, TextSelection>,
pub debug_messages: &'a mut Option<Vec<LayoutDebugMessage>>,
pub counters: &'a mut BTreeMap<(usize, String), i32>,
pub viewport_size: LogicalSize,
pub fragmentation_context: Option<&'a mut FragmentationContext>,
pub cursor_is_visible: bool,
pub cursor_location: Option<(DomId, NodeId, TextCursor)>,
}Expand description
Central context for a single layout pass.
Fields§
§styled_dom: &'a StyledDom§font_manager: &'a FontManager<T>§selections: &'a BTreeMap<DomId, SelectionState>Legacy per-node selection state (for backward compatibility)
text_selections: &'a BTreeMap<DomId, TextSelection>New multi-node text selection with anchor/focus model
debug_messages: &'a mut Option<Vec<LayoutDebugMessage>>§counters: &'a mut BTreeMap<(usize, String), i32>§viewport_size: LogicalSize§fragmentation_context: Option<&'a mut FragmentationContext>Fragmentation context for CSS Paged Media (PDF generation) When Some, layout respects page boundaries and generates one DisplayList per page
cursor_is_visible: boolWhether the text cursor should be drawn (managed by CursorManager blink timer) When false, the cursor is in the “off” phase of blinking and should not be rendered. When true (default), the cursor is visible.
cursor_location: Option<(DomId, NodeId, TextCursor)>Current cursor location from CursorManager (dom_id, node_id, cursor) This is separate from selections - the cursor represents the text insertion point in a contenteditable element and should be painted independently.
Implementations§
Source§impl<'a, T: ParsedFontTrait> LayoutContext<'a, T>
impl<'a, T: ParsedFontTrait> LayoutContext<'a, T>
Sourcepub fn debug_log_inner(&mut self, message: String)
pub fn debug_log_inner(&mut self, message: String)
Internal method - called by debug_log! macro after checking has_debug()
Sourcepub fn debug_info_inner(&mut self, message: String)
pub fn debug_info_inner(&mut self, message: String)
Internal method - called by debug_info! macro after checking has_debug()
Sourcepub fn debug_warning_inner(&mut self, message: String)
pub fn debug_warning_inner(&mut self, message: String)
Internal method - called by debug_warning! macro after checking has_debug()
Sourcepub fn debug_error_inner(&mut self, message: String)
pub fn debug_error_inner(&mut self, message: String)
Internal method - called by debug_error! macro after checking has_debug()
Sourcepub fn debug_box_props_inner(&mut self, message: String)
pub fn debug_box_props_inner(&mut self, message: String)
Internal method - called by debug_box_props! macro after checking has_debug()
Sourcepub fn debug_css_getter_inner(&mut self, message: String)
pub fn debug_css_getter_inner(&mut self, message: String)
Internal method - called by debug_css_getter! macro after checking has_debug()
Sourcepub fn debug_bfc_layout_inner(&mut self, message: String)
pub fn debug_bfc_layout_inner(&mut self, message: String)
Internal method - called by debug_bfc_layout! macro after checking has_debug()
Sourcepub fn debug_ifc_layout_inner(&mut self, message: String)
pub fn debug_ifc_layout_inner(&mut self, message: String)
Internal method - called by debug_ifc_layout! macro after checking has_debug()
Sourcepub fn debug_table_layout_inner(&mut self, message: String)
pub fn debug_table_layout_inner(&mut self, message: String)
Internal method - called by debug_table_layout! macro after checking has_debug()
Sourcepub fn debug_display_type_inner(&mut self, message: String)
pub fn debug_display_type_inner(&mut self, message: String)
Internal method - called by debug_display_type! macro after checking has_debug()
pub fn debug_info(&mut self, message: impl Into<String>)
pub fn debug_warning(&mut self, message: impl Into<String>)
pub fn debug_error(&mut self, message: impl Into<String>)
pub fn debug_log(&mut self, message: &str)
pub fn debug_box_props(&mut self, message: impl Into<String>)
pub fn debug_css_getter(&mut self, message: impl Into<String>)
pub fn debug_bfc_layout(&mut self, message: impl Into<String>)
pub fn debug_ifc_layout(&mut self, message: impl Into<String>)
pub fn debug_table_layout(&mut self, message: impl Into<String>)
pub fn debug_display_type(&mut self, message: impl Into<String>)
Auto Trait Implementations§
impl<'a, T> Freeze for LayoutContext<'a, T>
impl<'a, T> RefUnwindSafe for LayoutContext<'a, T>
impl<'a, T> Send for LayoutContext<'a, T>
impl<'a, T> Sync for LayoutContext<'a, T>
impl<'a, T> Unpin for LayoutContext<'a, T>
impl<'a, T> !UnwindSafe for LayoutContext<'a, T>
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> 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