1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579
|
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The <code>chrome.automation</code> API allows developers to access the
// automation (accessibility) tree for the browser. The tree resembles the DOM
// tree, but only exposes the <em>semantic</em> structure of a page. It can be
// used to programmatically interact with a page by examining names, roles, and
// states, listening for events, and performing actions on nodes.
[nocompile] namespace automation {
// Keep the following enums in sync with 'ui/accessibility/ax_enums.mojom'.
// They are kept here purely for extension docs generation.
// Possible events fired on an $(ref:automation.AutomationNode).
enum EventType {
accessKeyChanged,
activeDescendantChanged,
alert,
// TODO(crbug.com/1464633) Fully remove ariaAttributeChangedDeprecated
// starting in 122, because although it was removed in 118, it is still
// present in earlier versions of LaCros.
ariaAttributeChangedDeprecated,
ariaCurrentChanged,
ariaNotificationsPosted,
atomicChanged,
autoCompleteChanged,
autocorrectionOccured,
autofillAvailabilityChanged,
blur,
busyChanged,
caretBoundsChanged,
checkedStateChanged,
checkedStateDescriptionChanged,
childrenChanged,
clicked,
collapsed,
controlsChanged,
detailsChanged,
describedByChanged,
descriptionChanged,
documentSelectionChanged,
documentTitleChanged,
dropeffectChanged,
editableTextChanged,
enabledChanged,
endOfTest,
expanded,
expandedChanged,
flowFromChanged,
flowToChanged,
focus,
focusAfterMenuClose,
focusChanged,
focusContext,
grabbedChanged,
haspopupChanged,
hide,
hierarchicalLevelChanged,
hitTestResult,
hover,
ignoredChanged,
imageAnnotationChanged,
imageFrameUpdated,
invalidStatusChanged,
keyShortcutsChanged,
labeledByChanged,
languageChanged,
layoutComplete,
layoutInvalidated, // fired when aria-busy goes false
liveRegionChanged,
liveRegionCreated,
liveRegionNodeChanged, // fired on a node within a live region.
liveRelevantChanged,
liveStatusChanged,
loadComplete,
loadStart,
locationChanged,
mediaStartedPlaying,
mediaStoppedPlaying,
menuEnd,
menuItemSelected,
menuListValueChangedDeprecated,
menuPopupEnd,
menuPopupStart,
menuStart,
mouseCanceled,
mouseDragged,
mouseMoved,
mousePressed,
mouseReleased,
multilineStateChanged,
multiselectableStateChanged,
nameChanged,
objectAttributeChanged,
orientationChanged,
parentChanged,
placeholderChanged,
positionInSetChanged,
rangeValueChanged,
rangeValueMaxChanged,
rangeValueMinChanged,
rangeValueStepChanged,
readonlyChanged,
relatedNodeChanged,
requiredStateChanged,
roleChanged,
rowCollapsed,
rowCountChanged,
rowExpanded,
scrollHorizontalPositionChanged,
scrollPositionChanged,
scrollVerticalPositionChanged,
scrolledToAnchor,
selectedChanged,
selectedChildrenChanged,
selectedValueChanged,
selection,
selectionAdd,
selectionRemove,
setSizeChanged,
show,
sortChanged,
stateChanged,
subtreeCreated,
textAttributeChanged,
textSelectionChanged,
textChanged,
tooltipClosed,
tooltipOpened,
treeChanged,
valueInTextFieldChanged,
valueChanged, // Deprecated.
windowActivated,
windowDeactivated,
windowVisibilityChanged
};
// Describes the purpose of an $(ref:automation.AutomationNode).
enum RoleType {
abbr,
alert,
alertDialog,
application,
article,
audio,
banner,
blockquote,
button,
canvas,
caption,
caret,
cell,
checkBox,
client,
code,
colorWell,
column,
columnHeader,
comboBoxGrouping,
comboBoxMenuButton,
comboBoxSelect,
comment,
complementary,
contentDeletion,
contentInsertion,
contentInfo,
date,
dateTime,
definition,
descriptionList,
descriptionListDetailDeprecated,
descriptionListTermDeprecated,
desktop,
details,
dialog,
directoryDeprecated,
disclosureTriangle,
disclosureTriangleGrouped,
// --------------------------------------------------------------
// DPub Roles:
// https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table
docAbstract,
docAcknowledgments,
docAfterword,
docAppendix,
docBackLink,
docBiblioEntry,
docBibliography,
docBiblioRef,
docChapter,
docColophon,
docConclusion,
docCover,
docCredit,
docCredits,
docDedication,
docEndnote,
docEndnotes,
docEpigraph,
docEpilogue,
docErrata,
docExample,
docFootnote,
docForeword,
docGlossary,
docGlossRef,
docIndex,
docIntroduction,
docNoteRef,
docNotice,
docPageBreak,
docPageFooter,
docPageHeader,
docPageList,
docPart,
docPreface,
docPrologue,
docPullquote,
docQna,
docSubtitle,
docTip,
docToc,
// End DPub roles.
// --------------------------------------------------------------
document,
embeddedObject,
emphasis,
feed,
figcaption,
figure,
footer,
form,
genericContainer,
// --------------------------------------------------------------
// ARIA Graphics module roles:
// https://rawgit.com/w3c/graphics-aam/master/#mapping_role_table
graphicsDocument,
graphicsObject,
graphicsSymbol,
// End ARIA Graphics module roles.
// --------------------------------------------------------------
grid,
gridCell,
group,
header,
heading,
iframe,
iframePresentational,
image,
imeCandidate,
inlineTextBox,
inputTime,
keyboard,
labelText,
layoutTable,
layoutTableCell,
layoutTableRow,
legend,
lineBreak,
link,
list,
listBox,
listBoxOption,
listGrid, // Native
listItem,
listMarker,
log,
main,
mark,
marquee,
math,
mathMLFraction,
mathMLIdentifier,
mathMLMath,
mathMLMultiscripts,
mathMLNoneScript,
mathMLNumber,
mathMLOperator,
mathMLOver,
mathMLPrescriptDelimiter,
mathMLRoot,
mathMLRow,
mathMLSquareRoot,
mathMLStringLiteral,
mathMLSub,
mathMLSubSup,
mathMLSup,
mathMLTable,
mathMLTableCell,
mathMLTableRow,
mathMLText,
mathMLUnder,
mathMLUnderOver,
menu,
menuBar,
menuItem,
menuItemCheckBox,
menuItemRadio,
menuListOption,
menuListPopup,
meter,
navigation,
note,
pane,
paragraph,
pdfActionableHighlight,
pdfRoot,
pluginObject,
popUpButton,
portalDeprecated,
preDeprecated,
progressIndicator,
radioButton,
radioGroup,
region,
rootWebArea,
row,
rowGroup,
rowHeader,
ruby,
rubyAnnotation,
scrollBar,
scrollView,
search,
searchBox,
section,
sectionFooter,
sectionHeader,
sectionWithoutName,
slider,
spinButton,
splitter,
staticText,
status,
strong,
subscript,
suggestion,
superscript,
svgRoot,
switch,
tab,
tabList,
tabPanel,
table,
tableHeaderContainer,
term,
textField,
textFieldWithComboBox,
time,
timer,
titleBar,
toggleButton,
toolbar,
tooltip,
tree,
treeGrid,
treeItem,
unknown,
video,
webView,
window
};
// Describes characteristics of an $(ref:automation.AutomationNode).
enum StateType {
autofillAvailable,
collapsed,
default,
editable,
expanded,
focusable,
focused,
horizontal,
hovered,
ignored,
invisible,
linked,
multiline,
multiselectable,
offscreen,
protected,
required,
richlyEditable,
vertical,
visited,
hasActions,
hasInterestTarget
};
// All possible actions that can be performed on automation nodes.
enum ActionType {
annotatePageImages,
blur,
clearAccessibilityFocus,
collapse,
customAction,
decrement,
doDefault,
expand,
focus,
getImageData,
getTextLocation,
hideTooltip,
hitTest,
increment,
internalInvalidateTree,
loadInlineTextBoxes,
longClick,
replaceSelectedText,
resumeMedia,
scrollBackward,
scrollDown,
scrollForward,
scrollLeft,
scrollRight,
scrollUp,
scrollToMakeVisible,
scrollToPoint,
scrollToPositionAtRowColumn,
setAccessibilityFocus,
setScrollOffset,
setSelection,
setSequentialFocusNavigationStartingPoint,
setValue,
showContextMenu,
signalEndOfTest,
showTooltip,
stitchChildTree,
startDuckingMedia,
stopDuckingMedia,
suspendMedia
};
// Possible changes to the automation tree. For any given atomic change
// to the tree, each node that's added, removed, or changed, will appear
// in exactly one TreeChange, with one of these types.
//
// nodeCreated means that this node was added to the tree and its parent is
// new as well, so it's just one node in a new subtree that was added.
enum TreeChangeType {
/**
* This node was added to the tree and its parent is new as well,
* so it's just one node in a new subtree that was added.
*/
nodeCreated,
/**
* This node was added to the tree but its parent was already in the
* tree, so it's possibly the root of a new subtree - it does not mean
* that it necessarily has children.
*/
subtreeCreated,
/**
* This node changed.
*/
nodeChanged,
/**
* This node's text (name) changed.
*/
textChanged,
/**
* This node was removed.
*/
nodeRemoved,
/**
* This subtree has finished an update.
*/
subtreeUpdateEnd
};
// Where the node's name is from.
enum NameFromType {
attribute,
attributeExplicitlyEmpty,
caption,
contents,
cssAltText,
interestTarget,
placeholder,
popoverTarget,
prohibited,
prohibitedAndRedundant,
relatedElement,
title,
value
};
enum DescriptionFromType {
ariaDescription,
attributeExplicitlyEmpty,
buttonLabel,
interestTarget,
popoverTarget,
prohibitedNameRepair,
relatedElement,
rubyAnnotation,
summary,
svgDescElement,
tableCaption,
title
};
// The input restriction for a object -- even non-controls can be disabled.
enum Restriction {
disabled,
readOnly
};
// Availability and types for an interactive popup element.
enum HasPopup {
false,
true,
menu,
listbox,
tree,
grid,
dialog
};
// Indicates the ARIA-current state.
enum AriaCurrentState {
false,
true,
page,
step,
location,
date,
time
};
// Lists the values that `invalidState` can take on.
enum InvalidState {
false,
true
};
// Describes possible actions when performing a do default action.
enum DefaultActionVerb {
activate,
check,
click,
clickAncestor,
jump,
open,
press,
select,
uncheck
};
// Types of markers on text. See <code>AutomationNode.markerTypes</code>.
enum MarkerType {
spelling,
grammar,
textMatch,
activeSuggestion,
suggestion,
highlight
};
// The following three enums are associated with an $(ref:automation.AutomationIntent).
// A command associated with an $(ref:automation.AutomationIntent).
enum IntentCommandType {
clearSelection,
delete,
dictate,
extendSelection,
format,
history,
insert,
marker,
moveSelection,
setSelection
};
// The type of an input event associated with an $(ref:automation.AutomationIntent). It describes an edit
// command, e.g. IntentCommandType.insert, in more detail.
enum IntentInputEventType {
// Insertion.
insertText,
insertLineBreak,
insertParagraph,
insertOrderedList,
insertUnorderedList,
insertHorizontalRule,
insertFromPaste,
insertFromDrop,
insertFromYank,
insertTranspose,
insertReplacementText,
insertCompositionText,
insertLink,
// Deletion.
deleteWordBackward,
deleteWordForward,
deleteSoftLineBackward,
deleteSoftLineForward,
deleteHardLineBackward,
deleteHardLineForward,
deleteContentBackward,
deleteContentForward,
deleteByCut,
deleteByDrag,
// History.
historyUndo,
historyRedo,
// Formatting.
formatBold,
formatItalic,
formatUnderline,
formatStrikeThrough,
formatSuperscript,
formatSubscript,
formatJustifyCenter,
formatJustifyFull,
formatJustifyRight,
formatJustifyLeft,
formatIndent,
formatOutdent,
formatRemove,
formatSetBlockTextDirection
};
// A text boundary associated with an $(ref:automation.AutomationIntent).
enum IntentTextBoundaryType {
character,
formatEnd,
formatStart,
formatStartOrEnd,
lineEnd,
lineStart,
lineStartOrEnd,
object,
pageEnd,
pageStart,
pageStartOrEnd,
paragraphEnd,
paragraphStart,
paragraphStartSkippingEmptyParagraphs,
paragraphStartOrEnd,
sentenceEnd,
sentenceStart,
sentenceStartOrEnd,
webPage,
wordEnd,
wordStart,
wordStartOrEnd
};
// A move direction associated with an $(ref:automation.AutomationIntent).
enum IntentMoveDirectionType {
backward,
forward
};
// A sort applied to a table row or column header.
enum SortDirectionType {
unsorted,
ascending,
descending,
other
};
// A type of AutomationPosition.
enum PositionType {
null,
text,
tree
};
dictionary Rect {
long left;
long top;
long width;
long height;
};
// Arguments for the find() and findAll() methods.
[nocompile] dictionary FindParams {
RoleType? role;
// A map of $(ref:automation.StateType) to boolean, indicating for each
// state whether it should be set or not. For example:
// <code>{ StateType.disabled: false }</code> would only match if
// <code>StateType.disabled</code> was <em>not</em> present in the node's
// <code>state</code> object.
object? state;
// A map of attribute name to expected value, for example
// <code>{ name: 'Root directory', checkbox_mixed: true }</code>.
// String attribute values may be specified as a regex, for example
// <code>{ name: /stralia$/</code> }</code>.
// Unless specifying a regex, the expected value must be an exact match
// in type and value for the actual value. Thus, the type of expected value
// must be one of:
// <ul>
// <li>string</li>
// <li>integer</li>
// <li>float</li>
// <li>boolean</li>
// </ul>
object? attributes;
};
// Arguments for the setDocumentSelection() function.
[nocompile] dictionary SetDocumentSelectionParams {
// The node where the selection begins.
[instanceOf=AutomationNode] object anchorObject;
// The offset in the anchor node where the selection begins.
long anchorOffset;
// The node where the selection ends.
[instanceOf=AutomationNode] object focusObject;
// The offset within the focus node where the selection ends.
long focusOffset;
};
[nocompile] dictionary AutomationIntent {
// A command associated with this AutomationIntent.
IntentCommandType command;
// A text boundary associated with this AutomationIntent.
IntentTextBoundaryType textBoundary;
// A move direction associated with this AutomationIntent.
IntentMoveDirectionType? moveDirection;
};
// An event in the Automation tree.
[nocompile] dictionary AutomationEvent {
// The $(ref:automation.AutomationNode) to which the event was targeted.
AutomationNode target;
// The type of the event.
EventType type;
// The source of this event.
DOMString eventFrom;
// Any mouse coordinates associated with this event.
long mouseX;
long mouseY;
// A list of $(ref:automation.AutomationIntent)s associated with this event.
AutomationIntent[] intents;
// Stops this event from further processing except for any remaining
// listeners on $(ref:automation.AutomationEvent.target).
static void stopPropagation();
};
// A listener for events on an <code>AutomationNode</code>.
callback AutomationListener = void(AutomationEvent event);
// A change to the Automation tree.
[nocompile] dictionary TreeChange {
// The $(ref:automation.AutomationNode) that changed.
AutomationNode target;
// The type of change.
TreeChangeType type;
};
// Possible tree changes to listen to using addTreeChangeObserver.
// Note that listening to all tree changes can be expensive.
enum TreeChangeObserverFilter {
noTreeChanges,
liveRegionTreeChanges,
textMarkerChanges,
allTreeChanges
};
// A listener for changes on the <code>AutomationNode</code> tree.
callback TreeChangeObserver = void(TreeChange treeChange);
// Callback called for actions with a response.
callback PerformActionCallback = void(boolean result);
callback PerformActionCallbackWithNode = void(AutomationNode node);
callback BoundsForRangeCallback = void(Rect bounds);
[nocompile] dictionary CustomAction {
long id;
DOMString description;
};
// A marker associated with an AutomationNode.
[nocompile] dictionary Marker {
// The start offset within the text of the associated node.
long startOffset;
// The end offset within the text of the associated node.
long endOffset;
// A mapping of MarkerType to true or undefined indicating the marker types
// for this marker.
object flags;
};
// A position in the automation tree.
// See ui/accessibility/ax_position.h for documentation. All members need to
// be kept in sync with
// extensions/renderer/api/automation/automation_position.h.
// Some members there are kept private and not represented here.
[nocompile] dictionary AutomationPosition {
AutomationNode? node;
long childIndex;
long textOffset;
DOMString affinity;
static boolean isNullPosition();
static boolean isTreePosition();
static boolean isTextPosition();
static boolean isLeafTextPosition();
static boolean atStartOfAnchor();
static boolean atEndOfAnchor();
static boolean atStartOfWord();
static boolean atEndOfWord();
static boolean atStartOfLine();
static boolean atEndOfLine();
static boolean atStartOfParagraph();
static boolean atEndOfParagraph();
static boolean atStartOfPage();
static boolean atEndOfPage();
static boolean atStartOfFormat();
static boolean atEndOfFormat();
static boolean atStartOfDocument();
static boolean atEndOfDocument();
static void asTreePosition();
static void asTextPosition();
static void asLeafTextPosition();
static void moveToPositionAtStartOfAnchor();
static void moveToPositionAtEndOfAnchor();
static void moveToPositionAtStartOfDocument();
static void moveToPositionAtEndOfDocument();
static void moveToParentPosition();
static void moveToNextLeafTreePosition();
static void moveToPreviousLeafTreePosition();
static void moveToNextLeafTextPosition();
static void moveToPreviousLeafTextPosition();
static void moveToNextCharacterPosition();
static void moveToPreviousCharacterPosition();
static void moveToNextWordStartPosition();
static void moveToPreviousWordStartPosition();
static void moveToNextWordEndPosition();
static void moveToPreviousWordEndPosition();
static void moveToNextLineStartPosition();
static void moveToPreviousLineStartPosition();
static void moveToNextLineEndPosition();
static void moveToPreviousLineEndPosition();
static void moveToNextFormatStartPosition();
static void moveToPreviousFormatStartPosition();
static void moveToNextFormatEndPosition();
static void moveToPreviousFormatEndPosition();
static void moveToNextParagraphStartPosition();
static void moveToPreviousParagraphStartPosition();
static void moveToNextParagraphEndPosition();
static void moveToPreviousParagraphEndPosition();
static void moveToNextPageStartPosition();
static void moveToPreviousPageStartPosition();
static void moveToNextPageEndPosition();
static void moveToPreviousPageEndPosition();
static void moveToNextAnchorPosition();
static void moveToPreviousAnchorPosition();
static long maxTextOffset();
static boolean isInLineBreak();
static boolean isInTextObject();
static boolean isInWhiteSpace();
static boolean isValid();
static DOMString getText();
};
// A single node in an Automation tree.
[nocompile] dictionary AutomationNode {
// The root node of the tree containing this AutomationNode.
AutomationNode? root;
// Whether this AutomationNode is a root node.
boolean isRootNode;
// The role of this node.
RoleType? role;
// The $(ref:automation.StateType)s describing this node.
// <jsexterns>@type {Object<chrome.automation.StateType, boolean>}
// </jsexterns>
object? state;
// The rendered location (as a bounding box) of this node in global
// screen coordinates.
Rect location;
// Determines the location of the text within the node specified by
// |startIndex| and |endIndex|, inclusively. Invokes |callback| with the
// bounding rectangle, in screen coordinates. |callback| can be invoked
// either synchronously or asynchronously. The bounds are clipped to
// ancestors.
static void boundsForRange(long startIndex, long endIndex,
BoundsForRangeCallback callback);
// Determines the location of the text within the node specified by
// |startIndex| and |endIndex|, inclusively. Invokes |callback| with the
// bounding rectangle, in screen coordinates. |callback| can be invoked
// either synchronously or asynchronously. The bounds are not clipped to
// ancestors.
static void unclippedBoundsForRange(long startIndex, long endIndex,
BoundsForRangeCallback callback);
// The location (as a bounding box) of this node in global screen
// coordinates without applying any clipping from ancestors.
Rect? unclippedLocation;
// The purpose of the node, other than the role, if any.
DOMString? description;
// Description of the state of the checkbox.
// Used only when the node is checkable.
DOMString? checkedStateDescription;
// The placeholder for this text field, if any.
DOMString? placeholder;
// The role description for this node.
DOMString? roleDescription;
// The accessible name for this node, via the
// <a href="http://www.w3.org/TR/wai-aria/#namecalculation">
// Accessible Name Calculation</a> process.
DOMString? name;
// Explains what will happen when the doDefault action is performed.
DOMString? doDefaultLabel;
// Explains what will happen when the long click action is performed.
DOMString? longClickLabel;
// The tooltip of the node, if any.
DOMString? tooltip;
// The source of the name.
NameFromType? nameFrom;
// The image annotation for image nodes, which may be a human-readable
// string that is the contextualized annotation or a status string related
// to annotations.
DOMString? imageAnnotation;
// The value for this node: for example the <code>value</code> attribute of
// an <code><input> element.
DOMString? value;
// The HTML id for this element, if this node is an HTML element.
DOMString? htmlId;
// The HTML tag for this element, if this node is an HTML element.
DOMString? htmlTag;
// The level of a heading or tree item.
long? hierarchicalLevel;
// The current caret bounds in screen coordinates.
Rect? caretBounds;
// The start and end index of each word in an inline text box.
long[]? wordStarts;
long[]? wordEnds;
// The start indexes of each sentence within the node's name.
long[]? sentenceStarts;
// The end indexes of each sentence within the node's name. For most nodes,
// the size of sentenceStarts array should be equal to the size of
// sentenceEnds array. Two exceptions are (1) node at the begining of a
// paragraph but the end of the node's sentences is in its following node.
// Such a node has one more start index. (2) Node at the end of a paragraph
// but the start of the node's sentences is in its previous node. Such a
// node has one more end index. For example, <p><b>Hello</b> world.</p> has
// two nodes. The first one has one start index (i.e., 0) but no end index.
// The second node has one end index (i.e., 7) but no start index.
long[]? sentenceEnds;
// The start index of each word within the node's name. This is different
// from wordStarts because it is not restricted to inline text boxes and can
// be used for any type of element.
long[]? nonInlineTextWordStarts;
// The end index of each word within the node's name. This is different
// from wordEnds because it is not restricted to inline text boxes and can
// be used for any type of element.
long[]? nonInlineTextWordEnds;
// The nodes, if any, which this node is specified to control via
// <a href="http://www.w3.org/TR/wai-aria/#aria-controls">
// <code>aria-controls</code></a>.
AutomationNode[]? controls;
// The nodes, if any, which form a description for this node.
AutomationNode[]? describedBy;
// The nodes, if any, which may optionally be navigated to after this
// one. See
// <a href="http://www.w3.org/TR/wai-aria/#aria-flowto">
// <code>aria-flowto</code></a>.
AutomationNode[]? flowTo;
// The nodes, if any, which form a label for this element. Generally, the
// text from these elements will also be exposed as the element's accessible
// name, via the $(ref:automation.AutomationNode.name) attribute.
AutomationNode[]? labelledBy;
// The node referred to by <code>aria-activedescendant</code>, where
// applicable
AutomationNode? activeDescendant;
// Reverse relationship for active descendant.
AutomationNode[]? activeDescendantFor;
// The target of an in-page link.
AutomationNode? inPageLinkTarget;
// A node that provides more details about the current node.
AutomationNode[]? details;
// The nodes, if any, that provide an error message for the current node.
AutomationNode[]? errorMessages;
// Reverse relationship for details.
AutomationNode[]? detailsFor;
// Reverse relationship for errorMessage.
AutomationNode[]? errorMessageFor;
// Reverse relationship for controls.
AutomationNode[]? controlledBy;
// Reverse relationship for describedBy.
AutomationNode[]? descriptionFor;
// Reverse relationship for flowTo.
AutomationNode[]? flowFrom;
// Reverse relationship for labelledBy.
AutomationNode[]? labelFor;
// The column header nodes for a table cell.
AutomationNode[]? tableCellColumnHeaders;
// The row header nodes for a table cell.
AutomationNode[]? tableCellRowHeaders;
// An array of standard actions available on this node.
ActionType[]? standardActions;
// An array of custom actions.
CustomAction[]? customActions;
// The action taken by calling <code>doDefault</code>.
DefaultActionVerb? defaultActionVerb;
//
// Link attributes.
//
// The URL that this link will navigate to.
DOMString? url;
//
// Document attributes.
//
// The URL of this document.
DOMString? docUrl;
// The title of this document.
DOMString? docTitle;
// Whether this document has finished loading.
boolean? docLoaded;
// The proportion (out of 1.0) that this doc has completed loading.
double? docLoadingProgress;
//
// Scrollable container attributes.
//
long? scrollX;
long? scrollXMin;
long? scrollXMax;
long? scrollY;
long? scrollYMin;
long? scrollYMax;
// Indicates whether this node is scrollable.
boolean? scrollable;
//
// Editable text field attributes.
//
// The character index of the start of the selection within this editable
// text element; -1 if no selection.
long? textSelStart;
// The character index of the end of the selection within this editable
// text element; -1 if no selection.
long? textSelEnd;
// An array of Marker objects for this node.
Marker[]? markers;
//
// Tree selection attributes (available on root nodes only)
//
// If a selection is present, whether the anchor of the selection comes
// after its focus in the accessibility tree.
boolean? isSelectionBackward;
// The anchor node of the tree selection, if any.
AutomationNode? anchorObject;
// The anchor offset of the tree selection, if any.
long? anchorOffset;
// The affinity of the tree selection anchor, if any.
DOMString? anchorAffinity;
// The focus node of the tree selection, if any.
AutomationNode? focusObject;
// The focus offset of the tree selection, if any.
long? focusOffset;
// The affinity of the tree selection focus, if any.
DOMString? focusAffinity;
// The selection start node of the tree selection, if any.
AutomationNode? selectionStartObject;
// The selection start offset of the tree selection, if any.
long? selectionStartOffset;
// The affinity of the tree selection start, if any.
DOMString? selectionStartAffinity;
// The selection end node of the tree selection, if any.
AutomationNode? selectionEndObject;
// The selection end offset of the tree selection, if any.
long? selectionEndOffset;
// The affinity of the tree selection end, if any.
DOMString? selectionEndAffinity;
// Indicates that the node is marked user-select:none
boolean? notUserSelectableStyle;
//
// Range attributes.
//
// The current value for this range.
double? valueForRange;
// The minimum possible value for this range.
double? minValueForRange;
// The maximum possible value for this range.
double? maxValueForRange;
//
// List attributes.
//
// The 1-based index of an item in a set.
long? posInSet;
// The number of items in a set;
long? setSize;
//
// Table attributes.
//
// The number of rows in this table as specified in the DOM.
long? tableRowCount;
// The number of rows in this table as specified by the page author.
long? ariaRowCount;
// The number of columns in this table as specified in the DOM.
long? tableColumnCount;
// The number of columns in this table as specified by the page author.
long? ariaColumnCount;
//
// Table cell attributes.
//
// The zero-based index of the column that this cell is in as specified in
// the DOM.
long? tableCellColumnIndex;
// The ARIA column index as specified by the page author.
long? tableCellAriaColumnIndex;
// The number of columns that this cell spans (default is 1).
long? tableCellColumnSpan;
// The zero-based index of the row that this cell is in as specified in the
// DOM.
long? tableCellRowIndex;
// The ARIA row index as specified by the page author.
long? tableCellAriaRowIndex;
// The number of rows that this cell spans (default is 1).
long? tableCellRowSpan;
// The corresponding column header for this cell.
AutomationNode? tableColumnHeader;
// The corresponding row header for this cell.
AutomationNode? tableRowHeader;
// The column index of this column node.
long? tableColumnIndex;
// The row index of this row node.
long? tableRowIndex;
//
// Live region attributes.
//
// The type of region if this is the root of a live region.
// Possible values are 'polite' and 'assertive'.
DOMString? liveStatus;
// The value of aria-relevant for a live region.
DOMString? liveRelevant;
// The value of aria-atomic for a live region.
boolean? liveAtomic;
// The value of aria-busy for a live region or any other element.
boolean? busy;
// The type of live region if this node is inside a live region.
DOMString? containerLiveStatus;
// The value of aria-relevant if this node is inside a live region.
DOMString? containerLiveRelevant;
// The value of aria-atomic if this node is inside a live region.
boolean? containerLiveAtomic;
// The value of aria-busy if this node is inside a live region.
boolean? containerLiveBusy;
//
// Miscellaneous attributes.
//
// Whether or not this node is a button.
boolean isButton;
// Whether or not this node is a checkbox.
boolean isCheckBox;
// Whether or not this node is a combobox.
boolean isComboBox;
// Whether or not this node is an image.
boolean isImage;
// Whether the node contains hidden nodes.
boolean hasHiddenOffscreenNodes;
// Aria auto complete.
DOMString? autoComplete;
// The name of the programmatic backing object.
DOMString? className;
// Marks this subtree as modal.
boolean? modal;
// The input type of a text field, such as "text" or "email".
DOMString? inputType;
// The key that activates this widget.
DOMString? accessKey;
// The value of the aria-invalid attribute, indicating the error type.
DOMString? ariaInvalidValue;
// The CSS display attribute for this node, if applicable.
DOMString? display;
// A data url with the contents of this object's image or thumbnail.
DOMString? imageDataUrl;
// The author-provided language code for this subtree.
DOMString? language;
// The detected language code for this subtree.
DOMString? detectedLanguage;
// Indicates the availability and type of an interactive popup element.
HasPopup? hasPopup;
// Input restriction, if any, such as readonly or disabled:
// undefined - enabled control or other object that is not disabled
// Restriction.DISABLED - disallows input in itself + any descendants
// Restriction.READONLY - allow focus/selection but not input
DOMString? restriction;
// Tri-state describing checkbox or radio button:
// 'false' | 'true' | 'mixed'
DOMString? checked;
// The inner html of this element. Only populated for math content.
DOMString? innerHtml;
// The RGBA foreground color of this subtree, as an integer.
long? color;
// The RGBA background color of this subtree, as an integer.
long? backgroundColor;
// The RGBA color of an input element whose value is a color.
long? colorValue;
// Indicates node text is subscript.
boolean subscript;
// Indicates node text is superscript.
boolean superscript;
// Indicates node text is bold.
boolean bold;
// Indicates node text is italic.
boolean italic;
// Indicates node text is underline.
boolean underline;
// Indicates node text is line through.
boolean lineThrough;
// Indicates whether this node is selected, unselected, or neither.
boolean? selected;
// Indicates the font size of this node.
long? fontSize;
// Indicates the font family.
DOMString fontFamily;
// Indicates whether the object functions as a text field which exposes its
// descendants. Use cases include the root of a content-editable region, an
// ARIA textbox which isn't currently editable and which has interactive
// descendants, and a <body> element that has "design-mode" set to "on".
boolean nonAtomicTextFieldRoot;
// Indicates aria-current state.
AriaCurrentState? ariaCurrentState;
// Indicates invalid-state.
InvalidState? invalidState;
// The application id for a tree rooted at this node.
DOMString? appId;
//
// Walking the tree.
//
AutomationNode[] children;
AutomationNode? parent;
AutomationNode? firstChild;
AutomationNode? lastChild;
AutomationNode? previousSibling;
AutomationNode? nextSibling;
AutomationNode? previousOnLine;
AutomationNode? nextOnLine;
AutomationNode? previousFocus;
AutomationNode? nextFocus;
AutomationNode? previousWindowFocus;
AutomationNode? nextWindowFocus;
// The index of this node in its parent node's list of children. If this is
// the root node, this will be undefined.
long? indexInParent;
// The sort direction of this node.
SortDirectionType sortDirection;
// Explicitly set to true when this node is clickable.
boolean clickable;
//
// Actions.
//
// Does the default action based on this node's role. This is generally
// the same action that would result from clicking the node such as
// expanding a treeitem, toggling a checkbox, selecting a radiobutton,
// or activating a button.
static void doDefault();
// Places focus on this node.
static void focus();
// Request a data url for the contents of an image, optionally
// resized. Pass zero for maxWidth and/or maxHeight for the
// original size.
static void getImageData(long maxWidth, long maxHeight);
// Does a hit test of the given global screen coordinates, and fires
// eventToFire on the resulting object.
static void hitTest(
long x,
long y,
EventType eventToFire);
// Does a $(ref:automation.AutomationNode.hitTest), and receives a callback
// with the resulting hit node.
static void hitTestWithReply(
long x,
long y,
PerformActionCallbackWithNode callback);
// Scrolls this node to make it visible.
static void makeVisible();
// Performs custom action.
static void performCustomAction(long customActionId);
// Convenience method to perform a standard action supported by this node.
// For actions requiring additional arguments, call the specific binding
// e.g. <code>setSelection</code>.
static void performStandardAction(ActionType actionType);
// Replaces the selected text within a text field.
static void replaceSelectedText(DOMString value);
// Sets accessibility focus. Accessibility focus is the node on which an
// extension tracks a user's focus. This may be conveyed through a focus
// ring or or speech output by the extension. Automation will dispatch more
// events to the accessibility focus such as location changes.
static void setAccessibilityFocus();
// Sets selection within a text field.
static void setSelection(long startIndex, long endIndex);
// Clears focus and sets this node as the starting point for the next
// time the user presses Tab or Shift+Tab.
static void setSequentialFocusNavigationStartingPoint();
// Sets the value of a text field.
static void setValue(DOMString value);
// Show the context menu for this element, as if the user right-clicked.
static void showContextMenu();
// Resume playing any media within this tree.
static void resumeMedia();
// Start ducking any media within this tree.
static void startDuckingMedia();
// Stop ducking any media within this tree.
static void stopDuckingMedia();
// Suspend any media playing within this tree.
static void suspendMedia();
// Simulates long click on node.
static void longClick();
// Scrolls this scrollable container backward.
static void scrollBackward(optional PerformActionCallback callback);
// Scrolls this scrollable container forward.
static void scrollForward(optional PerformActionCallback callback);
// Scrolls this scrollable container up.
static void scrollUp(optional PerformActionCallback callback);
// Scrolls this scrollable container down.
static void scrollDown(optional PerformActionCallback callback);
// Scrolls this scrollable container left.
static void scrollLeft(optional PerformActionCallback callback);
// Scrolls this scrollable container right.
static void scrollRight(optional PerformActionCallback callback);
// Scrolls this scrollable container to the given point.
static void scrollToPoint(long x, long y);
// Sets this scrollable container's scroll offset.
static void setScrollOffset(long x, long y);
// Adds a listener for the given event type and event phase.
static void addEventListener(
EventType eventType, AutomationListener listener, boolean capture);
// Removes a listener for the given event type and event phase.
static void removeEventListener(
EventType eventType, AutomationListener listener, boolean capture);
// Finds the first AutomationNode in this node's subtree which matches the
// given search parameters.
static AutomationNode find(FindParams params);
// Finds all the AutomationNodes in this node's subtree which matches the
// given search parameters.
static AutomationNode[] findAll(FindParams params);
// Returns whether this node matches the given $(ref:automation.FindParams).
static boolean matches(FindParams params);
static AutomationNode getNextTextMatch(
DOMString searchStr, boolean backward);
// Creates a position object backed by Chrome's accessibility position support.
static AutomationPosition createPosition(PositionType type, long offset, optional boolean isUpstream);
};
// Called when the <code>AutomationNode</code> for the page is available.
callback RootCallback = void(AutomationNode rootNode);
// Called with the <code>AutomationNode</code> that currently has focus.
callback FocusCallback = void(AutomationNode focusedNode);
// Called with the <code>AutomationNode</code> that currently has
// accessibility focus.
callback AccessibilityFocusCallback = void(AutomationNode focusedNode);
interface Functions {
// Get the automation tree for the whole desktop which consists of all on
// screen views. Note this API is currently only supported on Chrome OS.
[nocompile] static void getDesktop(RootCallback callback);
// Get the automation node that currently has focus, globally. Will return
// null if none of the nodes in any loaded trees have focus.
[nocompile] static void getFocus(FocusCallback callback);
// Get the automation node that currently has accessibility focus, globally.
// Will return null if none of the nodes in any loaded trees have
// accessibility focus.
[nocompile] static void getAccessibilityFocus(
AccessibilityFocusCallback callback);
// Add a tree change observer. Tree change observers are static/global, they
// listen to changes across all trees. Pass a filter to determine what
// specific tree changes to listen to, and note that listnening to all
// tree changes can be expensive.
[nocompile, trailingCallbackIsFunctionParameter]
static void addTreeChangeObserver(
TreeChangeObserverFilter filter, TreeChangeObserver observer);
// Remove a tree change observer.
[nocompile, trailingCallbackIsFunctionParameter]
static void removeTreeChangeObserver(
TreeChangeObserver observer);
// Sets the selection in a tree. This creates a selection in a single
// tree (anchorObject and focusObject must have the same root).
// Everything in the tree between the two node/offset pairs gets included
// in the selection. The anchor is where the user started the selection,
// while the focus is the point at which the selection gets extended
// e.g. when dragging with a mouse or using the keyboard. For nodes with
// the role staticText, the offset gives the character offset within
// the value where the selection starts or ends, respectively.
[nocompile] static void setDocumentSelection(
SetDocumentSelectionParams params);
};
};
|