-
Notifications
You must be signed in to change notification settings - Fork 48
/
types.go
60 lines (51 loc) · 4.02 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Code generated by cdpgen. DO NOT EDIT.
package layertree
import (
"github.com/mafredri/cdp/protocol/dom"
)
// LayerID Unique Layer identifier.
type LayerID string
// SnapshotID Unique snapshot identifier.
type SnapshotID string
// ScrollRect Rectangle where scrolling happens on the main thread.
type ScrollRect struct {
Rect dom.Rect `json:"rect"` // Rectangle itself.
// Type Reason for rectangle to force scrolling on the main thread
//
// Values: "RepaintsOnScroll", "TouchEventHandler", "WheelEventHandler".
Type string `json:"type"`
}
// StickyPositionConstraint Sticky position constraints.
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"` // The nearest sticky layer that shifts the sticky box
NearestLayerShiftingContainingBlock *LayerID `json:"nearestLayerShiftingContainingBlock,omitempty"` // The nearest sticky layer that shifts the containing block
}
// PictureTile Serialized fragment of layer picture along with its offset within the layer.
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.
}
// Layer Information about a compositing layer.
type Layer struct {
LayerID LayerID `json:"layerId"` // The unique id for this layer.
ParentLayerID *LayerID `json:"parentLayerId,omitempty"` // The id of parent (not present for root).
BackendNodeID *dom.BackendNodeID `json:"backendNodeId,omitempty"` // 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"` // Transformation matrix for layer, default is identity matrix
AnchorX *float64 `json:"anchorX,omitempty"` // Transform anchor point X, absent if no transform specified
AnchorY *float64 `json:"anchorY,omitempty"` // Transform anchor point Y, absent if no transform specified
AnchorZ *float64 `json:"anchorZ,omitempty"` // Transform anchor point Z, absent if no transform specified
PaintCount int `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,omitempty"` // Set if layer is not visible.
ScrollRects []ScrollRect `json:"scrollRects,omitempty"` // Rectangles scrolling on main thread only.
StickyPositionConstraint *StickyPositionConstraint `json:"stickyPositionConstraint,omitempty"` // Sticky position constraint information
}
// PaintProfile Array of timings, one per paint step.
type PaintProfile []float64