Documentation
¶
Overview ¶
Package tree provides type definitions for use with the Chrome LayerTree protocol
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/
Index ¶
- Variables
- type CompositingReasonsParams
- type CompositingReasonsResult
- type DidChangeEvent
- type DisableResult
- type EnableResult
- type Layer
- type LayerID
- type LayerPaintedEvent
- type LoadSnapshotParams
- type LoadSnapshotResult
- type MakeSnapshotParams
- type MakeSnapshotResult
- type PaintProfile
- type PictureTile
- type ProfileSnapshotParams
- type ProfileSnapshotResult
- type RectTypeEnum
- type ReleaseSnapshotParams
- type ReleaseSnapshotResult
- type ReplaySnapshotParams
- type ReplaySnapshotResult
- type ScrollRect
- type SnapshotCommandLogParams
- type SnapshotCommandLogResult
- type SnapshotID
- type StickyPositionConstraint
Constants ¶
This section is empty.
Variables ¶
var RectType = rectTypeEnum{
RepaintsOnScroll: rectTypeRepaintsOnScroll,
TouchEventHandler: rectTypeTouchEventHandler,
WheelEventHandler: rectTypeWheelEventHandler,
}
RectType provides named acces to the RectTypeEnum values.
Functions ¶
This section is empty.
Types ¶
type CompositingReasonsParams ¶
type CompositingReasonsParams struct { // The ID of the layer for which we want to get the reasons it was // composited. LayerID LayerID `json:"layerId"` }
CompositingReasonsParams represents LayerTree.compositingReasons parameters.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-compositingReasons
type CompositingReasonsResult ¶
type CompositingReasonsResult struct { // A list of strings specifying reasons for the given layer to become // composited. CompositingReasons []string `json:"compositingReasons"` // Error information related to executing this method Err error `json:"-"` }
CompositingReasonsResult represents the result of calls to LayerTree.compositingReasons.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-compositingReasons
type DidChangeEvent ¶
type DidChangeEvent struct { // Optional. Layer tree, absent if not in the comspositing mode. Layers []*Layer `json:"layers,omitempty"` // Error information related to this event Err error `json:"-"` }
DidChangeEvent represents LayerTree.layerTreeDidChange event data.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#event-layerTreeDidChange
type DisableResult ¶
type DisableResult struct { // Error information related to executing this method Err error `json:"-"` }
DisableResult represents the result of calls to LayerTree.Disable.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-Disable
type EnableResult ¶
type EnableResult struct { // Error information related to executing this method Err error `json:"-"` }
EnableResult represents the result of calls to LayerTree.enable.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-enable
type Layer ¶
type Layer struct { // The unique ID for this layer. LayerID LayerID `json:"layerId"` // Optional. The ID of parent (not present for root). ParentLayerID LayerID `json:"parentLayerId,omitempty"` // Optional. The backend ID for the node associated with this layer. BackendNodeID dom.BackendNodeID `json:"backendNodeId,omitempty"` // Offset from parent layer, X coordinate. OffsetX float64 `json:"offsetX"` // Offset from parent layer, Y coordinate. OffsetY float64 `json:"offsetY"` // Layer width. Width float64 `json:"width"` // Layer height. Height float64 `json:"height"` // Optional. Transformation matrix for layer, default is identity matrix. Transform []float64 `json:"transform,omitempty"` // Optional. Transform anchor point X, absent if no transform specified. AnchorX float64 `json:"anchorX,omitempty"` // Optional. Transform anchor point Y, absent if no transform specified. AnchorY float64 `json:"anchorY,omitempty"` // Optional. Transform anchor point Z, absent if no transform specified. AnchorZ float64 `json:"anchorZ,omitempty"` // Indicates how many time this layer has painted. PaintCount int `json:"paintCount"` // Indicates whether this layer hosts any content, rather than being used // for transform/scrolling purposes only. DrawsContent bool `json:"drawsContent"` // Optional. Set if layer is not visible. Invisible bool `json:"invisible,omitempty"` // Optional. Rectangles scrolling on main thread only. ScrollRects []*ScrollRect `json:"scrollRects,omitempty"` // Optional. Sticky position constraint information. StickyPositionConstraint *StickyPositionConstraint `json:"stickyPositionConstraint,omitempty"` }
Layer is information about a compositing layer.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-Layer
type LayerID ¶
type LayerID string
LayerID is a unique Layer identifier.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-LayerId
type LayerPaintedEvent ¶
type LayerPaintedEvent struct { // The ID of the painted layer. LayerID LayerID `json:"layerId"` // Clip rectangle. Clip *dom.Rect `json:"clip"` // Error information related to this event Err error `json:"-"` }
LayerPaintedEvent represents LayerTree.layerPainted event data.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#event-layerPainted
type LoadSnapshotParams ¶
type LoadSnapshotParams struct { // An array of tiles composing the snapshot. Tiles []*PictureTile `json:"tiles"` }
LoadSnapshotParams represents LayerTree.loadSnapshot parameters.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-loadSnapshot
type LoadSnapshotResult ¶
type LoadSnapshotResult struct { // The ID of the snapshot. SnapshotID SnapshotID `json:"snapshotId"` // Error information related to executing this method Err error `json:"-"` }
LoadSnapshotResult represents the result of calls to LayerTree.loadSnapshot.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-loadSnapshot
type MakeSnapshotParams ¶
type MakeSnapshotParams struct { // The ID of the layer. LayerID LayerID `json:"layerId"` }
MakeSnapshotParams represents LayerTree.makeSnapshot parameters.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-makeSnapshot
type MakeSnapshotResult ¶
type MakeSnapshotResult struct { // The ID of the layer snapshot. SnapshotID SnapshotID `json:"snapshotId"` // Error information related to executing this method Err error `json:"-"` }
MakeSnapshotResult represents the result of calls to LayerTree.makeSnapshot.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-makeSnapshot
type PaintProfile ¶
type PaintProfile []interface{}
PaintProfile is an array of timings, one per paint step.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-PaintProfile
type PictureTile ¶
type PictureTile struct { // Offset from owning layer left boundary. X float64 `json:"x"` // Offset from owning layer top boundary. Y float64 `json:"y"` // Base64-encoded snapshot data. Picture string `json:"picture"` }
PictureTile is a serialized fragment of layer picture along with its offset within the layer.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-PictureTile
type ProfileSnapshotParams ¶
type ProfileSnapshotParams struct { // The ID of the layer snapshot. SnapshotID SnapshotID `json:"snapshotId"` // Optional. The maximum number of times to replay the snapshot (1, if not // specified). MinRepeatCount int `json:"minRepeatCount,omitempty"` // Optional. The minimum duration (in seconds) to replay the snapshot. MinDuration float64 `json:"minDuration,omitempty"` // Optional. The clip rectangle to apply when replaying the snapshot. ClipRect *dom.Rect `json:"clipRect,omitempty"` }
ProfileSnapshotParams represents LayerTree.profileSnapshot parameters.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-profileSnapshot
type ProfileSnapshotResult ¶
type ProfileSnapshotResult struct { // The array of paint profiles, one per run. Timings []*PaintProfile `json:"timings"` // Error information related to executing this method Err error `json:"-"` }
ProfileSnapshotResult represents the result of calls to LayerTree.profileSnapshot.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-profileSnapshot
type RectTypeEnum ¶
type RectTypeEnum int
RectTypeEnum represents the reason for a rectangle to force scrolling on the main thread. Allowed values:
- RectType.RepaintsOnScroll "RepaintsOnScroll"
- RectType.TouchEventHandler "TouchEventHandler"
- RectType.WheelEventHandler "WheelEventHandler"
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-ScrollRect
func (RectTypeEnum) MarshalJSON ¶
func (enum RectTypeEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*RectTypeEnum) UnmarshalJSON ¶
func (enum *RectTypeEnum) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler
type ReleaseSnapshotParams ¶
type ReleaseSnapshotParams struct { // The ID of the layer snapshot. SnapshotID SnapshotID `json:"snapshotId"` }
ReleaseSnapshotParams represents LayerTree.releaseSnapshot parameters.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-releaseSnapshot
type ReleaseSnapshotResult ¶
type ReleaseSnapshotResult struct { // Error information related to executing this method Err error `json:"-"` }
ReleaseSnapshotResult represents the result of calls to LayerTree.releaseSnapshot.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-releaseSnapshot
type ReplaySnapshotParams ¶
type ReplaySnapshotParams struct { // The ID of the layer snapshot. SnapshotID SnapshotID `json:"snapshotId"` // Optional. The first step to replay from (replay from the very start if // not specified). FromStep int `json:"fromStep,omitempty"` // Optional. The last step to replay to (replay till the end if not specified). ToStep int `json:"toStep,omitempty"` // Optional. The scale to apply while replaying (defaults to 1). Scale float64 `json:"scale,omitempty"` }
ReplaySnapshotParams represents LayerTree.replaySnapshot parameters.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-replaySnapshot
type ReplaySnapshotResult ¶
type ReplaySnapshotResult struct { // A data: URL for resulting image. DataURL string `json:"dataURL"` // Error information related to executing this method Err error `json:"-"` }
ReplaySnapshotResult represents the result of calls to LayerTree.replaySnapshot.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-replaySnapshot
type ScrollRect ¶
type ScrollRect struct { // Rectangle itself. Rect *dom.Rect `json:"rect"` // Reason for rectangle to force scrolling on the main thread. Allowed // values: // - RectType.RepaintsOnScroll // - RectType.TouchEventHandler // - RectType.WheelEventHandler Type RectTypeEnum `json:"type"` }
ScrollRect is a rectangle where scrolling happens on the main thread.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-ScrollRect
type SnapshotCommandLogParams ¶
type SnapshotCommandLogParams struct { // The ID of the layer snapshot. SnapshotID SnapshotID `json:"snapshotId"` }
SnapshotCommandLogParams represents LayerTree.snapshotCommandLog parameters.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-snapshotCommandLog
type SnapshotCommandLogResult ¶
type SnapshotCommandLogResult struct { // The array of canvas function calls. CommandLog []map[string]string `json:"commandLog"` // Error information related to executing this method Err error `json:"-"` }
SnapshotCommandLogResult represents the result of calls to LayerTree.snapshotCommandLog.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#method-snapshotCommandLog
type SnapshotID ¶
type SnapshotID string
SnapshotID is a unique snapshot identifier.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-SnapshotId
type StickyPositionConstraint ¶
type StickyPositionConstraint struct { // Layout rectangle of the sticky element before being shifted. StickyBoxRect *dom.Rect `json:"stickyBoxRect"` // Layout rectangle of the containing block of the sticky element. ContainingBlockRect *dom.Rect `json:"containingBlockRect"` // Optional. The nearest sticky layer that shifts the sticky box. NearestLayerShiftingStickyBox LayerID `json:"nearestLayerShiftingStickyBox,omitempty"` // Optional. The nearest sticky layer that shifts the containing block. NearestLayerShiftingContainingBlock LayerID `json:"nearestLayerShiftingContainingBlock,omitempty"` }
StickyPositionConstraint is sticky position constraints.
https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/#type-StickyPositionConstraint