vendor/github.com/go-rod/rod/lib/proto/layer_tree.go
332 lines · 11235 bytes
1// This file is generated by "./lib/proto/generate"
2
3package proto
4
5import (
6 "github.com/ysmood/gson"
7)
8
9/*
10
11LayerTree
12
13*/
14
15// LayerTreeLayerID Unique Layer identifier.
16type LayerTreeLayerID string
17
18// LayerTreeSnapshotID Unique snapshot identifier.
19type LayerTreeSnapshotID string
20
21// LayerTreeScrollRectType enum.
22type LayerTreeScrollRectType string
23
24const (
25 // LayerTreeScrollRectTypeRepaintsOnScroll enum const.
26 LayerTreeScrollRectTypeRepaintsOnScroll LayerTreeScrollRectType = "RepaintsOnScroll"
27
28 // LayerTreeScrollRectTypeTouchEventHandler enum const.
29 LayerTreeScrollRectTypeTouchEventHandler LayerTreeScrollRectType = "TouchEventHandler"
30
31 // LayerTreeScrollRectTypeWheelEventHandler enum const.
32 LayerTreeScrollRectTypeWheelEventHandler LayerTreeScrollRectType = "WheelEventHandler"
33)
34
35// LayerTreeScrollRect Rectangle where scrolling happens on the main thread.
36type LayerTreeScrollRect struct {
37 // Rectangle itself.
38 Rect *DOMRect `json:"rect"`
39
40 // Type Reason for rectangle to force scrolling on the main thread
41 Type LayerTreeScrollRectType `json:"type"`
42}
43
44// LayerTreeStickyPositionConstraint Sticky position constraints.
45type LayerTreeStickyPositionConstraint struct {
46 // StickyBoxRect Layout rectangle of the sticky element before being shifted
47 StickyBoxRect *DOMRect `json:"stickyBoxRect"`
48
49 // ContainingBlockRect Layout rectangle of the containing block of the sticky element
50 ContainingBlockRect *DOMRect `json:"containingBlockRect"`
51
52 // NearestLayerShiftingStickyBox (optional) The nearest sticky layer that shifts the sticky box
53 NearestLayerShiftingStickyBox LayerTreeLayerID `json:"nearestLayerShiftingStickyBox,omitempty"`
54
55 // NearestLayerShiftingContainingBlock (optional) The nearest sticky layer that shifts the containing block
56 NearestLayerShiftingContainingBlock LayerTreeLayerID `json:"nearestLayerShiftingContainingBlock,omitempty"`
57}
58
59// LayerTreePictureTile Serialized fragment of layer picture along with its offset within the layer.
60type LayerTreePictureTile struct {
61 // X Offset from owning layer left boundary
62 X float64 `json:"x"`
63
64 // Y Offset from owning layer top boundary
65 Y float64 `json:"y"`
66
67 // Picture Base64-encoded snapshot data.
68 Picture []byte `json:"picture"`
69}
70
71// LayerTreeLayer Information about a compositing layer.
72type LayerTreeLayer struct {
73 // LayerID The unique id for this layer.
74 LayerID LayerTreeLayerID `json:"layerId"`
75
76 // ParentLayerID (optional) The id of parent (not present for root).
77 ParentLayerID LayerTreeLayerID `json:"parentLayerId,omitempty"`
78
79 // BackendNodeID (optional) The backend id for the node associated with this layer.
80 BackendNodeID DOMBackendNodeID `json:"backendNodeId,omitempty"`
81
82 // OffsetX Offset from parent layer, X coordinate.
83 OffsetX float64 `json:"offsetX"`
84
85 // OffsetY Offset from parent layer, Y coordinate.
86 OffsetY float64 `json:"offsetY"`
87
88 // Width Layer width.
89 Width float64 `json:"width"`
90
91 // Height Layer height.
92 Height float64 `json:"height"`
93
94 // Transform (optional) Transformation matrix for layer, default is identity matrix
95 Transform []float64 `json:"transform,omitempty"`
96
97 // AnchorX (optional) Transform anchor point X, absent if no transform specified
98 AnchorX *float64 `json:"anchorX,omitempty"`
99
100 // AnchorY (optional) Transform anchor point Y, absent if no transform specified
101 AnchorY *float64 `json:"anchorY,omitempty"`
102
103 // AnchorZ (optional) Transform anchor point Z, absent if no transform specified
104 AnchorZ *float64 `json:"anchorZ,omitempty"`
105
106 // PaintCount Indicates how many time this layer has painted.
107 PaintCount int `json:"paintCount"`
108
109 // DrawsContent Indicates whether this layer hosts any content, rather than being used for
110 // transform/scrolling purposes only.
111 DrawsContent bool `json:"drawsContent"`
112
113 // Invisible (optional) Set if layer is not visible.
114 Invisible bool `json:"invisible,omitempty"`
115
116 // ScrollRects (optional) Rectangles scrolling on main thread only.
117 ScrollRects []*LayerTreeScrollRect `json:"scrollRects,omitempty"`
118
119 // StickyPositionConstraint (optional) Sticky position constraint information
120 StickyPositionConstraint *LayerTreeStickyPositionConstraint `json:"stickyPositionConstraint,omitempty"`
121}
122
123// LayerTreePaintProfile Array of timings, one per paint step.
124type LayerTreePaintProfile []float64
125
126// LayerTreeCompositingReasons Provides the reasons why the given layer was composited.
127type LayerTreeCompositingReasons struct {
128 // LayerID The id of the layer for which we want to get the reasons it was composited.
129 LayerID LayerTreeLayerID `json:"layerId"`
130}
131
132// ProtoReq name.
133func (m LayerTreeCompositingReasons) ProtoReq() string { return "LayerTree.compositingReasons" }
134
135// Call the request.
136func (m LayerTreeCompositingReasons) Call(c Client) (*LayerTreeCompositingReasonsResult, error) {
137 var res LayerTreeCompositingReasonsResult
138 return &res, call(m.ProtoReq(), m, &res, c)
139}
140
141// LayerTreeCompositingReasonsResult ...
142type LayerTreeCompositingReasonsResult struct {
143 // CompositingReasons A list of strings specifying reasons for the given layer to become composited.
144 CompositingReasons []string `json:"compositingReasons"`
145
146 // CompositingReasonIDs A list of strings specifying reason IDs for the given layer to become composited.
147 CompositingReasonIDs []string `json:"compositingReasonIds"`
148}
149
150// LayerTreeDisable Disables compositing tree inspection.
151type LayerTreeDisable struct{}
152
153// ProtoReq name.
154func (m LayerTreeDisable) ProtoReq() string { return "LayerTree.disable" }
155
156// Call sends the request.
157func (m LayerTreeDisable) Call(c Client) error {
158 return call(m.ProtoReq(), m, nil, c)
159}
160
161// LayerTreeEnable Enables compositing tree inspection.
162type LayerTreeEnable struct{}
163
164// ProtoReq name.
165func (m LayerTreeEnable) ProtoReq() string { return "LayerTree.enable" }
166
167// Call sends the request.
168func (m LayerTreeEnable) Call(c Client) error {
169 return call(m.ProtoReq(), m, nil, c)
170}
171
172// LayerTreeLoadSnapshot Returns the snapshot identifier.
173type LayerTreeLoadSnapshot struct {
174 // Tiles An array of tiles composing the snapshot.
175 Tiles []*LayerTreePictureTile `json:"tiles"`
176}
177
178// ProtoReq name.
179func (m LayerTreeLoadSnapshot) ProtoReq() string { return "LayerTree.loadSnapshot" }
180
181// Call the request.
182func (m LayerTreeLoadSnapshot) Call(c Client) (*LayerTreeLoadSnapshotResult, error) {
183 var res LayerTreeLoadSnapshotResult
184 return &res, call(m.ProtoReq(), m, &res, c)
185}
186
187// LayerTreeLoadSnapshotResult ...
188type LayerTreeLoadSnapshotResult struct {
189 // SnapshotID The id of the snapshot.
190 SnapshotID LayerTreeSnapshotID `json:"snapshotId"`
191}
192
193// LayerTreeMakeSnapshot Returns the layer snapshot identifier.
194type LayerTreeMakeSnapshot struct {
195 // LayerID The id of the layer.
196 LayerID LayerTreeLayerID `json:"layerId"`
197}
198
199// ProtoReq name.
200func (m LayerTreeMakeSnapshot) ProtoReq() string { return "LayerTree.makeSnapshot" }
201
202// Call the request.
203func (m LayerTreeMakeSnapshot) Call(c Client) (*LayerTreeMakeSnapshotResult, error) {
204 var res LayerTreeMakeSnapshotResult
205 return &res, call(m.ProtoReq(), m, &res, c)
206}
207
208// LayerTreeMakeSnapshotResult ...
209type LayerTreeMakeSnapshotResult struct {
210 // SnapshotID The id of the layer snapshot.
211 SnapshotID LayerTreeSnapshotID `json:"snapshotId"`
212}
213
214// LayerTreeProfileSnapshot ...
215type LayerTreeProfileSnapshot struct {
216 // SnapshotID The id of the layer snapshot.
217 SnapshotID LayerTreeSnapshotID `json:"snapshotId"`
218
219 // MinRepeatCount (optional) The maximum number of times to replay the snapshot (1, if not specified).
220 MinRepeatCount *int `json:"minRepeatCount,omitempty"`
221
222 // MinDuration (optional) The minimum duration (in seconds) to replay the snapshot.
223 MinDuration *float64 `json:"minDuration,omitempty"`
224
225 // ClipRect (optional) The clip rectangle to apply when replaying the snapshot.
226 ClipRect *DOMRect `json:"clipRect,omitempty"`
227}
228
229// ProtoReq name.
230func (m LayerTreeProfileSnapshot) ProtoReq() string { return "LayerTree.profileSnapshot" }
231
232// Call the request.
233func (m LayerTreeProfileSnapshot) Call(c Client) (*LayerTreeProfileSnapshotResult, error) {
234 var res LayerTreeProfileSnapshotResult
235 return &res, call(m.ProtoReq(), m, &res, c)
236}
237
238// LayerTreeProfileSnapshotResult ...
239type LayerTreeProfileSnapshotResult struct {
240 // Timings The array of paint profiles, one per run.
241 Timings []LayerTreePaintProfile `json:"timings"`
242}
243
244// LayerTreeReleaseSnapshot Releases layer snapshot captured by the back-end.
245type LayerTreeReleaseSnapshot struct {
246 // SnapshotID The id of the layer snapshot.
247 SnapshotID LayerTreeSnapshotID `json:"snapshotId"`
248}
249
250// ProtoReq name.
251func (m LayerTreeReleaseSnapshot) ProtoReq() string { return "LayerTree.releaseSnapshot" }
252
253// Call sends the request.
254func (m LayerTreeReleaseSnapshot) Call(c Client) error {
255 return call(m.ProtoReq(), m, nil, c)
256}
257
258// LayerTreeReplaySnapshot Replays the layer snapshot and returns the resulting bitmap.
259type LayerTreeReplaySnapshot struct {
260 // SnapshotID The id of the layer snapshot.
261 SnapshotID LayerTreeSnapshotID `json:"snapshotId"`
262
263 // FromStep (optional) The first step to replay from (replay from the very start if not specified).
264 FromStep *int `json:"fromStep,omitempty"`
265
266 // ToStep (optional) The last step to replay to (replay till the end if not specified).
267 ToStep *int `json:"toStep,omitempty"`
268
269 // Scale (optional) The scale to apply while replaying (defaults to 1).
270 Scale *float64 `json:"scale,omitempty"`
271}
272
273// ProtoReq name.
274func (m LayerTreeReplaySnapshot) ProtoReq() string { return "LayerTree.replaySnapshot" }
275
276// Call the request.
277func (m LayerTreeReplaySnapshot) Call(c Client) (*LayerTreeReplaySnapshotResult, error) {
278 var res LayerTreeReplaySnapshotResult
279 return &res, call(m.ProtoReq(), m, &res, c)
280}
281
282// LayerTreeReplaySnapshotResult ...
283type LayerTreeReplaySnapshotResult struct {
284 // DataURL A data: URL for resulting image.
285 DataURL string `json:"dataURL"`
286}
287
288// LayerTreeSnapshotCommandLog Replays the layer snapshot and returns canvas log.
289type LayerTreeSnapshotCommandLog struct {
290 // SnapshotID The id of the layer snapshot.
291 SnapshotID LayerTreeSnapshotID `json:"snapshotId"`
292}
293
294// ProtoReq name.
295func (m LayerTreeSnapshotCommandLog) ProtoReq() string { return "LayerTree.snapshotCommandLog" }
296
297// Call the request.
298func (m LayerTreeSnapshotCommandLog) Call(c Client) (*LayerTreeSnapshotCommandLogResult, error) {
299 var res LayerTreeSnapshotCommandLogResult
300 return &res, call(m.ProtoReq(), m, &res, c)
301}
302
303// LayerTreeSnapshotCommandLogResult ...
304type LayerTreeSnapshotCommandLogResult struct {
305 // CommandLog The array of canvas function calls.
306 CommandLog []map[string]gson.JSON `json:"commandLog"`
307}
308
309// LayerTreeLayerPainted ...
310type LayerTreeLayerPainted struct {
311 // LayerID The id of the painted layer.
312 LayerID LayerTreeLayerID `json:"layerId"`
313
314 // Clip rectangle.
315 Clip *DOMRect `json:"clip"`
316}
317
318// ProtoEvent name.
319func (evt LayerTreeLayerPainted) ProtoEvent() string {
320 return "LayerTree.layerPainted"
321}
322
323// LayerTreeLayerTreeDidChange ...
324type LayerTreeLayerTreeDidChange struct {
325 // Layers (optional) Layer tree, absent if not in the compositing mode.
326 Layers []*LayerTreeLayer `json:"layers,omitempty"`
327}
328
329// ProtoEvent name.
330func (evt LayerTreeLayerTreeDidChange) ProtoEvent() string {
331 return "LayerTree.layerTreeDidChange"
332}