Help us shape the future of Go! Take the 2026 Go Developer Survey

layertree

package
v0.159.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 3 Imported by: 5

Documentation

Overview

Package layertree provides the Chrome DevTools Protocol commands, types, and events for the LayerTree domain.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandCompositingReasons = "LayerTree.compositingReasons"
	CommandDisable            = "LayerTree.disable"
	CommandEnable             = "LayerTree.enable"
	CommandLoadSnapshot       = "LayerTree.loadSnapshot"
	CommandMakeSnapshot       = "LayerTree.makeSnapshot"
	CommandProfileSnapshot    = "LayerTree.profileSnapshot"
	CommandReleaseSnapshot    = "LayerTree.releaseSnapshot"
	CommandReplaySnapshot     = "LayerTree.replaySnapshot"
	CommandSnapshotCommandLog = "LayerTree.snapshotCommandLog"
)

Command names.

Variables

CompositingReasons provides the reasons why the given layer was composited.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-compositingReasons

View Source
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}

Disable disables compositing tree inspection.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-disable

Enable enables compositing tree inspection.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-enable

View Source
var LayerPainted = cdp.Event[EventLayerPainted]{Method: "LayerTree.layerPainted"}

LayerPainted [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#event-layerPainted

View Source
var LayerTreeDidChange = cdp.Event[EventLayerTreeDidChange]{Method: "LayerTree.layerTreeDidChange"}

LayerTreeDidChange [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#event-layerTreeDidChange

LoadSnapshot returns the snapshot identifier.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-loadSnapshot

MakeSnapshot returns the layer snapshot identifier.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-makeSnapshot

ProfileSnapshot [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-profileSnapshot

ReleaseSnapshot releases layer snapshot captured by the back-end.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-releaseSnapshot

ReplaySnapshot replays the layer snapshot and returns the resulting bitmap.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-replaySnapshot

SnapshotCommandLog replays the layer snapshot and returns canvas log.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#method-snapshotCommandLog

Functions

This section is empty.

Types

type CompositingReasonsParams

type CompositingReasonsParams struct {
	LayerID LayerID `json:"layerId"` // The id of the layer for which we want to get the reasons it was composited.
}

CompositingReasonsParams are the parameters of the command LayerTree.compositingReasons.

type CompositingReasonsResult added in v0.157.3

type CompositingReasonsResult struct {
	CompositingReasons   []string `json:"compositingReasons,omitempty,omitzero"`   // A list of strings specifying reasons for the given layer to become composited.
	CompositingReasonIDs []string `json:"compositingReasonIds,omitempty,omitzero"` // A list of strings specifying reason IDs for the given layer to become composited.
}

CompositingReasonsResult is the result of the command LayerTree.compositingReasons.

type EventLayerPainted

type EventLayerPainted struct {
	LayerID LayerID   `json:"layerId"` // The id of the painted layer.
	Clip    *dom.Rect `json:"clip"`    // Clip rectangle.
}

EventLayerPainted [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#event-layerPainted

type EventLayerTreeDidChange

type EventLayerTreeDidChange struct {
	Layers []*Layer `json:"layers,omitempty,omitzero"` // Layer tree, absent if not in the compositing mode.
}

EventLayerTreeDidChange [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#event-layerTreeDidChange

type Layer

type Layer struct {
	LayerID                  LayerID                   `json:"layerId"`                                     // The unique id for this layer.
	ParentLayerID            LayerID                   `json:"parentLayerId,omitempty,omitzero"`            // The id of parent (not present for root).
	BackendNodeID            cdp.BackendNodeID         `json:"backendNodeId,omitempty,omitzero"`            // The backend id for the node associated with this layer.
	OffsetX                  float64                   `json:"offsetX"`                                     // Offset from parent layer, X coordinate.
	OffsetY                  float64                   `json:"offsetY"`                                     // Offset from parent layer, Y coordinate.
	Width                    float64                   `json:"width"`                                       // Layer width.
	Height                   float64                   `json:"height"`                                      // Layer height.
	Transform                []float64                 `json:"transform,omitempty,omitzero"`                // Transformation matrix for layer, default is identity matrix
	AnchorX                  float64                   `json:"anchorX,omitempty,omitzero"`                  // Transform anchor point X, absent if no transform specified
	AnchorY                  float64                   `json:"anchorY,omitempty,omitzero"`                  // Transform anchor point Y, absent if no transform specified
	AnchorZ                  float64                   `json:"anchorZ,omitempty,omitzero"`                  // Transform anchor point Z, absent if no transform specified
	PaintCount               int64                     `json:"paintCount"`                                  // Indicates how many time this layer has painted.
	DrawsContent             bool                      `json:"drawsContent"`                                // Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
	Invisible                bool                      `json:"invisible"`                                   // Set if layer is not visible.
	ScrollRects              []*ScrollRect             `json:"scrollRects,omitempty,omitzero"`              // Rectangles scrolling on main thread only.
	StickyPositionConstraint *StickyPositionConstraint `json:"stickyPositionConstraint,omitempty,omitzero"` // Sticky position constraint information
}

Layer information about a compositing layer.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-Layer

type LayerID

type LayerID string

LayerID unique Layer identifier.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-LayerId

func (LayerID) String

func (t LayerID) String() string

String returns the LayerID as string value.

type LoadSnapshotParams

type LoadSnapshotParams struct {
	Tiles []*PictureTile `json:"tiles"` // An array of tiles composing the snapshot.
}

LoadSnapshotParams are the parameters of the command LayerTree.loadSnapshot.

type LoadSnapshotResult added in v0.157.3

type LoadSnapshotResult struct {
	SnapshotID SnapshotID `json:"snapshotId,omitempty,omitzero"` // The id of the snapshot.
}

LoadSnapshotResult is the result of the command LayerTree.loadSnapshot.

type MakeSnapshotParams

type MakeSnapshotParams struct {
	LayerID LayerID `json:"layerId"` // The id of the layer.
}

MakeSnapshotParams are the parameters of the command LayerTree.makeSnapshot.

type MakeSnapshotResult added in v0.157.3

type MakeSnapshotResult struct {
	SnapshotID SnapshotID `json:"snapshotId,omitempty,omitzero"` // The id of the layer snapshot.
}

MakeSnapshotResult is the result of the command LayerTree.makeSnapshot.

type PaintProfile

type PaintProfile []float64

PaintProfile array of timings, one per paint step.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-PaintProfile

type PictureTile

type PictureTile struct {
	X       float64 `json:"x"`       // Offset from owning layer left boundary
	Y       float64 `json:"y"`       // Offset from owning layer top boundary
	Picture []byte  `json:"picture"` // Base64-encoded snapshot data.
}

PictureTile serialized fragment of layer picture along with its offset within the layer.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-PictureTile

type ProfileSnapshotParams

type ProfileSnapshotParams struct {
	SnapshotID     SnapshotID `json:"snapshotId"`                        // The id of the layer snapshot.
	MinRepeatCount int64      `json:"minRepeatCount,omitempty,omitzero"` // The maximum number of times to replay the snapshot (1, if not specified).
	MinDuration    float64    `json:"minDuration,omitempty,omitzero"`    // The minimum duration (in seconds) to replay the snapshot.
	ClipRect       *dom.Rect  `json:"clipRect,omitempty,omitzero"`       // The clip rectangle to apply when replaying the snapshot.
}

ProfileSnapshotParams are the parameters of the command LayerTree.profileSnapshot.

type ProfileSnapshotResult added in v0.157.3

type ProfileSnapshotResult struct {
	Timings []PaintProfile `json:"timings,omitempty,omitzero"` // The array of paint profiles, one per run.
}

ProfileSnapshotResult is the result of the command LayerTree.profileSnapshot.

type ReleaseSnapshotParams

type ReleaseSnapshotParams struct {
	SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot.
}

ReleaseSnapshotParams are the parameters of the command LayerTree.releaseSnapshot.

type ReplaySnapshotParams

type ReplaySnapshotParams struct {
	SnapshotID SnapshotID `json:"snapshotId"`                  // The id of the layer snapshot.
	FromStep   int64      `json:"fromStep,omitempty,omitzero"` // The first step to replay from (replay from the very start if not specified).
	ToStep     *int64     `json:"toStep,omitempty,omitzero"`   // The last step to replay to (replay till the end if not specified).
	Scale      float64    `json:"scale,omitempty,omitzero"`    // The scale to apply while replaying (defaults to 1).
}

ReplaySnapshotParams are the parameters of the command LayerTree.replaySnapshot.

type ReplaySnapshotResult added in v0.157.3

type ReplaySnapshotResult struct {
	DataURL string `json:"dataURL,omitempty,omitzero"` // A data: URL for resulting image.
}

ReplaySnapshotResult is the result of the command LayerTree.replaySnapshot.

type ScrollRect

type ScrollRect struct {
	Rect *dom.Rect      `json:"rect"` // Rectangle itself.
	Type ScrollRectType `json:"type"` // Reason for rectangle to force scrolling on the main thread
}

ScrollRect rectangle where scrolling happens on the main thread.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-ScrollRect

type ScrollRectType added in v0.157.1

type ScrollRectType string

ScrollRectType reason for rectangle to force scrolling on the main thread.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-ScrollRect

const (
	ScrollRectTypeRepaintsOnScroll  ScrollRectType = "RepaintsOnScroll"
	ScrollRectTypeTouchEventHandler ScrollRectType = "TouchEventHandler"
	ScrollRectTypeWheelEventHandler ScrollRectType = "WheelEventHandler"
)

ScrollRectType values.

func (ScrollRectType) String added in v0.157.1

func (t ScrollRectType) String() string

String returns the ScrollRectType as string value.

type SnapshotCommandLogParams

type SnapshotCommandLogParams struct {
	SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot.
}

SnapshotCommandLogParams are the parameters of the command LayerTree.snapshotCommandLog.

type SnapshotCommandLogResult added in v0.157.3

type SnapshotCommandLogResult struct {
	CommandLog []jsonv2.Value `json:"commandLog,omitempty,omitzero"` // The array of canvas function calls.
}

SnapshotCommandLogResult is the result of the command LayerTree.snapshotCommandLog.

type SnapshotID

type SnapshotID string

SnapshotID unique snapshot identifier.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-SnapshotId

func (SnapshotID) String

func (t SnapshotID) String() string

String returns the SnapshotID as string value.

type StickyPositionConstraint

type StickyPositionConstraint struct {
	StickyBoxRect                       *dom.Rect `json:"stickyBoxRect"`                                          // Layout rectangle of the sticky element before being shifted
	ContainingBlockRect                 *dom.Rect `json:"containingBlockRect"`                                    // Layout rectangle of the containing block of the sticky element
	NearestLayerShiftingStickyBox       LayerID   `json:"nearestLayerShiftingStickyBox,omitempty,omitzero"`       // The nearest sticky layer that shifts the sticky box
	NearestLayerShiftingContainingBlock LayerID   `json:"nearestLayerShiftingContainingBlock,omitempty,omitzero"` // The nearest sticky layer that shifts the containing block
}

StickyPositionConstraint sticky position constraints.

See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#type-StickyPositionConstraint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL