pub enum DisplayListItem {
Show 30 variants
Rect {
bounds: LogicalRect,
color: ColorU,
border_radius: BorderRadius,
},
SelectionRect {
bounds: LogicalRect,
border_radius: BorderRadius,
color: ColorU,
},
CursorRect {
bounds: LogicalRect,
color: ColorU,
},
Border {
bounds: LogicalRect,
widths: StyleBorderWidths,
colors: StyleBorderColors,
styles: StyleBorderStyles,
border_radius: StyleBorderRadius,
},
TextLayout {
layout: Arc<dyn Any + Send + Sync>,
bounds: LogicalRect,
font_hash: FontHash,
font_size_px: f32,
color: ColorU,
},
Text {
glyphs: Vec<GlyphInstance>,
font_hash: FontHash,
font_size_px: f32,
color: ColorU,
clip_rect: LogicalRect,
},
Underline {
bounds: LogicalRect,
color: ColorU,
thickness: f32,
},
Strikethrough {
bounds: LogicalRect,
color: ColorU,
thickness: f32,
},
Overline {
bounds: LogicalRect,
color: ColorU,
thickness: f32,
},
Image {
bounds: LogicalRect,
image: ImageRef,
},
ScrollBar {
bounds: LogicalRect,
color: ColorU,
orientation: ScrollbarOrientation,
opacity_key: Option<OpacityKey>,
hit_id: Option<ScrollbarHitId>,
},
ScrollBarStyled {
info: Box<ScrollbarDrawInfo>,
},
IFrame {
child_dom_id: DomId,
bounds: LogicalRect,
clip_rect: LogicalRect,
},
PushClip {
bounds: LogicalRect,
border_radius: BorderRadius,
},
PopClip,
PushScrollFrame {
clip_bounds: LogicalRect,
content_size: LogicalSize,
scroll_id: LocalScrollId,
},
PopScrollFrame,
PushStackingContext {
z_index: i32,
bounds: LogicalRect,
},
PopStackingContext,
HitTestArea {
bounds: LogicalRect,
tag: DisplayListTagId,
},
LinearGradient {
bounds: LogicalRect,
gradient: LinearGradient,
border_radius: BorderRadius,
},
RadialGradient {
bounds: LogicalRect,
gradient: RadialGradient,
border_radius: BorderRadius,
},
ConicGradient {
bounds: LogicalRect,
gradient: ConicGradient,
border_radius: BorderRadius,
},
BoxShadow {
bounds: LogicalRect,
shadow: StyleBoxShadow,
border_radius: BorderRadius,
},
PushFilter {
bounds: LogicalRect,
filters: Vec<StyleFilter>,
},
PopFilter,
PushBackdropFilter {
bounds: LogicalRect,
filters: Vec<StyleFilter>,
},
PopBackdropFilter,
PushOpacity {
bounds: LogicalRect,
opacity: f32,
},
PopOpacity,
}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: LogicalRectThe rectangle bounds in logical 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: LogicalRectThe rectangle bounds in logical coordinates
border_radius: BorderRadiusCorner radii for rounded selection
CursorRect
A text cursor (caret) rectangle. Typically a thin vertical line indicating text insertion point.
Border
A CSS border with per-side widths, colors, and styles. Supports different styles per side (solid, dashed, dotted, etc.).
Fields
bounds: LogicalRectThe 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: LogicalRectText
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: LogicalRectorientation: 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
IFrame
An embedded IFrame that references a child DOM with its own display list. This mirrors webrender’s IframeDisplayItem. The renderer will look up the child display list by child_dom_id and render it within the bounds.
Fields
bounds: LogicalRectThe bounds where the IFrame should be rendered
clip_rect: LogicalRectThe clip rect for the IFrame content
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.
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: LogicalRectThe 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: LogicalRectThe bounds of the stacking context root element
PopStackingContext
Pops the current stacking context.
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.
Trait Implementations§
Source§impl Clone for DisplayListItem
impl Clone for DisplayListItem
Source§fn clone(&self) -> DisplayListItem
fn clone(&self) -> DisplayListItem
1.0.0 · 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 !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