Skip to main content

DisplayListItem

Enum DisplayListItem 

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

The rectangle bounds in logical 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: LogicalRect

The rectangle bounds in logical 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: LogicalRect

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

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
§clip_rect: LogicalRect
§

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
§

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

§

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

§child_dom_id: DomId

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

§bounds: LogicalRect

The bounds where the IFrame should be rendered

§clip_rect: LogicalRect

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

Fields

§border_radius: BorderRadius
§

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

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

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

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.

Trait Implementations§

Source§

impl Clone for DisplayListItem

Source§

fn clone(&self) -> DisplayListItem

Returns a duplicate of the value. Read more
1.0.0 · 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.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool