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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 }; | 305 }; |
306 | 306 |
307 // A listener for changes on the <code>AutomationNode</code> tree. | 307 // A listener for changes on the <code>AutomationNode</code> tree. |
308 callback TreeChangeObserver = void(TreeChange treeChange); | 308 callback TreeChangeObserver = void(TreeChange treeChange); |
309 | 309 |
310 // A single node in an Automation tree. | 310 // A single node in an Automation tree. |
311 [nocompile, noinline_doc] dictionary AutomationNode { | 311 [nocompile, noinline_doc] dictionary AutomationNode { |
312 // The root node of the tree containing this AutomationNode. | 312 // The root node of the tree containing this AutomationNode. |
313 AutomationNode root; | 313 AutomationNode root; |
314 | 314 |
315 // Whether this AutomationNode is root node. | 315 // Whether this AutomationNode is a root node. |
316 boolean isRootNode; | 316 boolean isRootNode; |
317 | 317 |
318 // The role of this node. | 318 // The role of this node. |
319 automation.RoleType role; | 319 automation.RoleType role; |
320 | 320 |
321 // The $(ref:automation.StateType)s describing this node. | 321 // The $(ref:automation.StateType)s describing this node. |
322 object state; | 322 object state; |
323 | 323 |
324 // The rendered location (as a bounding box) of this node within the frame. | 324 // The rendered location (as a bounding box) of this node within the frame. |
325 automation.Rect location; | 325 automation.Rect location; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 long textSelStart; | 415 long textSelStart; |
416 | 416 |
417 // The character index of the end of the selection within this editable | 417 // The character index of the end of the selection within this editable |
418 // text element; -1 if no selection. | 418 // text element; -1 if no selection. |
419 long textSelEnd; | 419 long textSelEnd; |
420 | 420 |
421 // The input type, like email or number. | 421 // The input type, like email or number. |
422 DOMString textInputType; | 422 DOMString textInputType; |
423 | 423 |
424 // | 424 // |
425 // Tree selection attributes (available on root nodes only) | |
426 // | |
427 | |
428 AutomationNode? anchorObject; | |
429 long? anchorOffset; | |
430 AutomationNode? focusObject; | |
431 long? focusOffset; | |
David Tseng
2015/09/23 17:57:41
Please document all of these -- they get picked up
| |
432 | |
433 // | |
425 // Range attributes. | 434 // Range attributes. |
426 // | 435 // |
427 | 436 |
428 // The current value for this range. | 437 // The current value for this range. |
429 double valueForRange; | 438 double valueForRange; |
430 | 439 |
431 // The minimum possible value for this range. | 440 // The minimum possible value for this range. |
432 double minValueForRange; | 441 double minValueForRange; |
433 | 442 |
434 // The maximum possible value for this range. | 443 // The maximum possible value for this range. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 [nocompile] static void getDesktop(RootCallback callback); | 555 [nocompile] static void getDesktop(RootCallback callback); |
547 | 556 |
548 // Add a tree change observer. Tree change observers are static/global, they | 557 // Add a tree change observer. Tree change observers are static/global, they |
549 // listen to changes across all trees. | 558 // listen to changes across all trees. |
550 [nocompile] static void addTreeChangeObserver( | 559 [nocompile] static void addTreeChangeObserver( |
551 TreeChangeObserver observer); | 560 TreeChangeObserver observer); |
552 | 561 |
553 // Remove a tree change observer. | 562 // Remove a tree change observer. |
554 [nocompile] static void removeTreeChangeObserver( | 563 [nocompile] static void removeTreeChangeObserver( |
555 TreeChangeObserver observer); | 564 TreeChangeObserver observer); |
565 | |
566 // Sets the selection in a tree. | |
David Tseng
2015/09/23 17:57:41
Needs more detail. The anchor and focus nodes need
| |
567 [nocompile] static void setSelection( | |
David Tseng
2015/09/23 17:57:41
This is now a little confusing as there's two vers
| |
568 [instanceOf=AutomationNode] object anchorObject, | |
David Tseng
2015/09/23 17:57:41
Does the instanceOf property do anything here?
| |
569 long anchorOffset, | |
David Tseng
2015/09/23 17:57:41
Rather than this list of params, use a dictionary
| |
570 [instanceOf=AutomationNode] object focusObject, | |
571 long focusOffset); | |
556 }; | 572 }; |
557 }; | 573 }; |
OLD | NEW |