001package Torello.Browser.BrowserAPI; 002 003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 004// Java-HTML Imports 005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 006 007import Torello.Browser.*; 008import Torello.Browser.helper.*; 009import Torello.Browser.JavaScriptAPI.*; 010import Torello.JSON.*; 011 012import Torello.Java.ReadOnly.ReadOnlyList; 013import Torello.Java.ReadOnly.ReadOnlyArrayList; 014 015import Torello.JavaDoc.Annotations.StaticFunctional; 016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg; 017 018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.DOMSnapshot$$Commands; 019 020 021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 022// JDK Imports 023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 024 025import javax.json.JsonObject; 026import javax.json.JsonValue; 027 028/** 029 * <SPAN CLASS=COPIEDJDK><B>This domain facilitates obtaining document snapshots with DOM, layout, and style information.</B></SPAN> 030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE> 031 */ 032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE") 033public class DOMSnapshot 034{ 035 // No Pubic Constructors 036 private DOMSnapshot() { } 037 038 039 // ******************************************************************************************** 040 // ******************************************************************************************** 041 // Eliminated Types 042 // ******************************************************************************************** 043 // ******************************************************************************************** 044 045 046 /** 047 * Index of the string in the strings table. 048 049 * <EMBED CLASS='external-html' DATA-CTAS='int[]' DATA-FILE-ID=CDP.EliminatedType 050 * DATA-NAME=ArrayOfStrings> 051 */ 052 public static final String ArrayOfStrings = 053 "ArrayOfStrings has been eliminated.\n" + 054 "It was replaced with the standard Java-Type: int[]"; 055 056 /** 057 * <CODE>[No Description Provided by Google]</CODE> 058 059 * <EMBED CLASS='external-html' DATA-CTAS='Number' DATA-FILE-ID=CDP.EliminatedType 060 * DATA-NAME=Rectangle> 061 */ 062 public static final String Rectangle = 063 "Rectangle has been eliminated.\n" + 064 "It was replaced with the standard Java-Type: Number"; 065 066 /** 067 * Index of the string in the strings table. 068 069 * <EMBED CLASS='external-html' DATA-CTAS='int' DATA-FILE-ID=CDP.EliminatedType 070 * DATA-NAME=StringIndex> 071 */ 072 public static final String StringIndex = 073 "StringIndex has been eliminated.\n" + 074 "It was replaced with the standard Java-Type: int"; 075 076 077 078 // ******************************************************************************************** 079 // ******************************************************************************************** 080 // Basic Types 081 // ******************************************************************************************** 082 // ******************************************************************************************** 083 084 085 /** 086 * A subset of the full ComputedStyle as defined by the request whitelist. 087 * 088 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 089 */ 090 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 091 public static class ComputedStyle 092 extends BaseType<ComputedStyle> 093 implements java.io.Serializable 094 { 095 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 096 protected static final long serialVersionUID = 1; 097 098 private static final NestedHelper<DOMSnapshot.ComputedStyle> singleton = 099 Torello.Browser.BrowserAPI.NestedHelpers.Types. 100 DOMSnapshot$$ComputedStyle$$.singleton; 101 102 /** Name/value pairs of computed style properties. */ 103 public final DOMSnapshot.NameValue[] properties; 104 105 /** Constructor. Please review this class' fields for documentation. */ 106 public ComputedStyle(ReadOnlyList<Boolean> isPresent, NameValue[] properties) 107 { 108 super(singleton, Domains.DOMSnapshot, "ComputedStyle", 1); 109 110 this.properties = properties; 111 112 this.isPresent = (isPresent == null) 113 ? singleton.generateIsPresentList(this) 114 : THROWS.check(isPresent, 1, "DOMSnapshot.ComputedStyle"); 115 } 116 117 /** Creates an instance of this class from a {@link JsonObject}.*/ 118 public static ComputedStyle fromJSON(JsonObject jo) 119 { return singleton.fromJSON(jo); } 120 121 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 122 public static NestedDescriptor<ComputedStyle> descriptor() 123 { return singleton.descriptor(); } 124 } 125 126 /** 127 * A Node in the DOM tree. 128 * 129 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 130 */ 131 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 132 public static class DOMNode 133 extends BaseType<DOMNode> 134 implements java.io.Serializable 135 { 136 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 137 protected static final long serialVersionUID = 1; 138 139 private static final NestedHelper<DOMSnapshot.DOMNode> singleton = 140 Torello.Browser.BrowserAPI.NestedHelpers.Types. 141 DOMSnapshot$$DOMNode$$.singleton; 142 143 /** <CODE>Node</CODE>'s nodeType. */ 144 public final int nodeType; 145 146 /** <CODE>Node</CODE>'s nodeName. */ 147 public final String nodeName; 148 149 /** <CODE>Node</CODE>'s nodeValue. */ 150 public final String nodeValue; 151 152 /** 153 * Only set for textarea elements, contains the text value. 154 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 155 */ 156 public final String textValue; 157 158 /** 159 * Only set for input elements, contains the input's associated text value. 160 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 161 */ 162 public final String inputValue; 163 164 /** 165 * Only set for radio and checkbox input elements, indicates if the element has been checked 166 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 167 */ 168 public final Boolean inputChecked; 169 170 /** 171 * Only set for option elements, indicates if the element has been selected 172 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 173 */ 174 public final Boolean optionSelected; 175 176 /** <CODE>Node</CODE>'s id, corresponds to DOM.Node.backendNodeId. */ 177 public final int backendNodeId; 178 179 /** 180 * The indexes of the node's child nodes in the <CODE>domNodes</CODE> array returned by <CODE>getSnapshot</CODE>, if 181 * any. 182 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 183 */ 184 public final int[] childNodeIndexes; 185 186 /** 187 * Attributes of an <CODE>Element</CODE> node. 188 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 189 */ 190 public final DOMSnapshot.NameValue[] attributes; 191 192 /** 193 * Indexes of pseudo elements associated with this node in the <CODE>domNodes</CODE> array returned by 194 * <CODE>getSnapshot</CODE>, if any. 195 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 196 */ 197 public final int[] pseudoElementIndexes; 198 199 /** 200 * The index of the node's related layout tree node in the <CODE>layoutTreeNodes</CODE> array returned by 201 * <CODE>getSnapshot</CODE>, if any. 202 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 203 */ 204 public final Integer layoutNodeIndex; 205 206 /** 207 * Document URL that <CODE>Document</CODE> or <CODE>FrameOwner</CODE> node points to. 208 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 209 */ 210 public final String documentURL; 211 212 /** 213 * Base URL that <CODE>Document</CODE> or <CODE>FrameOwner</CODE> node uses for URL completion. 214 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 215 */ 216 public final String baseURL; 217 218 /** 219 * Only set for documents, contains the document's content language. 220 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 221 */ 222 public final String contentLanguage; 223 224 /** 225 * Only set for documents, contains the document's character set encoding. 226 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 227 */ 228 public final String documentEncoding; 229 230 /** 231 * <CODE>DocumentType</CODE> node's publicId. 232 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 233 */ 234 public final String publicId; 235 236 /** 237 * <CODE>DocumentType</CODE> node's systemId. 238 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 239 */ 240 public final String systemId; 241 242 /** 243 * Frame ID for frame owner elements and also for the document node. 244 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 245 */ 246 public final String frameId; 247 248 /** 249 * The index of a frame owner element's content document in the <CODE>domNodes</CODE> array returned by 250 * <CODE>getSnapshot</CODE>, if any. 251 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 252 */ 253 public final Integer contentDocumentIndex; 254 255 /** 256 * Type of a pseudo element node. 257 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 258 * <EMBED CLASS='external-html' DATA-D=DOM DATA-C=PseudoType DATA-F=pseudoType DATA-FILE-ID=CDP.EL2> 259 * @see BaseType#enumStrList(String) 260 */ 261 public final String pseudoType; 262 263 /** 264 * Shadow root type. 265 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 266 * <EMBED CLASS='external-html' DATA-D=DOM DATA-C=ShadowRootType DATA-F=shadowRootType DATA-FILE-ID=CDP.EL2> 267 * @see BaseType#enumStrList(String) 268 */ 269 public final String shadowRootType; 270 271 /** 272 * Whether this DOM node responds to mouse clicks. This includes nodes that have had click 273 * event listeners attached via JavaScript as well as anchor tags that naturally navigate when 274 * clicked. 275 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 276 */ 277 public final Boolean isClickable; 278 279 /** 280 * Details of the node's event listeners, if any. 281 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 282 */ 283 public final DOMDebugger.EventListener[] eventListeners; 284 285 /** 286 * The selected url for nodes with a srcset attribute. 287 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 288 */ 289 public final String currentSourceURL; 290 291 /** 292 * The url of the script (if any) that generates this node. 293 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 294 */ 295 public final String originURL; 296 297 /** 298 * Scroll offsets, set when this node is a Document. 299 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 300 */ 301 public final Number scrollOffsetX; 302 303 /** 304 * <CODE>[No Description Provided by Google]</CODE> 305 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 306 */ 307 public final Number scrollOffsetY; 308 309 /** Constructor. Please review this class' fields for documentation. */ 310 public DOMNode( 311 ReadOnlyList<Boolean> isPresent, int nodeType, String nodeName, String nodeValue, 312 String textValue, String inputValue, Boolean inputChecked, Boolean optionSelected, 313 int backendNodeId, int[] childNodeIndexes, NameValue[] attributes, 314 int[] pseudoElementIndexes, Integer layoutNodeIndex, String documentURL, 315 String baseURL, String contentLanguage, String documentEncoding, String publicId, 316 String systemId, String frameId, Integer contentDocumentIndex, String pseudoType, 317 String shadowRootType, Boolean isClickable, 318 DOMDebugger.EventListener[] eventListeners, String currentSourceURL, 319 String originURL, Number scrollOffsetX, Number scrollOffsetY 320 ) 321 { 322 super(singleton, Domains.DOMSnapshot, "DOMNode", 28); 323 324 this.nodeType = nodeType; 325 this.nodeName = nodeName; 326 this.nodeValue = nodeValue; 327 this.textValue = textValue; 328 this.inputValue = inputValue; 329 this.inputChecked = inputChecked; 330 this.optionSelected = optionSelected; 331 this.backendNodeId = backendNodeId; 332 this.childNodeIndexes = childNodeIndexes; 333 this.attributes = attributes; 334 this.pseudoElementIndexes = pseudoElementIndexes; 335 this.layoutNodeIndex = layoutNodeIndex; 336 this.documentURL = documentURL; 337 this.baseURL = baseURL; 338 this.contentLanguage = contentLanguage; 339 this.documentEncoding = documentEncoding; 340 this.publicId = publicId; 341 this.systemId = systemId; 342 this.frameId = frameId; 343 this.contentDocumentIndex = contentDocumentIndex; 344 this.pseudoType = pseudoType; 345 this.shadowRootType = shadowRootType; 346 this.isClickable = isClickable; 347 this.eventListeners = eventListeners; 348 this.currentSourceURL = currentSourceURL; 349 this.originURL = originURL; 350 this.scrollOffsetX = scrollOffsetX; 351 this.scrollOffsetY = scrollOffsetY; 352 353 this.isPresent = (isPresent == null) 354 ? singleton.generateIsPresentList(this) 355 : THROWS.check(isPresent, 28, "DOMSnapshot.DOMNode"); 356 } 357 358 /** Creates an instance of this class from a {@link JsonObject}.*/ 359 public static DOMNode fromJSON(JsonObject jo) 360 { return singleton.fromJSON(jo); } 361 362 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 363 public static NestedDescriptor<DOMNode> descriptor() 364 { return singleton.descriptor(); } 365 } 366 367 /** 368 * Document snapshot. 369 * 370 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 371 */ 372 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 373 public static class DocumentSnapshot 374 extends BaseType<DocumentSnapshot> 375 implements java.io.Serializable 376 { 377 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 378 protected static final long serialVersionUID = 1; 379 380 private static final NestedHelper<DOMSnapshot.DocumentSnapshot> singleton = 381 Torello.Browser.BrowserAPI.NestedHelpers.Types. 382 DOMSnapshot$$DocumentSnapshot$$.singleton; 383 384 /** Document URL that <CODE>Document</CODE> or <CODE>FrameOwner</CODE> node points to. */ 385 public final int documentURL; 386 387 /** Document title. */ 388 public final int title; 389 390 /** Base URL that <CODE>Document</CODE> or <CODE>FrameOwner</CODE> node uses for URL completion. */ 391 public final int baseURL; 392 393 /** Contains the document's content language. */ 394 public final int contentLanguage; 395 396 /** Contains the document's character set encoding. */ 397 public final int encodingName; 398 399 /** <CODE>DocumentType</CODE> node's publicId. */ 400 public final int publicId; 401 402 /** <CODE>DocumentType</CODE> node's systemId. */ 403 public final int systemId; 404 405 /** Frame ID for frame owner elements and also for the document node. */ 406 public final int frameId; 407 408 /** A table with dom nodes. */ 409 public final DOMSnapshot.NodeTreeSnapshot nodes; 410 411 /** The nodes in the layout tree. */ 412 public final DOMSnapshot.LayoutTreeSnapshot layout; 413 414 /** The post-layout inline text nodes. */ 415 public final DOMSnapshot.TextBoxSnapshot textBoxes; 416 417 /** 418 * Horizontal scroll offset. 419 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 420 */ 421 public final Number scrollOffsetX; 422 423 /** 424 * Vertical scroll offset. 425 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 426 */ 427 public final Number scrollOffsetY; 428 429 /** 430 * Document content width. 431 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 432 */ 433 public final Number contentWidth; 434 435 /** 436 * Document content height. 437 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 438 */ 439 public final Number contentHeight; 440 441 /** Constructor. Please review this class' fields for documentation. */ 442 public DocumentSnapshot( 443 ReadOnlyList<Boolean> isPresent, int documentURL, int title, int baseURL, 444 int contentLanguage, int encodingName, int publicId, int systemId, int frameId, 445 NodeTreeSnapshot nodes, LayoutTreeSnapshot layout, TextBoxSnapshot textBoxes, 446 Number scrollOffsetX, Number scrollOffsetY, Number contentWidth, 447 Number contentHeight 448 ) 449 { 450 super(singleton, Domains.DOMSnapshot, "DocumentSnapshot", 15); 451 452 this.documentURL = documentURL; 453 this.title = title; 454 this.baseURL = baseURL; 455 this.contentLanguage = contentLanguage; 456 this.encodingName = encodingName; 457 this.publicId = publicId; 458 this.systemId = systemId; 459 this.frameId = frameId; 460 this.nodes = nodes; 461 this.layout = layout; 462 this.textBoxes = textBoxes; 463 this.scrollOffsetX = scrollOffsetX; 464 this.scrollOffsetY = scrollOffsetY; 465 this.contentWidth = contentWidth; 466 this.contentHeight = contentHeight; 467 468 this.isPresent = (isPresent == null) 469 ? singleton.generateIsPresentList(this) 470 : THROWS.check(isPresent, 15, "DOMSnapshot.DocumentSnapshot"); 471 } 472 473 /** Creates an instance of this class from a {@link JsonObject}.*/ 474 public static DocumentSnapshot fromJSON(JsonObject jo) 475 { return singleton.fromJSON(jo); } 476 477 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 478 public static NestedDescriptor<DocumentSnapshot> descriptor() 479 { return singleton.descriptor(); } 480 } 481 482 /** 483 * Details of post layout rendered text positions. The exact layout should not be regarded as 484 * stable and may change between versions. 485 * 486 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 487 */ 488 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 489 public static class InlineTextBox 490 extends BaseType<InlineTextBox> 491 implements java.io.Serializable 492 { 493 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 494 protected static final long serialVersionUID = 1; 495 496 private static final NestedHelper<DOMSnapshot.InlineTextBox> singleton = 497 Torello.Browser.BrowserAPI.NestedHelpers.Types. 498 DOMSnapshot$$InlineTextBox$$.singleton; 499 500 /** The bounding box in document coordinates. Note that scroll offset of the document is ignored. */ 501 public final DOM.Rect boundingBox; 502 503 /** 504 * The starting index in characters, for this post layout textbox substring. Characters that 505 * would be represented as a surrogate pair in UTF-16 have length 2. 506 */ 507 public final int startCharacterIndex; 508 509 /** 510 * The number of characters in this post layout textbox substring. Characters that would be 511 * represented as a surrogate pair in UTF-16 have length 2. 512 */ 513 public final int numCharacters; 514 515 /** Constructor. Please review this class' fields for documentation. */ 516 public InlineTextBox( 517 ReadOnlyList<Boolean> isPresent, DOM.Rect boundingBox, int startCharacterIndex, 518 int numCharacters 519 ) 520 { 521 super(singleton, Domains.DOMSnapshot, "InlineTextBox", 3); 522 523 this.boundingBox = boundingBox; 524 this.startCharacterIndex = startCharacterIndex; 525 this.numCharacters = numCharacters; 526 527 this.isPresent = (isPresent == null) 528 ? singleton.generateIsPresentList(this) 529 : THROWS.check(isPresent, 3, "DOMSnapshot.InlineTextBox"); 530 } 531 532 /** Creates an instance of this class from a {@link JsonObject}.*/ 533 public static InlineTextBox fromJSON(JsonObject jo) 534 { return singleton.fromJSON(jo); } 535 536 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 537 public static NestedDescriptor<InlineTextBox> descriptor() 538 { return singleton.descriptor(); } 539 } 540 541 /** 542 * Details of an element in the DOM tree with a LayoutObject. 543 * 544 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 545 */ 546 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 547 public static class LayoutTreeNode 548 extends BaseType<LayoutTreeNode> 549 implements java.io.Serializable 550 { 551 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 552 protected static final long serialVersionUID = 1; 553 554 private static final NestedHelper<DOMSnapshot.LayoutTreeNode> singleton = 555 Torello.Browser.BrowserAPI.NestedHelpers.Types. 556 DOMSnapshot$$LayoutTreeNode$$.singleton; 557 558 /** The index of the related DOM node in the <CODE>domNodes</CODE> array returned by <CODE>getSnapshot</CODE>. */ 559 public final int domNodeIndex; 560 561 /** The bounding box in document coordinates. Note that scroll offset of the document is ignored. */ 562 public final DOM.Rect boundingBox; 563 564 /** 565 * Contents of the LayoutText, if any. 566 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 567 */ 568 public final String layoutText; 569 570 /** 571 * The post-layout inline text nodes, if any. 572 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 573 */ 574 public final DOMSnapshot.InlineTextBox[] inlineTextNodes; 575 576 /** 577 * Index into the <CODE>computedStyles</CODE> array returned by <CODE>getSnapshot</CODE>. 578 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 579 */ 580 public final Integer styleIndex; 581 582 /** 583 * Global paint order index, which is determined by the stacking order of the nodes. Nodes 584 * that are painted together will have the same index. Only provided if includePaintOrder in 585 * getSnapshot was true. 586 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 587 */ 588 public final Integer paintOrder; 589 590 /** 591 * Set to true to indicate the element begins a new stacking context. 592 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 593 */ 594 public final Boolean isStackingContext; 595 596 /** Constructor. Please review this class' fields for documentation. */ 597 public LayoutTreeNode( 598 ReadOnlyList<Boolean> isPresent, int domNodeIndex, DOM.Rect boundingBox, 599 String layoutText, InlineTextBox[] inlineTextNodes, Integer styleIndex, 600 Integer paintOrder, Boolean isStackingContext 601 ) 602 { 603 super(singleton, Domains.DOMSnapshot, "LayoutTreeNode", 7); 604 605 this.domNodeIndex = domNodeIndex; 606 this.boundingBox = boundingBox; 607 this.layoutText = layoutText; 608 this.inlineTextNodes = inlineTextNodes; 609 this.styleIndex = styleIndex; 610 this.paintOrder = paintOrder; 611 this.isStackingContext = isStackingContext; 612 613 this.isPresent = (isPresent == null) 614 ? singleton.generateIsPresentList(this) 615 : THROWS.check(isPresent, 7, "DOMSnapshot.LayoutTreeNode"); 616 } 617 618 /** Creates an instance of this class from a {@link JsonObject}.*/ 619 public static LayoutTreeNode fromJSON(JsonObject jo) 620 { return singleton.fromJSON(jo); } 621 622 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 623 public static NestedDescriptor<LayoutTreeNode> descriptor() 624 { return singleton.descriptor(); } 625 } 626 627 /** 628 * Table of details of an element in the DOM tree with a LayoutObject. 629 * 630 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 631 */ 632 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 633 public static class LayoutTreeSnapshot 634 extends BaseType<LayoutTreeSnapshot> 635 implements java.io.Serializable 636 { 637 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 638 protected static final long serialVersionUID = 1; 639 640 private static final NestedHelper<DOMSnapshot.LayoutTreeSnapshot> singleton = 641 Torello.Browser.BrowserAPI.NestedHelpers.Types. 642 DOMSnapshot$$LayoutTreeSnapshot$$.singleton; 643 644 /** Index of the corresponding node in the <CODE>NodeTreeSnapshot</CODE> array returned by <CODE>captureSnapshot</CODE>. */ 645 public final int[] nodeIndex; 646 647 /** Array of indexes specifying computed style strings, filtered according to the <CODE>computedStyles</CODE> parameter passed to <CODE>captureSnapshot</CODE>. */ 648 public final int[][] styles; 649 650 /** The absolute position bounding box. */ 651 public final Number[] bounds; 652 653 /** Contents of the LayoutText, if any. */ 654 public final int[] text; 655 656 /** Stacking context information. */ 657 public final DOMSnapshot.RareBooleanData stackingContexts; 658 659 /** 660 * Global paint order index, which is determined by the stacking order of the nodes. Nodes 661 * that are painted together will have the same index. Only provided if includePaintOrder in 662 * captureSnapshot was true. 663 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 664 */ 665 public final int[] paintOrders; 666 667 /** 668 * The offset rect of nodes. Only available when includeDOMRects is set to true 669 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 670 */ 671 public final Number[] offsetRects; 672 673 /** 674 * The scroll rect of nodes. Only available when includeDOMRects is set to true 675 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 676 */ 677 public final Number[] scrollRects; 678 679 /** 680 * The client rect of nodes. Only available when includeDOMRects is set to true 681 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 682 */ 683 public final Number[] clientRects; 684 685 /** 686 * The list of background colors that are blended with colors of overlapping elements. 687 * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B> 688 */ 689 public final int[] blendedBackgroundColors; 690 691 /** 692 * The list of computed text opacities. 693 * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B> 694 */ 695 public final Number[] textColorOpacities; 696 697 /** Constructor. Please review this class' fields for documentation. */ 698 public LayoutTreeSnapshot( 699 ReadOnlyList<Boolean> isPresent, int[] nodeIndex, int[][] styles, Number[] bounds, 700 int[] text, RareBooleanData stackingContexts, int[] paintOrders, 701 Number[] offsetRects, Number[] scrollRects, Number[] clientRects, 702 int[] blendedBackgroundColors, Number[] textColorOpacities 703 ) 704 { 705 super(singleton, Domains.DOMSnapshot, "LayoutTreeSnapshot", 11); 706 707 this.nodeIndex = nodeIndex; 708 this.styles = styles; 709 this.bounds = bounds; 710 this.text = text; 711 this.stackingContexts = stackingContexts; 712 this.paintOrders = paintOrders; 713 this.offsetRects = offsetRects; 714 this.scrollRects = scrollRects; 715 this.clientRects = clientRects; 716 this.blendedBackgroundColors = blendedBackgroundColors; 717 this.textColorOpacities = textColorOpacities; 718 719 this.isPresent = (isPresent == null) 720 ? singleton.generateIsPresentList(this) 721 : THROWS.check(isPresent, 11, "DOMSnapshot.LayoutTreeSnapshot"); 722 } 723 724 /** Creates an instance of this class from a {@link JsonObject}.*/ 725 public static LayoutTreeSnapshot fromJSON(JsonObject jo) 726 { return singleton.fromJSON(jo); } 727 728 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 729 public static NestedDescriptor<LayoutTreeSnapshot> descriptor() 730 { return singleton.descriptor(); } 731 } 732 733 /** 734 * A name/value pair. 735 * 736 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 737 */ 738 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 739 public static class NameValue 740 extends BaseType<NameValue> 741 implements java.io.Serializable 742 { 743 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 744 protected static final long serialVersionUID = 1; 745 746 private static final NestedHelper<DOMSnapshot.NameValue> singleton = 747 Torello.Browser.BrowserAPI.NestedHelpers.Types. 748 DOMSnapshot$$NameValue$$.singleton; 749 750 /** Attribute/property name. */ 751 public final String name; 752 753 /** Attribute/property value. */ 754 public final String value; 755 756 /** Constructor. Please review this class' fields for documentation. */ 757 public NameValue(ReadOnlyList<Boolean> isPresent, String name, String value) 758 { 759 super(singleton, Domains.DOMSnapshot, "NameValue", 2); 760 761 this.name = name; 762 this.value = value; 763 764 this.isPresent = (isPresent == null) 765 ? singleton.generateIsPresentList(this) 766 : THROWS.check(isPresent, 2, "DOMSnapshot.NameValue"); 767 } 768 769 /** Creates an instance of this class from a {@link JsonObject}.*/ 770 public static NameValue fromJSON(JsonObject jo) 771 { return singleton.fromJSON(jo); } 772 773 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 774 public static NestedDescriptor<NameValue> descriptor() 775 { return singleton.descriptor(); } 776 } 777 778 /** 779 * Table containing nodes. 780 * 781 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 782 */ 783 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 784 public static class NodeTreeSnapshot 785 extends BaseType<NodeTreeSnapshot> 786 implements java.io.Serializable 787 { 788 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 789 protected static final long serialVersionUID = 1; 790 791 private static final NestedHelper<DOMSnapshot.NodeTreeSnapshot> singleton = 792 Torello.Browser.BrowserAPI.NestedHelpers.Types. 793 DOMSnapshot$$NodeTreeSnapshot$$.singleton; 794 795 /** 796 * Parent node index. 797 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 798 */ 799 public final int[] parentIndex; 800 801 /** 802 * <CODE>Node</CODE>'s nodeType. 803 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 804 */ 805 public final int[] nodeType; 806 807 /** 808 * Type of the shadow root the <CODE>Node</CODE> is in. String values are equal to the <CODE>ShadowRootType</CODE> enum. 809 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 810 */ 811 public final DOMSnapshot.RareStringData shadowRootType; 812 813 /** 814 * <CODE>Node</CODE>'s nodeName. 815 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 816 */ 817 public final int[] nodeName; 818 819 /** 820 * <CODE>Node</CODE>'s nodeValue. 821 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 822 */ 823 public final int[] nodeValue; 824 825 /** 826 * <CODE>Node</CODE>'s id, corresponds to DOM.Node.backendNodeId. 827 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 828 */ 829 public final int[] backendNodeId; 830 831 /** 832 * Attributes of an <CODE>Element</CODE> node. Flatten name, value pairs. 833 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 834 */ 835 public final int[][] attributes; 836 837 /** 838 * Only set for textarea elements, contains the text value. 839 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 840 */ 841 public final DOMSnapshot.RareStringData textValue; 842 843 /** 844 * Only set for input elements, contains the input's associated text value. 845 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 846 */ 847 public final DOMSnapshot.RareStringData inputValue; 848 849 /** 850 * Only set for radio and checkbox input elements, indicates if the element has been checked 851 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 852 */ 853 public final DOMSnapshot.RareBooleanData inputChecked; 854 855 /** 856 * Only set for option elements, indicates if the element has been selected 857 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 858 */ 859 public final DOMSnapshot.RareBooleanData optionSelected; 860 861 /** 862 * The index of the document in the list of the snapshot documents. 863 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 864 */ 865 public final DOMSnapshot.RareIntegerData contentDocumentIndex; 866 867 /** 868 * Type of a pseudo element node. 869 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 870 */ 871 public final DOMSnapshot.RareStringData pseudoType; 872 873 /** 874 * Pseudo element identifier for this node. Only present if there is a 875 * valid pseudoType. 876 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 877 */ 878 public final DOMSnapshot.RareStringData pseudoIdentifier; 879 880 /** 881 * Whether this DOM node responds to mouse clicks. This includes nodes that have had click 882 * event listeners attached via JavaScript as well as anchor tags that naturally navigate when 883 * clicked. 884 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 885 */ 886 public final DOMSnapshot.RareBooleanData isClickable; 887 888 /** 889 * The selected url for nodes with a srcset attribute. 890 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 891 */ 892 public final DOMSnapshot.RareStringData currentSourceURL; 893 894 /** 895 * The url of the script (if any) that generates this node. 896 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 897 */ 898 public final DOMSnapshot.RareStringData originURL; 899 900 /** Constructor. Please review this class' fields for documentation. */ 901 public NodeTreeSnapshot( 902 ReadOnlyList<Boolean> isPresent, int[] parentIndex, int[] nodeType, 903 RareStringData shadowRootType, int[] nodeName, int[] nodeValue, 904 int[] backendNodeId, int[][] attributes, RareStringData textValue, 905 RareStringData inputValue, RareBooleanData inputChecked, 906 RareBooleanData optionSelected, RareIntegerData contentDocumentIndex, 907 RareStringData pseudoType, RareStringData pseudoIdentifier, 908 RareBooleanData isClickable, RareStringData currentSourceURL, 909 RareStringData originURL 910 ) 911 { 912 super(singleton, Domains.DOMSnapshot, "NodeTreeSnapshot", 17); 913 914 this.parentIndex = parentIndex; 915 this.nodeType = nodeType; 916 this.shadowRootType = shadowRootType; 917 this.nodeName = nodeName; 918 this.nodeValue = nodeValue; 919 this.backendNodeId = backendNodeId; 920 this.attributes = attributes; 921 this.textValue = textValue; 922 this.inputValue = inputValue; 923 this.inputChecked = inputChecked; 924 this.optionSelected = optionSelected; 925 this.contentDocumentIndex = contentDocumentIndex; 926 this.pseudoType = pseudoType; 927 this.pseudoIdentifier = pseudoIdentifier; 928 this.isClickable = isClickable; 929 this.currentSourceURL = currentSourceURL; 930 this.originURL = originURL; 931 932 this.isPresent = (isPresent == null) 933 ? singleton.generateIsPresentList(this) 934 : THROWS.check(isPresent, 17, "DOMSnapshot.NodeTreeSnapshot"); 935 } 936 937 /** Creates an instance of this class from a {@link JsonObject}.*/ 938 public static NodeTreeSnapshot fromJSON(JsonObject jo) 939 { return singleton.fromJSON(jo); } 940 941 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 942 public static NestedDescriptor<NodeTreeSnapshot> descriptor() 943 { return singleton.descriptor(); } 944 } 945 946 /** 947 * <CODE>[No Description Provided by Google]</CODE> 948 * 949 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 950 */ 951 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 952 public static class RareBooleanData 953 extends BaseType<RareBooleanData> 954 implements java.io.Serializable 955 { 956 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 957 protected static final long serialVersionUID = 1; 958 959 private static final NestedHelper<DOMSnapshot.RareBooleanData> singleton = 960 Torello.Browser.BrowserAPI.NestedHelpers.Types. 961 DOMSnapshot$$RareBooleanData$$.singleton; 962 963 /** <CODE>[No Description Provided by Google]</CODE> */ 964 public final int[] index; 965 966 /** Constructor. Please review this class' fields for documentation. */ 967 public RareBooleanData(ReadOnlyList<Boolean> isPresent, int[] index) 968 { 969 super(singleton, Domains.DOMSnapshot, "RareBooleanData", 1); 970 971 this.index = index; 972 973 this.isPresent = (isPresent == null) 974 ? singleton.generateIsPresentList(this) 975 : THROWS.check(isPresent, 1, "DOMSnapshot.RareBooleanData"); 976 } 977 978 /** Creates an instance of this class from a {@link JsonObject}.*/ 979 public static RareBooleanData fromJSON(JsonObject jo) 980 { return singleton.fromJSON(jo); } 981 982 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 983 public static NestedDescriptor<RareBooleanData> descriptor() 984 { return singleton.descriptor(); } 985 } 986 987 /** 988 * <CODE>[No Description Provided by Google]</CODE> 989 * 990 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 991 */ 992 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 993 public static class RareIntegerData 994 extends BaseType<RareIntegerData> 995 implements java.io.Serializable 996 { 997 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 998 protected static final long serialVersionUID = 1; 999 1000 private static final NestedHelper<DOMSnapshot.RareIntegerData> singleton = 1001 Torello.Browser.BrowserAPI.NestedHelpers.Types. 1002 DOMSnapshot$$RareIntegerData$$.singleton; 1003 1004 /** <CODE>[No Description Provided by Google]</CODE> */ 1005 public final int[] index; 1006 1007 /** <CODE>[No Description Provided by Google]</CODE> */ 1008 public final int[] value; 1009 1010 /** Constructor. Please review this class' fields for documentation. */ 1011 public RareIntegerData(ReadOnlyList<Boolean> isPresent, int[] index, int[] value) 1012 { 1013 super(singleton, Domains.DOMSnapshot, "RareIntegerData", 2); 1014 1015 this.index = index; 1016 this.value = value; 1017 1018 this.isPresent = (isPresent == null) 1019 ? singleton.generateIsPresentList(this) 1020 : THROWS.check(isPresent, 2, "DOMSnapshot.RareIntegerData"); 1021 } 1022 1023 /** Creates an instance of this class from a {@link JsonObject}.*/ 1024 public static RareIntegerData fromJSON(JsonObject jo) 1025 { return singleton.fromJSON(jo); } 1026 1027 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 1028 public static NestedDescriptor<RareIntegerData> descriptor() 1029 { return singleton.descriptor(); } 1030 } 1031 1032 /** 1033 * Data that is only present on rare nodes. 1034 * 1035 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 1036 */ 1037 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 1038 public static class RareStringData 1039 extends BaseType<RareStringData> 1040 implements java.io.Serializable 1041 { 1042 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 1043 protected static final long serialVersionUID = 1; 1044 1045 private static final NestedHelper<DOMSnapshot.RareStringData> singleton = 1046 Torello.Browser.BrowserAPI.NestedHelpers.Types. 1047 DOMSnapshot$$RareStringData$$.singleton; 1048 1049 /** <CODE>[No Description Provided by Google]</CODE> */ 1050 public final int[] index; 1051 1052 /** <CODE>[No Description Provided by Google]</CODE> */ 1053 public final int[] value; 1054 1055 /** Constructor. Please review this class' fields for documentation. */ 1056 public RareStringData(ReadOnlyList<Boolean> isPresent, int[] index, int[] value) 1057 { 1058 super(singleton, Domains.DOMSnapshot, "RareStringData", 2); 1059 1060 this.index = index; 1061 this.value = value; 1062 1063 this.isPresent = (isPresent == null) 1064 ? singleton.generateIsPresentList(this) 1065 : THROWS.check(isPresent, 2, "DOMSnapshot.RareStringData"); 1066 } 1067 1068 /** Creates an instance of this class from a {@link JsonObject}.*/ 1069 public static RareStringData fromJSON(JsonObject jo) 1070 { return singleton.fromJSON(jo); } 1071 1072 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 1073 public static NestedDescriptor<RareStringData> descriptor() 1074 { return singleton.descriptor(); } 1075 } 1076 1077 /** 1078 * Table of details of the post layout rendered text positions. The exact layout should not be regarded as 1079 * stable and may change between versions. 1080 * 1081 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI> 1082 */ 1083 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 1084 public static class TextBoxSnapshot 1085 extends BaseType<TextBoxSnapshot> 1086 implements java.io.Serializable 1087 { 1088 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 1089 protected static final long serialVersionUID = 1; 1090 1091 private static final NestedHelper<DOMSnapshot.TextBoxSnapshot> singleton = 1092 Torello.Browser.BrowserAPI.NestedHelpers.Types. 1093 DOMSnapshot$$TextBoxSnapshot$$.singleton; 1094 1095 /** Index of the layout tree node that owns this box collection. */ 1096 public final int[] layoutIndex; 1097 1098 /** The absolute position bounding box. */ 1099 public final Number[] bounds; 1100 1101 /** 1102 * The starting index in characters, for this post layout textbox substring. Characters that 1103 * would be represented as a surrogate pair in UTF-16 have length 2. 1104 */ 1105 public final int[] start; 1106 1107 /** 1108 * The number of characters in this post layout textbox substring. Characters that would be 1109 * represented as a surrogate pair in UTF-16 have length 2. 1110 */ 1111 public final int[] length; 1112 1113 /** Constructor. Please review this class' fields for documentation. */ 1114 public TextBoxSnapshot( 1115 ReadOnlyList<Boolean> isPresent, int[] layoutIndex, Number[] bounds, int[] start, 1116 int[] length 1117 ) 1118 { 1119 super(singleton, Domains.DOMSnapshot, "TextBoxSnapshot", 4); 1120 1121 this.layoutIndex = layoutIndex; 1122 this.bounds = bounds; 1123 this.start = start; 1124 this.length = length; 1125 1126 this.isPresent = (isPresent == null) 1127 ? singleton.generateIsPresentList(this) 1128 : THROWS.check(isPresent, 4, "DOMSnapshot.TextBoxSnapshot"); 1129 } 1130 1131 /** Creates an instance of this class from a {@link JsonObject}.*/ 1132 public static TextBoxSnapshot fromJSON(JsonObject jo) 1133 { return singleton.fromJSON(jo); } 1134 1135 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 1136 public static NestedDescriptor<TextBoxSnapshot> descriptor() 1137 { return singleton.descriptor(); } 1138 } 1139 1140 1141 // ******************************************************************************************** 1142 // ******************************************************************************************** 1143 // Command-Return Types 1144 // ******************************************************************************************** 1145 // ******************************************************************************************** 1146 1147 1148 /** 1149 * Returns a document snapshot, including the full DOM tree of the root node (including iframes, 1150 * template contents, and imported documents) in a flattened array, as well as layout and 1151 * white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is 1152 * flattened. 1153 * 1154 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI DATA-CMD=captureSnapshot> 1155 * @see DOMSnapshot#captureSnapshot 1156 */ 1157 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_CMD_JDHBI") 1158 public static class captureSnapshot$$RET 1159 extends BaseType<captureSnapshot$$RET> 1160 implements java.io.Serializable 1161 { 1162 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 1163 protected static final long serialVersionUID = 1; 1164 1165 private static final NestedHelper<DOMSnapshot.captureSnapshot$$RET> singleton = 1166 Torello.Browser.BrowserAPI.NestedHelpers.CmdReturns. 1167 DOMSnapshot$$captureSnapshot$$RET.singleton; 1168 1169 /** The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. */ 1170 public final DOMSnapshot.DocumentSnapshot[] documents; 1171 1172 /** Shared string table that all string properties refer to with indexes. */ 1173 public final String[] strings; 1174 1175 /** Constructor. Please review this class' fields for documentation. */ 1176 public captureSnapshot$$RET 1177 (ReadOnlyList<Boolean> isPresent, DocumentSnapshot[] documents, String[] strings) 1178 { 1179 super(singleton, Domains.DOMSnapshot, "captureSnapshot", 2); 1180 1181 this.documents = documents; 1182 this.strings = strings; 1183 1184 this.isPresent = (isPresent == null) 1185 ? singleton.generateIsPresentList(this) 1186 : THROWS.check(isPresent, 2, "DOMSnapshot.captureSnapshot$$RET"); 1187 } 1188 1189 /** Creates an instance of this class from a {@link JsonObject}.*/ 1190 public static captureSnapshot$$RET fromJSON(JsonObject jo) 1191 { return singleton.fromJSON(jo); } 1192 1193 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 1194 public static NestedDescriptor<captureSnapshot$$RET> descriptor() 1195 { return singleton.descriptor(); } 1196 } 1197 1198 /** 1199 * Returns a document snapshot, including the full DOM tree of the root node (including iframes, 1200 * template contents, and imported documents) in a flattened array, as well as layout and 1201 * white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is 1202 * flattened. 1203 * 1204 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 1205 * <EMBED CLASS=globalDefs DATA-DOMAIN=DOMSnapshot DATA-API=BrowserAPI DATA-CMD=getSnapshot> 1206 * @see DOMSnapshot#getSnapshot 1207 */ 1208 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_CMD_JDHBI") 1209 public static class getSnapshot$$RET 1210 extends BaseType<getSnapshot$$RET> 1211 implements java.io.Serializable 1212 { 1213 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 1214 protected static final long serialVersionUID = 1; 1215 1216 private static final NestedHelper<DOMSnapshot.getSnapshot$$RET> singleton = 1217 Torello.Browser.BrowserAPI.NestedHelpers.CmdReturns. 1218 DOMSnapshot$$getSnapshot$$RET.singleton; 1219 1220 /** The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. */ 1221 public final DOMSnapshot.DOMNode[] domNodes; 1222 1223 /** The nodes in the layout tree. */ 1224 public final DOMSnapshot.LayoutTreeNode[] layoutTreeNodes; 1225 1226 /** Whitelisted ComputedStyle properties for each node in the layout tree. */ 1227 public final DOMSnapshot.ComputedStyle[] computedStyles; 1228 1229 /** Constructor. Please review this class' fields for documentation. */ 1230 public getSnapshot$$RET( 1231 ReadOnlyList<Boolean> isPresent, DOMNode[] domNodes, 1232 LayoutTreeNode[] layoutTreeNodes, ComputedStyle[] computedStyles 1233 ) 1234 { 1235 super(singleton, Domains.DOMSnapshot, "getSnapshot", 3); 1236 1237 this.domNodes = domNodes; 1238 this.layoutTreeNodes = layoutTreeNodes; 1239 this.computedStyles = computedStyles; 1240 1241 this.isPresent = (isPresent == null) 1242 ? singleton.generateIsPresentList(this) 1243 : THROWS.check(isPresent, 3, "DOMSnapshot.getSnapshot$$RET"); 1244 } 1245 1246 /** Creates an instance of this class from a {@link JsonObject}.*/ 1247 public static getSnapshot$$RET fromJSON(JsonObject jo) 1248 { return singleton.fromJSON(jo); } 1249 1250 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 1251 public static NestedDescriptor<getSnapshot$$RET> descriptor() 1252 { return singleton.descriptor(); } 1253 } 1254 1255 1256 1257 1258 // ******************************************************************************************** 1259 // ******************************************************************************************** 1260 // Commands 1261 // ******************************************************************************************** 1262 // ******************************************************************************************** 1263 1264 1265 /** 1266 * Returns a document snapshot, including the full DOM tree of the root node (including iframes, 1267 * template contents, and imported documents) in a flattened array, as well as layout and 1268 * white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is 1269 * flattened. 1270 * 1271 * <BR /><BR /><DIV CLASS=JDHint> 1272 * 👍 Because of the sheer number of input parameters to this method, there is a 1273 * a {@link CommandBuilder} variant to this method which may be invoked instead. 1274 * 1275 * <BR /><BR /> 1276 * Please View: {@link #captureSnapshot()} 1277 * </DIV> 1278 * 1279 * @param computedStyles Whitelist of computed styles to return. 1280 * 1281 * @param includePaintOrder Whether to include layout object paint orders into the snapshot. 1282 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 1283 * 1284 * @param includeDOMRects Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot 1285 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 1286 * 1287 * @param includeBlendedBackgroundColors 1288 * Whether to include blended background colors in the snapshot (default: false). 1289 * Blended background color is achieved by blending background colors of all elements 1290 * that overlap with the current element. 1291 * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B> 1292 * 1293 * @param includeTextColorOpacities 1294 * Whether to include text color opacity in the snapshot (default: false). 1295 * An element might have the opacity property set that affects the text color of the element. 1296 * The final text color opacity is computed based on the opacity of all overlapping elements. 1297 * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B> 1298 * 1299 * @return An instance of <CODE>{@link Script}<{@link captureSnapshot$$RET}></CODE> 1300 * 1301 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 1302 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 1303 * <CODE><{@link captureSnapshot$$RET}></CODE> will be returned 1304 * 1305 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 1306 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 1307 * be retrieved.</I> 1308 * 1309 * <BR /><BR /><DIV CLASS=JDHint> 1310 * This Browser Function's {@code Promise} returns:{@link captureSnapshot$$RET} 1311 * A dedicated return type implies that the browser may return more than 1 datum 1312 * </DIV> 1313 */ 1314 public static Script<captureSnapshot$$RET> captureSnapshot( 1315 String[] computedStyles, Boolean includePaintOrder, Boolean includeDOMRects, 1316 Boolean includeBlendedBackgroundColors, Boolean includeTextColorOpacities 1317 ) 1318 { 1319 // Convert all Method Parameters into a JSON Request-Object (as a String) 1320 final String requestJSON = WriteJSON.get( 1321 DOMSnapshot$$Commands.captureSnapshot$$, "DOMSnapshot.captureSnapshot", 1322 computedStyles, includePaintOrder, includeDOMRects, includeBlendedBackgroundColors, 1323 includeTextColorOpacities 1324 ); 1325 1326 return new Script<>( 1327 Domains.DOMSnapshot, "captureSnapshot", requestJSON, 1328 captureSnapshot$$RET::fromJSON, 1329 captureSnapshot$$RET.class 1330 ); 1331 } 1332 1333 /** 1334 * Disables DOM snapshot agent for the given page. 1335 * 1336 * @return An instance of <CODE>{@link Script}<Void></CODE> 1337 * 1338 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 1339 * browser receives the invocation-request. 1340 * 1341 * <BR /><BR /><DIV CLASS=JDHint> 1342 * This Browser-Function <I>does not have</I> a return-value. You may choose to 1343 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 1344 * the Browser Function has run to completion. 1345 * </DIV> 1346 */ 1347 public static Script<Void> disable() 1348 { 1349 // Ultra-Simple Request JSON - Because this method has no parameters 1350 final String requestJSON = "{\"method\":\"DOMSnapshot.disable\"}"; 1351 1352 return Script.NO_RET(Domains.DOMSnapshot, "disable", requestJSON); 1353 } 1354 1355 /** 1356 * Enables DOM snapshot agent for the given page. 1357 * 1358 * @return An instance of <CODE>{@link Script}<Void></CODE> 1359 * 1360 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 1361 * browser receives the invocation-request. 1362 * 1363 * <BR /><BR /><DIV CLASS=JDHint> 1364 * This Browser-Function <I>does not have</I> a return-value. You may choose to 1365 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 1366 * the Browser Function has run to completion. 1367 * </DIV> 1368 */ 1369 public static Script<Void> enable() 1370 { 1371 // Ultra-Simple Request JSON - Because this method has no parameters 1372 final String requestJSON = "{\"method\":\"DOMSnapshot.enable\"}"; 1373 1374 return Script.NO_RET(Domains.DOMSnapshot, "enable", requestJSON); 1375 } 1376 1377 /** 1378 * Returns a document snapshot, including the full DOM tree of the root node (including iframes, 1379 * template contents, and imported documents) in a flattened array, as well as layout and 1380 * white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is 1381 * flattened. 1382 * 1383 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 1384 * 1385 * @param computedStyleWhitelist Whitelist of computed styles to return. 1386 * 1387 * @param includeEventListeners Whether or not to retrieve details of DOM listeners (default false). 1388 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 1389 * 1390 * @param includePaintOrder Whether to determine and include the paint order index of LayoutTreeNodes (default false). 1391 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 1392 * 1393 * @param includeUserAgentShadowTree Whether to include UA shadow tree in the snapshot (default false). 1394 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 1395 * 1396 * @return An instance of <CODE>{@link Script}<{@link getSnapshot$$RET}></CODE> 1397 * 1398 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 1399 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 1400 * <CODE><{@link getSnapshot$$RET}></CODE> will be returned 1401 * 1402 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 1403 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 1404 * be retrieved.</I> 1405 * 1406 * <BR /><BR /><DIV CLASS=JDHint> 1407 * This Browser Function's {@code Promise} returns:{@link getSnapshot$$RET} 1408 * A dedicated return type implies that the browser may return more than 1 datum 1409 * </DIV> 1410 */ 1411 public static Script<getSnapshot$$RET> getSnapshot( 1412 String[] computedStyleWhitelist, Boolean includeEventListeners, 1413 Boolean includePaintOrder, Boolean includeUserAgentShadowTree 1414 ) 1415 { 1416 // Convert all Method Parameters into a JSON Request-Object (as a String) 1417 final String requestJSON = WriteJSON.get( 1418 DOMSnapshot$$Commands.getSnapshot$$, "DOMSnapshot.getSnapshot", 1419 computedStyleWhitelist, includeEventListeners, includePaintOrder, 1420 includeUserAgentShadowTree 1421 ); 1422 1423 return new Script<>( 1424 Domains.DOMSnapshot, "getSnapshot", requestJSON, 1425 getSnapshot$$RET::fromJSON, 1426 getSnapshot$$RET.class 1427 ); 1428 } 1429 1430 1431 // ******************************************************************************************** 1432 // ******************************************************************************************** 1433 // CommandBuilder Getter-Methods 1434 // ******************************************************************************************** 1435 // ******************************************************************************************** 1436 1437 1438 /** 1439 * Creates a buider for conveniently assigning parameters to this method. 1440 * 1441 * <BR /><BR /><DIV CLASS=JDHint> 1442 * Note that the original method expects 5 parameters, and can be cumbersome. 1443 * </DIV> 1444 * 1445 * @return {@link CommandBuilder} instance, for assigning parameter values, one by one. 1446 * @see #captureSnapshot 1447 */ 1448 public static CommandBuilder<captureSnapshot$$RET> captureSnapshot() 1449 { return CommandBuilder.builder(DOMSnapshot$$Commands.captureSnapshot$$); } 1450 1451 1452}