pub enum DisplayListItem {
Show 37 variants
Rect {
bounds: WindowLogicalRect,
color: ColorU,
border_radius: BorderRadius,
},
SelectionRect {
bounds: WindowLogicalRect,
border_radius: BorderRadius,
color: ColorU,
},
CursorRect {
bounds: WindowLogicalRect,
color: ColorU,
},
Border {
bounds: WindowLogicalRect,
widths: StyleBorderWidths,
colors: StyleBorderColors,
styles: StyleBorderStyles,
border_radius: StyleBorderRadius,
},
TextLayout {
layout: Arc<dyn Any + Send + Sync>,
bounds: WindowLogicalRect,
font_hash: FontHash,
font_size_px: f32,
color: ColorU,
},
Text {
glyphs: Vec<GlyphInstance>,
font_hash: FontHash,
font_size_px: f32,
color: ColorU,
clip_rect: WindowLogicalRect,
source_node_index: Option<usize>,
},
Underline {
bounds: WindowLogicalRect,
color: ColorU,
thickness: f32,
},
Strikethrough {
bounds: WindowLogicalRect,
color: ColorU,
thickness: f32,
},
Overline {
bounds: WindowLogicalRect,
color: ColorU,
thickness: f32,
},
Image {
bounds: WindowLogicalRect,
image: ImageRef,
border_radius: BorderRadius,
},
ScrollBar {
bounds: WindowLogicalRect,
color: ColorU,
orientation: ScrollbarOrientation,
opacity_key: Option<OpacityKey>,
hit_id: Option<ScrollbarHitId>,
},
ScrollBarStyled {
info: Box<ScrollbarDrawInfo>,
},
VirtualView {
child_dom_id: DomId,
bounds: WindowLogicalRect,
clip_rect: WindowLogicalRect,
},
VirtualViewPlaceholder {
node_id: NodeId,
bounds: WindowLogicalRect,
clip_rect: WindowLogicalRect,
},
PushClip {
bounds: WindowLogicalRect,
border_radius: BorderRadius,
},
PopClip,
PushImageMaskClip {
bounds: WindowLogicalRect,
mask_image: ImageRef,
mask_rect: WindowLogicalRect,
},
PopImageMaskClip,
PushScrollFrame {
clip_bounds: WindowLogicalRect,
content_size: LogicalSize,
scroll_id: LocalScrollId,
},
PopScrollFrame,
PushStackingContext {
z_index: i32,
bounds: WindowLogicalRect,
},
PopStackingContext,
PushReferenceFrame {
transform_key: TransformKey,
initial_transform: ComputedTransform3D,
bounds: WindowLogicalRect,
},
PopReferenceFrame,
HitTestArea {
bounds: WindowLogicalRect,
tag: DisplayListTagId,
},
LinearGradient {
bounds: WindowLogicalRect,
gradient: LinearGradient,
border_radius: BorderRadius,
},
RadialGradient {
bounds: WindowLogicalRect,
gradient: RadialGradient,
border_radius: BorderRadius,
},
ConicGradient {
bounds: WindowLogicalRect,
gradient: ConicGradient,
border_radius: BorderRadius,
},
BoxShadow {
bounds: WindowLogicalRect,
shadow: StyleBoxShadow,
border_radius: BorderRadius,
},
PushFilter {
bounds: WindowLogicalRect,
filters: Vec<StyleFilter>,
},
PopFilter,
PushBackdropFilter {
bounds: WindowLogicalRect,
filters: Vec<StyleFilter>,
},
PopBackdropFilter,
PushOpacity {
bounds: WindowLogicalRect,
opacity: f32,
},
PopOpacity,
PushTextShadow {
shadow: StyleBoxShadow,
},
PopTextShadow,
}Expand description
A command in the display list. Can be either a drawing primitive or a state-management instruction for the renderer’s graphics context.
Variants§
Rect
A filled rectangle with optional rounded corners. Used for backgrounds, colored boxes, and other solid fills.
Fields
bounds: WindowLogicalRectThe rectangle bounds in absolute window coordinates
border_radius: BorderRadiusCorner radii for rounded rectangles
SelectionRect
A selection highlight rectangle (e.g., for text selection). Rendered behind text to show selected regions.
Fields
bounds: WindowLogicalRectThe rectangle bounds in absolute window coordinates
border_radius: BorderRadiusCorner radii for rounded selection
CursorRect
A text cursor (caret) rectangle. Typically a thin vertical line indicating text insertion point.
Fields
bounds: WindowLogicalRectThe cursor bounds (usually narrow width)
Border
A CSS border with per-side widths, colors, and styles. Supports different styles per side (solid, dashed, dotted, etc.).
Fields
bounds: WindowLogicalRectThe border-box bounds
widths: StyleBorderWidthsBorder widths for each side
colors: StyleBorderColorsBorder colors for each side
styles: StyleBorderStylesBorder styles for each side (solid, dashed, etc.)
border_radius: StyleBorderRadiusCorner radii for rounded borders
TextLayout
Text layout with full metadata (for PDF, accessibility, etc.) This is pushed BEFORE the individual Text items and contains the original text, glyph-to-unicode mapping, and positioning info
Fields
bounds: WindowLogicalRectText
Text rendered with individual glyph positioning (for simple renderers)
Underline
Underline decoration for text (CSS text-decoration: underline)
Strikethrough
Strikethrough decoration for text (CSS text-decoration: line-through)
Overline
Overline decoration for text (CSS text-decoration: overline)
Image
ScrollBar
A dedicated primitive for a scrollbar with optional GPU-animated opacity. This is a simple single-color scrollbar used for basic rendering.
Fields
bounds: WindowLogicalRectorientation: ScrollbarOrientationopacity_key: Option<OpacityKey>Optional opacity key for GPU-side fading animation.
If present, the renderer will use this key to look up dynamic opacity.
If None, the alpha channel of color is used directly.
hit_id: Option<ScrollbarHitId>Optional hit-test ID for WebRender hit-testing. If present, allows event handlers to identify which scrollbar component was clicked.
ScrollBarStyled
A fully styled scrollbar with separate track, thumb, and optional buttons. Used when CSS scrollbar properties are specified.
Fields
info: Box<ScrollbarDrawInfo>Complete drawing information for all scrollbar components
VirtualView
An embedded VirtualView that references a child DOM with its own display list. The renderer will look up the child display list by child_dom_id and render it within the bounds. The VirtualView viewport is rendered in parent coordinate space (NOT inside a scroll frame) so it stays stationary. Scroll offset is communicated to the VirtualView callback, not via WebRender.
Fields
bounds: WindowLogicalRectThe bounds where the VirtualView should be rendered
clip_rect: WindowLogicalRectThe clip rect for the VirtualView content
VirtualViewPlaceholder
Placeholder emitted during display list generation for VirtualView nodes.
window.rs replaces this with a real VirtualView item after invoking
the VirtualView callback. This avoids the need for post-hoc scroll frame
scanning — window.rs simply finds the placeholder by node_id.
Unlike regular scrollable nodes, VirtualView nodes do NOT get a
PushScrollFrame/PopScrollFrame pair. Scroll state is managed by
ScrollManager and passed to the VirtualView callback as scroll_offset.
Fields
bounds: WindowLogicalRectThe layout bounds of the VirtualView container
clip_rect: WindowLogicalRectThe clip rect (same as bounds initially, may be adjusted)
PushClip
Pushes a new clipping rectangle onto the renderer’s clip stack. All subsequent primitives will be clipped by this rect until a PopClip.
PopClip
Pops the current clip from the renderer’s clip stack.
PushImageMaskClip
Pushes an image-based clip mask onto the renderer’s clip stack. The mask image should be R8 format: white (255) = visible, black (0) = clipped. All subsequent primitives will be masked until PopImageMaskClip.
Fields
bounds: WindowLogicalRectThe bounds of the element being clipped
mask_rect: WindowLogicalRectThe rect within which the mask is applied
PopImageMaskClip
Pops the current image mask clip from the renderer’s clip stack.
PushScrollFrame
Defines a scrollable area. This is a specialized clip that also establishes a new coordinate system for its children, which can be offset.
Fields
clip_bounds: WindowLogicalRectThe clip rect in the parent’s coordinate space.
content_size: LogicalSizeThe total size of the scrollable content.
scroll_id: LocalScrollIdAn ID for the renderer to track this scrollable area between frames.
PopScrollFrame
Pops the current scroll frame.
PushStackingContext
Pushes a new stacking context for proper z-index layering. All subsequent primitives until PopStackingContext will be in this stacking context.
Fields
bounds: WindowLogicalRectThe bounds of the stacking context root element
PopStackingContext
Pops the current stacking context.
PushReferenceFrame
Pushes a reference frame with a GPU-accelerated transform. Used for CSS transforms and drag visual offsets. Creates a new spatial coordinate system for all children.
Fields
transform_key: TransformKeyThe transform key for GPU-animated property binding
initial_transform: ComputedTransform3DThe initial transform value (identity for drag, computed for CSS transform)
bounds: WindowLogicalRectThe bounds of the reference frame (origin = transform origin)
PopReferenceFrame
Pops the current reference frame.
HitTestArea
Defines a region for hit-testing.
LinearGradient
A linear gradient fill.
RadialGradient
A radial gradient fill.
ConicGradient
A conic (angular) gradient fill.
BoxShadow
A box shadow (either outset or inset).
PushFilter
Push a filter effect that applies to subsequent content.
PopFilter
Pop a previously pushed filter.
PushBackdropFilter
Push a backdrop filter (applies to content behind the element).
PopBackdropFilter
Pop a previously pushed backdrop filter.
PushOpacity
Push an opacity layer.
PopOpacity
Pop an opacity layer.
PushTextShadow
Push a text shadow that applies to subsequent text content.
Fields
shadow: StyleBoxShadowPopTextShadow
Pop all text shadows.
Implementations§
Source§impl DisplayListItem
impl DisplayListItem
Sourcepub fn is_visually_equal(&self, other: &Self) -> bool
pub fn is_visually_equal(&self, other: &Self) -> bool
Compare two display list items for visual equality (same appearance when rendered).
Used by damage computation to detect content changes within the same bounds.
Conservative: returns false (assumes different) for complex types like Arc
Sourcepub fn is_state_management(&self) -> bool
pub fn is_state_management(&self) -> bool
Returns true if this item is a state-management command (Push/Pop) that must always be processed to maintain correct stacks.
Sourcepub fn visual_bounds(&self) -> Option<LogicalRect>
pub fn visual_bounds(&self) -> Option<LogicalRect>
Return the visual bounding rect including effects that extend beyond content bounds (e.g. box-shadow spread/blur/offset). Used for damage rect computation where we need the full repaint area.
Sourcepub fn bounds(&self) -> Option<LogicalRect>
pub fn bounds(&self) -> Option<LogicalRect>
Return the bounding rect of this item, or None for push/pop commands that don’t have their own visual bounds.
Trait Implementations§
Source§impl Clone for DisplayListItem
impl Clone for DisplayListItem
Source§fn clone(&self) -> DisplayListItem
fn clone(&self) -> DisplayListItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DisplayListItem
impl !RefUnwindSafe for DisplayListItem
impl Send for DisplayListItem
impl Sync for DisplayListItem
impl Unpin for DisplayListItem
impl UnsafeUnpin for DisplayListItem
impl !UnwindSafe for DisplayListItem
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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