Skip to main content

DisplayListItem

Enum DisplayListItem 

Source
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: WindowLogicalRect

The rectangle bounds in absolute window coordinates

§color: ColorU

The fill color (RGBA)

§border_radius: BorderRadius

Corner radii for rounded rectangles

§

SelectionRect

A selection highlight rectangle (e.g., for text selection). Rendered behind text to show selected regions.

Fields

§bounds: WindowLogicalRect

The rectangle bounds in absolute window coordinates

§border_radius: BorderRadius

Corner radii for rounded selection

§color: ColorU

The selection highlight color (typically semi-transparent)

§

CursorRect

A text cursor (caret) rectangle. Typically a thin vertical line indicating text insertion point.

Fields

§bounds: WindowLogicalRect

The cursor bounds (usually narrow width)

§color: ColorU

The cursor color

§

Border

A CSS border with per-side widths, colors, and styles. Supports different styles per side (solid, dashed, dotted, etc.).

Fields

§bounds: WindowLogicalRect

The border-box bounds

§widths: StyleBorderWidths

Border widths for each side

§colors: StyleBorderColors

Border colors for each side

§styles: StyleBorderStyles

Border styles for each side (solid, dashed, etc.)

§border_radius: StyleBorderRadius

Corner 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

§layout: Arc<dyn Any + Send + Sync>
§font_hash: FontHash
§font_size_px: f32
§color: ColorU
§

Text

Text rendered with individual glyph positioning (for simple renderers)

Fields

§font_hash: FontHash
§font_size_px: f32
§color: ColorU
§source_node_index: Option<usize>

Layout node index that produced this text run. Enables patching glyphs without full display list regeneration.

§

Underline

Underline decoration for text (CSS text-decoration: underline)

Fields

§color: ColorU
§thickness: f32
§

Strikethrough

Strikethrough decoration for text (CSS text-decoration: line-through)

Fields

§color: ColorU
§thickness: f32
§

Overline

Overline decoration for text (CSS text-decoration: overline)

Fields

§color: ColorU
§thickness: f32
§

Image

Fields

§image: ImageRef
§border_radius: BorderRadius
§

ScrollBar

A dedicated primitive for a scrollbar with optional GPU-animated opacity. This is a simple single-color scrollbar used for basic rendering.

Fields

§color: ColorU
§opacity_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

§child_dom_id: DomId

The DomId of the child DOM (similar to webrender’s pipeline_id)

§bounds: WindowLogicalRect

The bounds where the VirtualView should be rendered

§clip_rect: WindowLogicalRect

The 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

§node_id: NodeId

The DOM NodeId of the VirtualView element in the parent DOM

§bounds: WindowLogicalRect

The layout bounds of the VirtualView container

§clip_rect: WindowLogicalRect

The 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.

Fields

§border_radius: BorderRadius
§

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: WindowLogicalRect

The bounds of the element being clipped

§mask_image: ImageRef

The mask image (R8 format)

§mask_rect: WindowLogicalRect

The 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: WindowLogicalRect

The clip rect in the parent’s coordinate space.

§content_size: LogicalSize

The total size of the scrollable content.

§scroll_id: LocalScrollId

An 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

§z_index: i32

The z-index for this stacking context (for debugging/validation)

§bounds: WindowLogicalRect

The 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: TransformKey

The transform key for GPU-animated property binding

§initial_transform: ComputedTransform3D

The initial transform value (identity for drag, computed for CSS transform)

§bounds: WindowLogicalRect

The 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.

Fields

§border_radius: BorderRadius
§

RadialGradient

A radial gradient fill.

Fields

§border_radius: BorderRadius
§

ConicGradient

A conic (angular) gradient fill.

Fields

§gradient: ConicGradient
§border_radius: BorderRadius
§

BoxShadow

A box shadow (either outset or inset).

Fields

§border_radius: BorderRadius
§

PushFilter

Push a filter effect that applies to subsequent content.

Fields

§filters: Vec<StyleFilter>
§

PopFilter

Pop a previously pushed filter.

§

PushBackdropFilter

Push a backdrop filter (applies to content behind the element).

Fields

§filters: Vec<StyleFilter>
§

PopBackdropFilter

Pop a previously pushed backdrop filter.

§

PushOpacity

Push an opacity layer.

Fields

§opacity: f32
§

PopOpacity

Pop an opacity layer.

§

PushTextShadow

Push a text shadow that applies to subsequent text content.

Fields

§

PopTextShadow

Pop all text shadows.

Implementations§

Source§

impl DisplayListItem

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> DisplayListItem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DisplayListItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.