| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The <code>chrome.automation</code> API allows developers to access the | 5 // The <code>chrome.automation</code> API allows developers to access the |
| 6 // automation (accessibility) tree for the browser. The tree resembles the DOM | 6 // automation (accessibility) tree for the browser. The tree resembles the DOM |
| 7 // tree, but only exposes the <em>semantic</em> structure of a page. It can be | 7 // tree, but only exposes the <em>semantic</em> structure of a page. It can be |
| 8 // used to programmatically interact with a page by examining names, roles, and | 8 // used to programmatically interact with a page by examining names, roles, and |
| 9 // states, listening for events, and performing actions on nodes. | 9 // states, listening for events, and performing actions on nodes. |
| 10 [nocompile] namespace automation { | 10 [nocompile] namespace automation { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 * This node's text (name) changed. | 254 * This node's text (name) changed. |
| 255 */ | 255 */ |
| 256 textChanged, | 256 textChanged, |
| 257 | 257 |
| 258 /** | 258 /** |
| 259 * This node was removed. | 259 * This node was removed. |
| 260 */ | 260 */ |
| 261 nodeRemoved | 261 nodeRemoved |
| 262 }; | 262 }; |
| 263 | 263 |
| 264 // A map from AutomationNode.nameFrom (a number) to a string describing |
| 265 // the source of the computed name. |
| 266 dictionary NameFromType { |
| 267 }; |
| 268 |
| 264 dictionary Rect { | 269 dictionary Rect { |
| 265 long left; | 270 long left; |
| 266 long top; | 271 long top; |
| 267 long width; | 272 long width; |
| 268 long height; | 273 long height; |
| 269 }; | 274 }; |
| 270 | 275 |
| 271 // Arguments for the find() and findAll() methods. | 276 // Arguments for the find() and findAll() methods. |
| 272 [nocompile, noinline_doc] dictionary FindParams { | 277 [nocompile, noinline_doc] dictionary FindParams { |
| 273 RoleType? role; | 278 RoleType? role; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 | 360 |
| 356 // A single node in an Automation tree. | 361 // A single node in an Automation tree. |
| 357 [nocompile, noinline_doc] dictionary AutomationNode { | 362 [nocompile, noinline_doc] dictionary AutomationNode { |
| 358 // The root node of the tree containing this AutomationNode. | 363 // The root node of the tree containing this AutomationNode. |
| 359 AutomationNode root; | 364 AutomationNode root; |
| 360 | 365 |
| 361 // Whether this AutomationNode is a root node. | 366 // Whether this AutomationNode is a root node. |
| 362 boolean isRootNode; | 367 boolean isRootNode; |
| 363 | 368 |
| 364 // The role of this node. | 369 // The role of this node. |
| 365 automation.RoleType role; | 370 RoleType role; |
| 366 | 371 |
| 367 // The $(ref:automation.StateType)s describing this node. | 372 // The $(ref:automation.StateType)s describing this node. |
| 368 object state; | 373 object state; |
| 369 | 374 |
| 370 // The rendered location (as a bounding box) of this node in global | 375 // The rendered location (as a bounding box) of this node in global |
| 371 // screen coordinates. | 376 // screen coordinates. |
| 372 automation.Rect location; | 377 Rect location; |
| 373 | 378 |
| 374 // Computes the bounding box of a subrange of this node in global screen | 379 // Computes the bounding box of a subrange of this node in global screen |
| 375 // coordinates. Returns the same as |location| if range information | 380 // coordinates. Returns the same as |location| if range information |
| 376 // is not available. The start and end indices are zero-based offsets | 381 // is not available. The start and end indices are zero-based offsets |
| 377 // into the node's "name" string attribute. | 382 // into the node's "name" string attribute. |
| 378 static automation.Rect boundsForRange(long startIndex, long endIndex); | 383 static Rect boundsForRange(long startIndex, long endIndex); |
| 379 | 384 |
| 380 // The purpose of the node, other than the role, if any. | 385 // The purpose of the node, other than the role, if any. |
| 381 DOMString description; | 386 DOMString description; |
| 382 | 387 |
| 383 // The help text for the node, if any. | 388 // The help text for the node, if any. |
| 384 DOMString help; | 389 DOMString help; |
| 385 | 390 |
| 386 // The accessible name for this node, via the | 391 // The accessible name for this node, via the |
| 387 // <a href="http://www.w3.org/TR/wai-aria/roles#namecalculation"> | 392 // <a href="http://www.w3.org/TR/wai-aria/roles#namecalculation"> |
| 388 // Accessible Name Calculation</a> process. | 393 // Accessible Name Calculation</a> process. |
| 389 DOMString name; | 394 DOMString name; |
| 390 | 395 |
| 396 // The source of the name. Use NameFromType to convert this to a string. |
| 397 long nameFrom; |
| 398 |
| 391 // The value for this node: for example the <code>value</code> attribute of | 399 // The value for this node: for example the <code>value</code> attribute of |
| 392 // an <code><input> element. | 400 // an <code><input> element. |
| 393 DOMString value; | 401 DOMString value; |
| 394 | 402 |
| 395 // The HTML tag for this element, if this node is an HTML element. | 403 // The HTML tag for this element, if this node is an HTML element. |
| 396 DOMString htmlTag; | 404 DOMString htmlTag; |
| 397 | 405 |
| 398 // The level of a heading or tree item. | 406 // The level of a heading or tree item. |
| 399 long hierarchicalLevel; | 407 long hierarchicalLevel; |
| 400 | 408 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 416 // <code>aria-flowto</code></a>. | 424 // <code>aria-flowto</code></a>. |
| 417 AutomationNode[] flowTo; | 425 AutomationNode[] flowTo; |
| 418 | 426 |
| 419 // The nodes, if any, which form a label for this element. Generally, the | 427 // The nodes, if any, which form a label for this element. Generally, the |
| 420 // text from these elements will also be exposed as the element's accessible | 428 // text from these elements will also be exposed as the element's accessible |
| 421 // name, via the $(ref:automation.AutomationNode.name) attribute. | 429 // name, via the $(ref:automation.AutomationNode.name) attribute. |
| 422 AutomationNode[] labelledBy; | 430 AutomationNode[] labelledBy; |
| 423 | 431 |
| 424 // The node referred to by <code>aria-activedescendant</code>, where | 432 // The node referred to by <code>aria-activedescendant</code>, where |
| 425 // applicable | 433 // applicable |
| 426 AutomationNode activedescendant; | 434 AutomationNode activeDescendant; |
| 427 | 435 |
| 428 // | 436 // |
| 429 // Link attributes. | 437 // Link attributes. |
| 430 // | 438 // |
| 431 | 439 |
| 432 // The URL that this link will navigate to. | 440 // The URL that this link will navigate to. |
| 433 DOMString url; | 441 DOMString url; |
| 434 | 442 |
| 435 // | 443 // |
| 436 // Document attributes. | 444 // Document attributes. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 467 // text element; -1 if no selection. | 475 // text element; -1 if no selection. |
| 468 long textSelStart; | 476 long textSelStart; |
| 469 | 477 |
| 470 // The character index of the end of the selection within this editable | 478 // The character index of the end of the selection within this editable |
| 471 // text element; -1 if no selection. | 479 // text element; -1 if no selection. |
| 472 long textSelEnd; | 480 long textSelEnd; |
| 473 | 481 |
| 474 // The input type, like email or number. | 482 // The input type, like email or number. |
| 475 DOMString textInputType; | 483 DOMString textInputType; |
| 476 | 484 |
| 485 // An array of indexes of the start position of each text marker. |
| 486 object? markerStarts; |
| 487 |
| 488 // An array of indexes of the end position of each text marker. |
| 489 object? markerEnds; |
| 490 |
| 491 // An array of numerical types indicating the type of each text marker, |
| 492 // such as a spelling error. |
| 493 object? markerTypes; |
| 494 |
| 477 // | 495 // |
| 478 // Tree selection attributes (available on root nodes only) | 496 // Tree selection attributes (available on root nodes only) |
| 479 // | 497 // |
| 480 | 498 |
| 481 // The anchor node of the tree selection, if any. | 499 // The anchor node of the tree selection, if any. |
| 482 AutomationNode? anchorObject; | 500 AutomationNode? anchorObject; |
| 483 // The anchor offset of the tree selection, if any. | 501 // The anchor offset of the tree selection, if any. |
| 484 long? anchorOffset; | 502 long? anchorOffset; |
| 485 // The focus node of the tree selection, if any. | 503 // The focus node of the tree selection, if any. |
| 486 AutomationNode? focusObject; | 504 AutomationNode? focusObject; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 // The value of aria-relevant if this node is inside a live region. | 567 // The value of aria-relevant if this node is inside a live region. |
| 550 DOMString containerLiveRelevant; | 568 DOMString containerLiveRelevant; |
| 551 | 569 |
| 552 // The value of aria-atomic if this node is inside a live region. | 570 // The value of aria-atomic if this node is inside a live region. |
| 553 boolean containerLiveAtomic; | 571 boolean containerLiveAtomic; |
| 554 | 572 |
| 555 // The value of aria-busy if this node is inside a live region. | 573 // The value of aria-busy if this node is inside a live region. |
| 556 boolean containerLiveBusy; | 574 boolean containerLiveBusy; |
| 557 | 575 |
| 558 // | 576 // |
| 577 // Miscellaneous attributes. |
| 578 // |
| 579 |
| 580 // A map containing all HTML attributes and their values |
| 581 object? htmlAttributes; |
| 582 |
| 583 // The input type of a text field, such as "text" or "email". |
| 584 DOMString? inputType; |
| 585 |
| 586 // |
| 559 // Walking the tree. | 587 // Walking the tree. |
| 560 // | 588 // |
| 561 | 589 |
| 562 AutomationNode[] children; | 590 AutomationNode[] children; |
| 563 AutomationNode parent; | 591 AutomationNode parent; |
| 564 AutomationNode firstChild; | 592 AutomationNode firstChild; |
| 565 AutomationNode lastChild; | 593 AutomationNode lastChild; |
| 566 AutomationNode previousSibling; | 594 AutomationNode previousSibling; |
| 567 AutomationNode nextSibling; | 595 AutomationNode nextSibling; |
| 568 | 596 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 // Everything in the tree between the two node/offset pairs gets included | 700 // Everything in the tree between the two node/offset pairs gets included |
| 673 // in the selection. The anchor is where the user started the selection, | 701 // in the selection. The anchor is where the user started the selection, |
| 674 // while the focus is the point at which the selection gets extended | 702 // while the focus is the point at which the selection gets extended |
| 675 // e.g. when dragging with a mouse or using the keyboard. For nodes with | 703 // e.g. when dragging with a mouse or using the keyboard. For nodes with |
| 676 // the role staticText, the offset gives the character offset within | 704 // the role staticText, the offset gives the character offset within |
| 677 // the value where the selection starts or ends, respectively. | 705 // the value where the selection starts or ends, respectively. |
| 678 [nocompile] static void setDocumentSelection( | 706 [nocompile] static void setDocumentSelection( |
| 679 SetDocumentSelectionParams params); | 707 SetDocumentSelectionParams params); |
| 680 }; | 708 }; |
| 681 }; | 709 }; |
| OLD | NEW |