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