1#![allow(dead_code)]
3use super::dom;
4use super::dom_debugger;
5use super::page;
6#[allow(unused_imports)]
7use super::types::*;
8#[allow(unused_imports)]
9use derive_builder::Builder;
10#[allow(unused_imports)]
11use serde::{Deserialize, Serialize};
12#[allow(unused_imports)]
13use serde_json::Value as Json;
14pub type StringIndex = JsUInt;
15pub type ArrayOfStrings = Vec<StringIndex>;
16pub type Rectangle = Vec<JsFloat>;
17#[allow(deprecated)]
18#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
19#[builder(setter(into, strip_option))]
20#[serde(rename_all = "camelCase")]
21#[doc = "A Node in the DOM tree."]
22pub struct DomNode {
23 #[serde(default)]
24 #[doc = "`Node`'s nodeType."]
25 pub node_type: JsUInt,
26 #[serde(default)]
27 #[doc = "`Node`'s nodeName."]
28 pub node_name: String,
29 #[serde(default)]
30 #[doc = "`Node`'s nodeValue."]
31 pub node_value: String,
32 #[builder(default)]
33 #[serde(skip_serializing_if = "Option::is_none")]
34 #[serde(default)]
35 #[doc = "Only set for textarea elements, contains the text value."]
36 pub text_value: Option<String>,
37 #[builder(default)]
38 #[serde(skip_serializing_if = "Option::is_none")]
39 #[serde(default)]
40 #[doc = "Only set for input elements, contains the input's associated text value."]
41 pub input_value: Option<String>,
42 #[builder(default)]
43 #[serde(skip_serializing_if = "Option::is_none")]
44 #[serde(default)]
45 #[doc = "Only set for radio and checkbox input elements, indicates if the element has been checked"]
46 pub input_checked: Option<bool>,
47 #[builder(default)]
48 #[serde(skip_serializing_if = "Option::is_none")]
49 #[serde(default)]
50 #[doc = "Only set for option elements, indicates if the element has been selected"]
51 pub option_selected: Option<bool>,
52 #[doc = "`Node`'s id, corresponds to DOM.Node.backendNodeId."]
53 pub backend_node_id: dom::BackendNodeId,
54 #[builder(default)]
55 #[serde(skip_serializing_if = "Option::is_none")]
56 #[serde(default)]
57 #[doc = "The indexes of the node's child nodes in the `domNodes` array returned by `getSnapshot`, if\n any."]
58 pub child_node_indexes: Option<Vec<JsUInt>>,
59 #[builder(default)]
60 #[serde(skip_serializing_if = "Option::is_none")]
61 #[doc = "Attributes of an `Element` node."]
62 pub attributes: Option<Vec<NameValue>>,
63 #[builder(default)]
64 #[serde(skip_serializing_if = "Option::is_none")]
65 #[serde(default)]
66 #[doc = "Indexes of pseudo elements associated with this node in the `domNodes` array returned by\n `getSnapshot`, if any."]
67 pub pseudo_element_indexes: Option<Vec<JsUInt>>,
68 #[builder(default)]
69 #[serde(skip_serializing_if = "Option::is_none")]
70 #[serde(default)]
71 #[doc = "The index of the node's related layout tree node in the `layoutTreeNodes` array returned by\n `getSnapshot`, if any."]
72 pub layout_node_index: Option<JsUInt>,
73 #[builder(default)]
74 #[serde(skip_serializing_if = "Option::is_none")]
75 #[serde(default)]
76 #[doc = "Document URL that `Document` or `FrameOwner` node points to."]
77 #[serde(rename = "documentURL")]
78 pub document_url: Option<String>,
79 #[builder(default)]
80 #[serde(skip_serializing_if = "Option::is_none")]
81 #[serde(default)]
82 #[doc = "Base URL that `Document` or `FrameOwner` node uses for URL completion."]
83 #[serde(rename = "baseURL")]
84 pub base_url: Option<String>,
85 #[builder(default)]
86 #[serde(skip_serializing_if = "Option::is_none")]
87 #[serde(default)]
88 #[doc = "Only set for documents, contains the document's content language."]
89 pub content_language: Option<String>,
90 #[builder(default)]
91 #[serde(skip_serializing_if = "Option::is_none")]
92 #[serde(default)]
93 #[doc = "Only set for documents, contains the document's character set encoding."]
94 pub document_encoding: Option<String>,
95 #[builder(default)]
96 #[serde(skip_serializing_if = "Option::is_none")]
97 #[serde(default)]
98 #[doc = "`DocumentType` node's publicId."]
99 pub public_id: Option<String>,
100 #[builder(default)]
101 #[serde(skip_serializing_if = "Option::is_none")]
102 #[serde(default)]
103 #[doc = "`DocumentType` node's systemId."]
104 pub system_id: Option<String>,
105 #[builder(default)]
106 #[serde(skip_serializing_if = "Option::is_none")]
107 #[doc = "Frame ID for frame owner elements and also for the document node."]
108 pub frame_id: Option<page::FrameId>,
109 #[builder(default)]
110 #[serde(skip_serializing_if = "Option::is_none")]
111 #[serde(default)]
112 #[doc = "The index of a frame owner element's content document in the `domNodes` array returned by\n `getSnapshot`, if any."]
113 pub content_document_index: Option<JsUInt>,
114 #[builder(default)]
115 #[serde(skip_serializing_if = "Option::is_none")]
116 #[doc = "Type of a pseudo element node."]
117 pub pseudo_type: Option<dom::PseudoType>,
118 #[builder(default)]
119 #[serde(skip_serializing_if = "Option::is_none")]
120 #[doc = "Shadow root type."]
121 pub shadow_root_type: Option<dom::ShadowRootType>,
122 #[builder(default)]
123 #[serde(skip_serializing_if = "Option::is_none")]
124 #[serde(default)]
125 #[doc = "Whether this DOM node responds to mouse clicks. This includes nodes that have had click\n event listeners attached via JavaScript as well as anchor tags that naturally navigate when\n clicked."]
126 pub is_clickable: Option<bool>,
127 #[builder(default)]
128 #[serde(skip_serializing_if = "Option::is_none")]
129 #[doc = "Details of the node's event listeners, if any."]
130 pub event_listeners: Option<Vec<dom_debugger::EventListener>>,
131 #[builder(default)]
132 #[serde(skip_serializing_if = "Option::is_none")]
133 #[serde(default)]
134 #[doc = "The selected url for nodes with a srcset attribute."]
135 #[serde(rename = "currentSourceURL")]
136 pub current_source_url: Option<String>,
137 #[builder(default)]
138 #[serde(skip_serializing_if = "Option::is_none")]
139 #[serde(default)]
140 #[doc = "The url of the script (if any) that generates this node."]
141 #[serde(rename = "originURL")]
142 pub origin_url: Option<String>,
143 #[builder(default)]
144 #[serde(skip_serializing_if = "Option::is_none")]
145 #[serde(default)]
146 #[doc = "Scroll offsets, set when this node is a Document."]
147 pub scroll_offset_x: Option<JsFloat>,
148 #[builder(default)]
149 #[serde(skip_serializing_if = "Option::is_none")]
150 #[serde(default)]
151 pub scroll_offset_y: Option<JsFloat>,
152}
153#[allow(deprecated)]
154#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
155#[builder(setter(into, strip_option))]
156#[serde(rename_all = "camelCase")]
157#[doc = "Details of post layout rendered text positions. The exact layout should not be regarded as\n stable and may change between versions."]
158pub struct InlineTextBox {
159 #[doc = "The bounding box in document coordinates. Note that scroll offset of the document is ignored."]
160 pub bounding_box: dom::Rect,
161 #[serde(default)]
162 #[doc = "The starting index in characters, for this post layout textbox substring. Characters that\n would be represented as a surrogate pair in UTF-16 have length 2."]
163 pub start_character_index: JsUInt,
164 #[serde(default)]
165 #[doc = "The number of characters in this post layout textbox substring. Characters that would be\n represented as a surrogate pair in UTF-16 have length 2."]
166 pub num_characters: JsUInt,
167}
168#[allow(deprecated)]
169#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
170#[builder(setter(into, strip_option))]
171#[serde(rename_all = "camelCase")]
172#[doc = "Details of an element in the DOM tree with a LayoutObject."]
173pub struct LayoutTreeNode {
174 #[serde(default)]
175 #[doc = "The index of the related DOM node in the `domNodes` array returned by `getSnapshot`."]
176 pub dom_node_index: JsUInt,
177 #[doc = "The bounding box in document coordinates. Note that scroll offset of the document is ignored."]
178 pub bounding_box: dom::Rect,
179 #[builder(default)]
180 #[serde(skip_serializing_if = "Option::is_none")]
181 #[serde(default)]
182 #[doc = "Contents of the LayoutText, if any."]
183 pub layout_text: Option<String>,
184 #[builder(default)]
185 #[serde(skip_serializing_if = "Option::is_none")]
186 #[doc = "The post-layout inline text nodes, if any."]
187 pub inline_text_nodes: Option<Vec<InlineTextBox>>,
188 #[builder(default)]
189 #[serde(skip_serializing_if = "Option::is_none")]
190 #[serde(default)]
191 #[doc = "Index into the `computedStyles` array returned by `getSnapshot`."]
192 pub style_index: Option<JsUInt>,
193 #[builder(default)]
194 #[serde(skip_serializing_if = "Option::is_none")]
195 #[serde(default)]
196 #[doc = "Global paint order index, which is determined by the stacking order of the nodes. Nodes\n that are painted together will have the same index. Only provided if includePaintOrder in\n getSnapshot was true."]
197 pub paint_order: Option<JsUInt>,
198 #[builder(default)]
199 #[serde(skip_serializing_if = "Option::is_none")]
200 #[serde(default)]
201 #[doc = "Set to true to indicate the element begins a new stacking context."]
202 pub is_stacking_context: Option<bool>,
203}
204#[allow(deprecated)]
205#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
206#[builder(setter(into, strip_option))]
207#[serde(rename_all = "camelCase")]
208#[doc = "A subset of the full ComputedStyle as defined by the request whitelist."]
209pub struct ComputedStyle {
210 #[doc = "Name/value pairs of computed style properties."]
211 pub properties: Vec<NameValue>,
212}
213#[allow(deprecated)]
214#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
215#[builder(setter(into, strip_option))]
216#[serde(rename_all = "camelCase")]
217#[doc = "A name/value pair."]
218pub struct NameValue {
219 #[serde(default)]
220 #[doc = "Attribute/property name."]
221 pub name: String,
222 #[serde(default)]
223 #[doc = "Attribute/property value."]
224 pub value: String,
225}
226#[allow(deprecated)]
227#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
228#[builder(setter(into, strip_option))]
229#[serde(rename_all = "camelCase")]
230#[doc = "Data that is only present on rare nodes."]
231pub struct RareStringData {
232 #[serde(default)]
233 pub index: Vec<JsUInt>,
234 pub value: Vec<StringIndex>,
235}
236#[allow(deprecated)]
237#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
238#[builder(setter(into, strip_option))]
239#[serde(rename_all = "camelCase")]
240pub struct RareBooleanData {
241 #[serde(default)]
242 pub index: Vec<JsUInt>,
243}
244#[allow(deprecated)]
245#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
246#[builder(setter(into, strip_option))]
247#[serde(rename_all = "camelCase")]
248pub struct RareIntegerData {
249 #[serde(default)]
250 pub index: Vec<JsUInt>,
251 #[serde(default)]
252 pub value: Vec<JsUInt>,
253}
254#[allow(deprecated)]
255#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
256#[builder(setter(into, strip_option))]
257#[serde(rename_all = "camelCase")]
258#[doc = "Document snapshot."]
259pub struct DocumentSnapshot {
260 #[doc = "Document URL that `Document` or `FrameOwner` node points to."]
261 #[serde(rename = "documentURL")]
262 pub document_url: StringIndex,
263 #[doc = "Document title."]
264 pub title: StringIndex,
265 #[doc = "Base URL that `Document` or `FrameOwner` node uses for URL completion."]
266 #[serde(rename = "baseURL")]
267 pub base_url: StringIndex,
268 #[doc = "Contains the document's content language."]
269 pub content_language: StringIndex,
270 #[doc = "Contains the document's character set encoding."]
271 pub encoding_name: StringIndex,
272 #[doc = "`DocumentType` node's publicId."]
273 pub public_id: StringIndex,
274 #[doc = "`DocumentType` node's systemId."]
275 pub system_id: StringIndex,
276 #[doc = "Frame ID for frame owner elements and also for the document node."]
277 pub frame_id: StringIndex,
278 #[doc = "A table with dom nodes."]
279 pub nodes: NodeTreeSnapshot,
280 #[doc = "The nodes in the layout tree."]
281 pub layout: LayoutTreeSnapshot,
282 #[doc = "The post-layout inline text nodes."]
283 pub text_boxes: TextBoxSnapshot,
284 #[builder(default)]
285 #[serde(skip_serializing_if = "Option::is_none")]
286 #[serde(default)]
287 #[doc = "Horizontal scroll offset."]
288 pub scroll_offset_x: Option<JsFloat>,
289 #[builder(default)]
290 #[serde(skip_serializing_if = "Option::is_none")]
291 #[serde(default)]
292 #[doc = "Vertical scroll offset."]
293 pub scroll_offset_y: Option<JsFloat>,
294 #[builder(default)]
295 #[serde(skip_serializing_if = "Option::is_none")]
296 #[serde(default)]
297 #[doc = "Document content width."]
298 pub content_width: Option<JsFloat>,
299 #[builder(default)]
300 #[serde(skip_serializing_if = "Option::is_none")]
301 #[serde(default)]
302 #[doc = "Document content height."]
303 pub content_height: Option<JsFloat>,
304}
305#[allow(deprecated)]
306#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
307#[builder(setter(into, strip_option))]
308#[serde(rename_all = "camelCase")]
309#[doc = "Table containing nodes."]
310pub struct NodeTreeSnapshot {
311 #[builder(default)]
312 #[serde(skip_serializing_if = "Option::is_none")]
313 #[serde(default)]
314 #[doc = "Parent node index."]
315 pub parent_index: Option<Vec<JsUInt>>,
316 #[builder(default)]
317 #[serde(skip_serializing_if = "Option::is_none")]
318 #[serde(default)]
319 #[doc = "`Node`'s nodeType."]
320 pub node_type: Option<Vec<JsUInt>>,
321 #[builder(default)]
322 #[serde(skip_serializing_if = "Option::is_none")]
323 #[doc = "Type of the shadow root the `Node` is in. String values are equal to the `ShadowRootType` enum."]
324 pub shadow_root_type: Option<RareStringData>,
325 #[builder(default)]
326 #[serde(skip_serializing_if = "Option::is_none")]
327 #[doc = "`Node`'s nodeName."]
328 pub node_name: Option<Vec<StringIndex>>,
329 #[builder(default)]
330 #[serde(skip_serializing_if = "Option::is_none")]
331 #[doc = "`Node`'s nodeValue."]
332 pub node_value: Option<Vec<StringIndex>>,
333 #[builder(default)]
334 #[serde(skip_serializing_if = "Option::is_none")]
335 #[doc = "`Node`'s id, corresponds to DOM.Node.backendNodeId."]
336 pub backend_node_id: Option<Vec<dom::BackendNodeId>>,
337 #[builder(default)]
338 #[serde(skip_serializing_if = "Option::is_none")]
339 #[doc = "Attributes of an `Element` node. Flatten name, value pairs."]
340 pub attributes: Option<Vec<ArrayOfStrings>>,
341 #[builder(default)]
342 #[serde(skip_serializing_if = "Option::is_none")]
343 #[doc = "Only set for textarea elements, contains the text value."]
344 pub text_value: Option<RareStringData>,
345 #[builder(default)]
346 #[serde(skip_serializing_if = "Option::is_none")]
347 #[doc = "Only set for input elements, contains the input's associated text value."]
348 pub input_value: Option<RareStringData>,
349 #[builder(default)]
350 #[serde(skip_serializing_if = "Option::is_none")]
351 #[doc = "Only set for radio and checkbox input elements, indicates if the element has been checked"]
352 pub input_checked: Option<RareBooleanData>,
353 #[builder(default)]
354 #[serde(skip_serializing_if = "Option::is_none")]
355 #[doc = "Only set for option elements, indicates if the element has been selected"]
356 pub option_selected: Option<RareBooleanData>,
357 #[builder(default)]
358 #[serde(skip_serializing_if = "Option::is_none")]
359 #[doc = "The index of the document in the list of the snapshot documents."]
360 pub content_document_index: Option<RareIntegerData>,
361 #[builder(default)]
362 #[serde(skip_serializing_if = "Option::is_none")]
363 #[doc = "Type of a pseudo element node."]
364 pub pseudo_type: Option<RareStringData>,
365 #[builder(default)]
366 #[serde(skip_serializing_if = "Option::is_none")]
367 #[doc = "Pseudo element identifier for this node. Only present if there is a\n valid pseudoType."]
368 pub pseudo_identifier: Option<RareStringData>,
369 #[builder(default)]
370 #[serde(skip_serializing_if = "Option::is_none")]
371 #[doc = "Whether this DOM node responds to mouse clicks. This includes nodes that have had click\n event listeners attached via JavaScript as well as anchor tags that naturally navigate when\n clicked."]
372 pub is_clickable: Option<RareBooleanData>,
373 #[builder(default)]
374 #[serde(skip_serializing_if = "Option::is_none")]
375 #[doc = "The selected url for nodes with a srcset attribute."]
376 #[serde(rename = "currentSourceURL")]
377 pub current_source_url: Option<RareStringData>,
378 #[builder(default)]
379 #[serde(skip_serializing_if = "Option::is_none")]
380 #[doc = "The url of the script (if any) that generates this node."]
381 #[serde(rename = "originURL")]
382 pub origin_url: Option<RareStringData>,
383}
384#[allow(deprecated)]
385#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
386#[builder(setter(into, strip_option))]
387#[serde(rename_all = "camelCase")]
388#[doc = "Table of details of an element in the DOM tree with a LayoutObject."]
389pub struct LayoutTreeSnapshot {
390 #[serde(default)]
391 #[doc = "Index of the corresponding node in the `NodeTreeSnapshot` array returned by `captureSnapshot`."]
392 pub node_index: Vec<JsUInt>,
393 #[doc = "Array of indexes specifying computed style strings, filtered according to the `computedStyles` parameter passed to `captureSnapshot`."]
394 pub styles: Vec<ArrayOfStrings>,
395 #[doc = "The absolute position bounding box."]
396 pub bounds: Vec<Rectangle>,
397 #[doc = "Contents of the LayoutText, if any."]
398 pub text: Vec<StringIndex>,
399 #[doc = "Stacking context information."]
400 pub stacking_contexts: RareBooleanData,
401 #[builder(default)]
402 #[serde(skip_serializing_if = "Option::is_none")]
403 #[serde(default)]
404 #[doc = "Global paint order index, which is determined by the stacking order of the nodes. Nodes\n that are painted together will have the same index. Only provided if includePaintOrder in\n captureSnapshot was true."]
405 pub paint_orders: Option<Vec<JsUInt>>,
406 #[builder(default)]
407 #[serde(skip_serializing_if = "Option::is_none")]
408 #[doc = "The offset rect of nodes. Only available when includeDOMRects is set to true"]
409 pub offset_rects: Option<Vec<Rectangle>>,
410 #[builder(default)]
411 #[serde(skip_serializing_if = "Option::is_none")]
412 #[doc = "The scroll rect of nodes. Only available when includeDOMRects is set to true"]
413 pub scroll_rects: Option<Vec<Rectangle>>,
414 #[builder(default)]
415 #[serde(skip_serializing_if = "Option::is_none")]
416 #[doc = "The client rect of nodes. Only available when includeDOMRects is set to true"]
417 pub client_rects: Option<Vec<Rectangle>>,
418 #[builder(default)]
419 #[serde(skip_serializing_if = "Option::is_none")]
420 #[doc = "The list of background colors that are blended with colors of overlapping elements."]
421 pub blended_background_colors: Option<Vec<StringIndex>>,
422 #[builder(default)]
423 #[serde(skip_serializing_if = "Option::is_none")]
424 #[serde(default)]
425 #[doc = "The list of computed text opacities."]
426 pub text_color_opacities: Option<Vec<JsFloat>>,
427}
428#[allow(deprecated)]
429#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
430#[builder(setter(into, strip_option))]
431#[serde(rename_all = "camelCase")]
432#[doc = "Table of details of the post layout rendered text positions. The exact layout should not be regarded as\n stable and may change between versions."]
433pub struct TextBoxSnapshot {
434 #[serde(default)]
435 #[doc = "Index of the layout tree node that owns this box collection."]
436 pub layout_index: Vec<JsUInt>,
437 #[doc = "The absolute position bounding box."]
438 pub bounds: Vec<Rectangle>,
439 #[serde(default)]
440 #[doc = "The starting index in characters, for this post layout textbox substring. Characters that\n would be represented as a surrogate pair in UTF-16 have length 2."]
441 pub start: Vec<JsUInt>,
442 #[serde(default)]
443 #[doc = "The number of characters in this post layout textbox substring. Characters that would be\n represented as a surrogate pair in UTF-16 have length 2."]
444 pub length: Vec<JsUInt>,
445}
446#[allow(deprecated)]
447#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
448pub struct Disable(pub Option<Json>);
449#[allow(deprecated)]
450#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
451pub struct Enable(pub Option<Json>);
452#[allow(deprecated)]
453#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
454#[builder(setter(into, strip_option))]
455#[serde(rename_all = "camelCase")]
456#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
457#[deprecated]
458pub struct GetSnapshot {
459 #[serde(default)]
460 #[doc = "Whitelist of computed styles to return."]
461 pub computed_style_whitelist: Vec<String>,
462 #[builder(default)]
463 #[serde(skip_serializing_if = "Option::is_none")]
464 #[serde(default)]
465 #[doc = "Whether or not to retrieve details of DOM listeners (default false)."]
466 pub include_event_listeners: Option<bool>,
467 #[builder(default)]
468 #[serde(skip_serializing_if = "Option::is_none")]
469 #[serde(default)]
470 #[doc = "Whether to determine and include the paint order index of LayoutTreeNodes (default false)."]
471 pub include_paint_order: Option<bool>,
472 #[builder(default)]
473 #[serde(skip_serializing_if = "Option::is_none")]
474 #[serde(default)]
475 #[doc = "Whether to include UA shadow tree in the snapshot (default false)."]
476 pub include_user_agent_shadow_tree: Option<bool>,
477}
478#[allow(deprecated)]
479#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
480#[builder(setter(into, strip_option))]
481#[serde(rename_all = "camelCase")]
482#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
483pub struct CaptureSnapshot {
484 #[serde(default)]
485 #[doc = "Whitelist of computed styles to return."]
486 pub computed_styles: Vec<String>,
487 #[builder(default)]
488 #[serde(skip_serializing_if = "Option::is_none")]
489 #[serde(default)]
490 #[doc = "Whether to include layout object paint orders into the snapshot."]
491 pub include_paint_order: Option<bool>,
492 #[builder(default)]
493 #[serde(skip_serializing_if = "Option::is_none")]
494 #[serde(default)]
495 #[doc = "Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot"]
496 #[serde(rename = "includeDOMRects")]
497 pub include_dom_rects: Option<bool>,
498 #[builder(default)]
499 #[serde(skip_serializing_if = "Option::is_none")]
500 #[serde(default)]
501 #[doc = "Whether to include blended background colors in the snapshot (default: false).\n Blended background color is achieved by blending background colors of all elements\n that overlap with the current element."]
502 pub include_blended_background_colors: Option<bool>,
503 #[builder(default)]
504 #[serde(skip_serializing_if = "Option::is_none")]
505 #[serde(default)]
506 #[doc = "Whether to include text color opacity in the snapshot (default: false).\n An element might have the opacity property set that affects the text color of the element.\n The final text color opacity is computed based on the opacity of all overlapping elements."]
507 pub include_text_color_opacities: Option<bool>,
508}
509#[allow(deprecated)]
510#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
511#[doc = "Disables DOM snapshot agent for the given page."]
512pub struct DisableReturnObject(pub Option<Json>);
513#[allow(deprecated)]
514#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
515#[doc = "Enables DOM snapshot agent for the given page."]
516pub struct EnableReturnObject(pub Option<Json>);
517#[allow(deprecated)]
518#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
519#[serde(rename_all = "camelCase")]
520#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
521#[deprecated]
522pub struct GetSnapshotReturnObject {
523 #[doc = "The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document."]
524 pub dom_nodes: Vec<DomNode>,
525 #[doc = "The nodes in the layout tree."]
526 pub layout_tree_nodes: Vec<LayoutTreeNode>,
527 #[doc = "Whitelisted ComputedStyle properties for each node in the layout tree."]
528 pub computed_styles: Vec<ComputedStyle>,
529}
530#[allow(deprecated)]
531#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
532#[serde(rename_all = "camelCase")]
533#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
534pub struct CaptureSnapshotReturnObject {
535 #[doc = "The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document."]
536 pub documents: Vec<DocumentSnapshot>,
537 #[doc = "Shared string table that all string properties refer to with indexes."]
538 pub strings: Vec<String>,
539}
540#[allow(deprecated)]
541impl Method for Disable {
542 const NAME: &'static str = "DOMSnapshot.disable";
543 type ReturnObject = DisableReturnObject;
544}
545#[allow(deprecated)]
546impl Method for Enable {
547 const NAME: &'static str = "DOMSnapshot.enable";
548 type ReturnObject = EnableReturnObject;
549}
550#[allow(deprecated)]
551impl Method for GetSnapshot {
552 const NAME: &'static str = "DOMSnapshot.getSnapshot";
553 type ReturnObject = GetSnapshotReturnObject;
554}
555#[allow(deprecated)]
556impl Method for CaptureSnapshot {
557 const NAME: &'static str = "DOMSnapshot.captureSnapshot";
558 type ReturnObject = CaptureSnapshotReturnObject;
559}
560#[allow(dead_code)]
561pub mod events {
562 #[allow(unused_imports)]
563 use super::super::types::*;
564 #[allow(unused_imports)]
565 use derive_builder::Builder;
566 #[allow(unused_imports)]
567 use serde::{Deserialize, Serialize};
568 #[allow(unused_imports)]
569 use serde_json::Value as Json;
570}