summaryrefslogtreecommitdiff
path: root/chromium/ui/accessibility/ax_enums.mojom
blob: cd405e5f946aeed8303de0a093b3f13a76bc6ee5 (plain)
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
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Must also be kept in sync with extensions/common/api/automation.idl.
module ax.mojom;

// For new entries to the following four enums, also add to
// extensions/common/api/automation.idl. This is enforced
// by a PRESUBMIT check.
//
// Explanation of in-lined comments next to some enum values/attributes:
//
// Web: this attribute is only used in web content.
//
// Native: this attribute is only used in native UI.
//
// Implicit: for events, it would be cleaner if we just updated the AX node and
//     each platform fired the appropriate events to indicate which
//     platform-specific attributes changed.
//
//  if Native / [Platform1, ...] is specified, the attribute is only used
//  on those platforms.
//
// If unspecified, the attribute is used across web and native on multiple
// platforms.

enum Event {
  kNone,
  kActiveDescendantChanged,
  kAlert,
  kAriaAttributeChanged,   // Implicit
  kAutocorrectionOccured,  // Unknown: http://crbug.com/392498
  kBlur,                   // Remove: http://crbug.com/392502
  kCheckedStateChanged,    // Implicit
  kChildrenChanged,
  kClicked,
  kControlsChanged,
  kDocumentSelectionChanged,
  kDocumentTitleChanged,
  kEndOfTest,        // Sentinel value indicating the end of a test
  kExpandedChanged,  // Web
  kFocus,
  kFocusAfterMenuClose,
  kFocusContext,  // Contextual focus event that must delay the next focus event
  kHide,          // Remove: http://crbug.com/392502
  kHitTestResult,
  kHover,
  kImageFrameUpdated,     // Web
  kLayoutComplete,        // Web
  kLiveRegionCreated,     // Implicit
  kLiveRegionChanged,     // Web
  kLoadComplete,          // Web
  kLoadStart,             // Web / AuraLinux
  kLocationChanged,       // Web
  kMediaStartedPlaying,   // Native / Automation
  kMediaStoppedPlaying,   // Native / Automation
  kMenuEnd,               // Native / web: menu interaction has ended.
  kMenuListValueChanged,  // Web
  kMenuPopupEnd,          // Native / web: a menu/submenu is hidden/closed.
  kMenuPopupStart,        // Native / web: a menu/submenu is shown/opened.
  kMenuStart,             // Native / web: menu interaction has begun.
  kMouseCanceled,
  kMouseDragged,
  kMouseMoved,
  kMousePressed,
  kMouseReleased,
  kRowCollapsed,
  kRowCountChanged,
  kRowExpanded,
  kScrollPositionChanged,    // Web
  kScrolledToAnchor,         // Web
  kSelectedChildrenChanged,  // Web
  kSelection,                // Native
  kSelectionAdd,             // Native
  kSelectionRemove,          // Native
  kShow,                     // Native / Automation
  kStateChanged,             // Native / Automation
  kTextChanged,
  // TODO(nektar): Remove kTextSelectionChanged.
  kTextSelectionChanged,
  kTooltipClosed,
  kTooltipOpened,
  kTreeChanged,  // Don't explicitly fire this event.
  // TODO(nektar): Remove kValueChanged.
  kValueChanged,
  kWindowActivated,             // Native
  kWindowDeactivated,           // Native
  kWindowVisibilityChanged,     // Native
};

// Accessibility object roles.
// The majority of these roles come from the ARIA specification. Reference
// the latest draft for proper usage.
//
// Roles not included by the ARIA specification should be avoided, especially
// internal roles used by the accessibility infrastructure.
//
// Explanation of in-lined comments next to some enum values.
//
// Web: this attribute is only used in web content.
//
// Native: this attribute is only used in native UI.
enum Role {
  kNone,
  kAbbr,
  kAlert,
  kAlertDialog,
  kAnchor,
  kApplication,
  kArticle,
  kAudio,
  kBanner,
  kBlockquote,
  kButton,
  kCanvas,
  kCaption,
  kCaret,
  kCell,
  kCheckBox,
  kClient,
  kCode,
  kColorWell,
  kColumn,
  kColumnHeader,
  kComboBoxGrouping,
  kComboBoxMenuButton,
  kComplementary,
  kComment,
  kContentDeletion,
  kContentInsertion,
  kContentInfo,
  kDate,
  kDateTime,
  kDefinition,
  kDescriptionList,
  kDescriptionListDetail,
  kDescriptionListTerm,
  kDesktop,  // internal
  kDetails,
  kDialog,
  kDirectory,
  kDisclosureTriangle,
  // --------------------------------------------------------------
  // DPub Roles:
  // https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table
  kDocAbstract,
  kDocAcknowledgments,
  kDocAfterword,
  kDocAppendix,
  kDocBackLink,
  kDocBiblioEntry,
  kDocBibliography,
  kDocBiblioRef,
  kDocChapter,
  kDocColophon,
  kDocConclusion,
  kDocCover,
  kDocCredit,
  kDocCredits,
  kDocDedication,
  kDocEndnote,
  kDocEndnotes,
  kDocEpigraph,
  kDocEpilogue,
  kDocErrata,
  kDocExample,
  kDocFootnote,
  kDocForeword,
  kDocGlossary,
  kDocGlossRef,
  kDocIndex,
  kDocIntroduction,
  kDocNoteRef,
  kDocNotice,
  kDocPageBreak,
  kDocPageFooter,
  kDocPageHeader,
  kDocPageList,
  kDocPart,
  kDocPreface,
  kDocPrologue,
  kDocPullquote,
  kDocQna,
  kDocSubtitle,
  kDocTip,
  kDocToc,
  // End DPub roles.
  // --------------------------------------------------------------
  kDocument,
  kEmbeddedObject,
  kEmphasis,
  kFeed,
  kFigcaption,
  kFigure,
  kFooter,
  kFooterAsNonLandmark,
  kForm,
  kGenericContainer,
  // --------------------------------------------------------------
  // ARIA Graphics module roles:
  // https://rawgit.com/w3c/graphics-aam/master/#mapping_role_table
  kGraphicsDocument,
  kGraphicsObject,
  kGraphicsSymbol,
  // End ARIA Graphics module roles.
  // --------------------------------------------------------------
  kGrid,
  kGroup,
  kHeader,
  kHeaderAsNonLandmark,
  kHeading,
  kIframe,
  kIframePresentational,
  kIgnored,
  kImage,
  kImageMap,
  kImeCandidate,
  kInlineTextBox,
  kInputTime,
  kKeyboard,
  kLabelText,
  kLayoutTable,
  kLayoutTableCell,
  kLayoutTableRow,
  kLegend,
  kLineBreak,
  kLink,
  kList,
  kListBox,
  kListBoxOption,
  // kListGrid behaves similar to an ARIA grid but is primarily used by
  // TableView and its subclasses, so that they could be exposed correctly on
  // certain platforms.
  kListGrid,  // Native
  kListItem,
  kListMarker,
  kLog,
  kMain,
  kMark,
  kMarquee,
  kMath,
  kMenu,
  kMenuBar,
  kMenuItem,
  kMenuItemCheckBox,
  kMenuItemRadio,
  kMenuListOption,
  kMenuListPopup,
  kMeter,
  kNavigation,
  kNote,
  kPane,
  kParagraph,
  kPdfActionableHighlight,
  kPdfRoot,
  kPluginObject,
  kPopUpButton,
  kPortal,
  kPre,
  kPresentational,
  kProgressIndicator,
  kRadioButton,
  kRadioGroup,
  kRegion,
  kRootWebArea,
  kRow,
  kRowGroup,
  kRowHeader,
  kRuby,
  kRubyAnnotation,
  kScrollBar,
  kScrollView,
  kSearch,
  kSearchBox,
  kSection,
  kSlider,
  kSpinButton,
  kSplitter,
  kStaticText,
  kStatus,
  kStrong,
  kSuggestion,
  kSvgRoot,
  kSwitch,
  kTab,
  kTabList,
  kTabPanel,
  kTable,
  kTableHeaderContainer,
  kTerm,
  kTextField,
  kTextFieldWithComboBox,
  kTime,
  kTimer,
  kTitleBar,
  kToggleButton,
  kToolbar,
  kTooltip,
  kTree,
  kTreeGrid,
  kTreeItem,
  kUnknown,
  kVideo,
  kWebView,
  kWindow,
};

enum State {
  kNone,
  kAutofillAvailable,
  kCollapsed,
  kDefault,
  kEditable,
  kExpanded,
  kFocusable,
  // Grows horizontally, e.g. most toolbars and separators.
  kHorizontal,
  kHovered,
  // Skip over this node in the accessibility tree, but keep its subtree.
  kIgnored,
  kInvisible,
  kLinked,
  kMultiline,
  kMultiselectable,
  kProtected,
  kRequired,
  kRichlyEditable,
  // Grows vertically, e.g. menu or combo box.
  kVertical,
  kVisited,
};

// An action to be taken on an accessibility node.
// In contrast to |AXDefaultActionVerb|, these describe what happens to the
// object, e.g. "FOCUS".
enum Action {
  kNone,

  // Request image annotations for all the eligible images on a page.
  kAnnotatePageImages,

  kBlur,

  // Notifies a node that it no longer has accessibility focus.
  // Currently used only on Android and only internally, it's not
  // exposed to the open web. See kSetAccessibilityFocus, below.
  kClearAccessibilityFocus,

  // Collapse the collapsible node.
  kCollapse,

  kCustomAction,

  // Decrement a slider or range control by one step value.
  kDecrement,

  // Do the default action for an object, typically this means "click".
  kDoDefault,

  // Expand the expandable node.
  kExpand,

  kFocus,

  // Return the content of this image object in the image_data attribute.
  kGetImageData,

  // Gets the bounding rect for a range of text.
  kGetTextLocation,

  kHideTooltip,

  // Given a point, find the object it corresponds to and fire a
  // |AXActionData.hit_test_event_to_fire| event on it in response.
  kHitTest,

  // Increment a slider or range control by one step value.
  kIncrement,

  // For internal use only; signals to tree sources to invalidate an entire
  // tree.
  kInternalInvalidateTree,

  // Load inline text boxes for this subtree, providing information
  // about word boundaries, line layout, and individual character
  // bounding boxes.
  kLoadInlineTextBoxes,

  // Delete any selected text in the control's text value and
  // insert |AXActionData::value| in its place, like when typing or pasting.
  kReplaceSelectedText,

  // Scrolls by approximately one screen in a specific direction. Should be
  // called on a node that has scrollable boolean set to true.
  kScrollBackward,
  kScrollDown,
  kScrollForward,
  kScrollLeft,
  kScrollRight,
  kScrollUp,

  // Scroll any scrollable containers to make the target object visible
  // on the screen.  Optionally pass a subfocus rect in
  // AXActionData.target_rect, in node-local coordinates.
  kScrollToMakeVisible,

  // Scroll the given object to a specified point on the screen in
  // global screen coordinates. Pass a point in AXActionData.target_point.
  kScrollToPoint,

  // Notifies a node that it has accessibility focus.
  // Currently used only on Android and only internally, it's not
  // exposed to the open web. See kClearAccessibilityFocus, above.
  kSetAccessibilityFocus,

  kSetScrollOffset,
  kSetSelection,

  // Don't focus this node, but set it as the sequential focus navigation
  // starting point, so that pressing Tab moves to the next element
  // following this one, for example.
  kSetSequentialFocusNavigationStartingPoint,

  // Replace the value of the control with AXActionData::value and
  // reset the selection, if applicable.
  kSetValue,
  kShowContextMenu,

  // Send an event signaling the end of a test.
  kSignalEndOfTest,
  kShowTooltip,
};

enum ActionFlags {
  kNone,
  kRequestImages,
  kRequestInlineTextBoxes,
};

// A list of valid values for the horizontal and vertical scroll alignment
// arguments in |AXActionData|. These values control where a node is scrolled
// in the viewport.
enum ScrollAlignment {
  kNone,
  kScrollAlignmentCenter,
  kScrollAlignmentTop,
  kScrollAlignmentBottom,
  kScrollAlignmentLeft,
  kScrollAlignmentRight,
  kScrollAlignmentClosestEdge
};

// A list of valid values for the scroll behavior argument to argument in
// |AXActionData|. These values control whether a node is scrolled in the
// viewport if it is already visible.
enum ScrollBehavior {
  kNone,
  kDoNotScrollIfVisible,
  kScrollIfVisible,
};

// A list of valid values for the |AXIntAttribute| |default_action_verb|.
// These will describe the action that will be performed on a given node when
// executing the default action, which is a click.
// In contrast to |AXAction|, these describe what the user can do on the
// object, e.g. "PRESS", not what happens to the object as a result.
// Only one verb can be used at a time to describe the default action.
enum DefaultActionVerb {
  kNone,
  kActivate,
  kCheck,
  kClick,

  // A click will be performed on one of the node's ancestors.
  // This happens when the node itself is not clickable, but one of its
  // ancestors has click handlers attached which are able to capture the click
  // as it bubbles up.
  kClickAncestor,

  kJump,
  kOpen,
  kPress,
  kSelect,
  kUncheck,
};

// A change to the accessibility tree.
enum Mutation {
  kNone,
  kNodeCreated,
  kSubtreeCreated,
  kNodeChanged,
  kNodeRemoved,
};

enum StringAttribute {
  kNone,
  kAccessKey,
  // Only used when invalid_state == invalid_state_other.
  kAriaInvalidValue,
  kAutoComplete,
  kCheckedStateDescription,
  kChildTreeId,
  kClassName,
  kContainerLiveRelevant,
  kContainerLiveStatus,
  kDescription,
  kDisplay,
  // Only present when different from parent.
  kFontFamily,
  kHtmlTag,
  // Stores an automatic image annotation if one is available. Only valid on
  // ax::mojom::Role::kImage. See kImageAnnotationStatus, too.
  kImageAnnotation,
  kImageDataUrl,
  kInnerHtml,
  kInputType,
  kKeyShortcuts,
  // Only present when different from parent.
  kLanguage,
  kName,
  kLiveRelevant,
  kLiveStatus,
  // Only if not already exposed in kName (NameFrom::kPlaceholder)
  kPlaceholder,
  kRole,
  kRoleDescription,
  // Only if not already exposed in kName (NameFrom::kTitle)
  kTooltip,
  kUrl,
  kValue,
  // TODO(bebeaudr): kAriaVirtualContent is currently a string attribute to
  // facilitate prototyping. Make it an enum when we're done prototyping.
  kVirtualContent,
};

enum IntAttribute {
  kNone,
  kDefaultActionVerb,
  // Scrollable container attributes.
  kScrollX,
  kScrollXMin,
  kScrollXMax,
  kScrollY,
  kScrollYMin,
  kScrollYMax,

  // Attributes for retrieving the endpoints of a selection.
  kTextSelStart,
  kTextSelEnd,

  // aria_col* and aria_row* attributes
  kAriaColumnCount,
  kAriaCellColumnIndex,
  kAriaCellColumnSpan,
  kAriaRowCount,
  kAriaCellRowIndex,
  kAriaCellRowSpan,

  // Table attributes.
  kTableRowCount,
  kTableColumnCount,
  kTableHeaderId,

  // Table row attributes.
  kTableRowIndex,
  kTableRowHeaderId,

  // Table column attributes.
  kTableColumnIndex,
  kTableColumnHeaderId,

  // Table cell attributes.
  kTableCellColumnIndex,
  kTableCellColumnSpan,
  kTableCellRowIndex,
  kTableCellRowSpan,
  kSortDirection,

  // Tree control attributes.
  kHierarchicalLevel,

  // What information was used to compute the object's name
  // (of type AXNameFrom).
  kNameFrom,

  // What information was used to compute the object's description
  // (of type AXDescriptionFrom).
  kDescriptionFrom,

  // Relationships between this element and other elements.
  kActivedescendantId,
  kErrormessageId,
  kInPageLinkTargetId,
  kMemberOfId,
  kNextOnLineId,
  kPopupForId,
  kPreviousOnLineId,

  // Input restriction, if any, such as readonly or disabled.
  // Of type AXRestriction, see below.
  // No value or enabled control or other object that is not disabled.
  kRestriction,

  // Position or Number of items in current set of listitems or treeitems
  kSetSize,
  kPosInSet,

  // In the case of Role::kColorWell, specifies the selected color.
  kColorValue,

  // Indicates the element that represents the current item within a container
  // or set of related elements.
  kAriaCurrentState,

  // Text attributes.

  // Foreground and background color in RGBA.
  kBackgroundColor,
  kColor,

  kHasPopup,

  // Image annotation status, of type ImageAnnotationStatus.
  kImageAnnotationStatus,

  // Indicates if a form control has invalid input or
  // if an element has an aria-invalid attribute.
  kInvalidState,

  // Of type AXCheckedState
  kCheckedState,

  // The list style type. Only available on list items.
  kListStyle,

  // Specifies the alignment of the text, e.g. left, center, right, justify
  kTextAlign,

  // Specifies the direction of the text, e.g., right-to-left.
  kTextDirection,

  // Specifies the position of the text, e.g., subscript.
  kTextPosition,

  // Bold, italic, underline, etc.
  kTextStyle,

  // The overline text decoration style.
  kTextOverlineStyle,

  // The strikethrough text decoration style.
  kTextStrikethroughStyle,

  // The underline text decoration style.
  kTextUnderlineStyle,

  // Focus traversal in views and Android.
  kPreviousFocusId,
  kNextFocusId,

  // For indicating what functions can be performed when a dragged object
  // is released on the drop target.
  // Note: aria-dropeffect is deprecated in WAI-ARIA 1.1.
  kDropeffect,

  // The DOMNodeID from Blink. Currently only populated when using
  // the accessibility tree for PDF exporting. Warning, this is totally
  // unrelated to the accessibility node ID, or the ID attribute for an
  // HTML element - it's an ID used to uniquely identify nodes in Blink.
  kDOMNodeId,
};

enum FloatAttribute {
  kNone,
  // Range attributes.
  kValueForRange,
  kMinValueForRange,
  kMaxValueForRange,
  kStepValueForRange,

  // Text attributes.
  // Font size is in pixels.
  kFontSize,

  // Font weight can take on any arbitrary numeric value. Increments of 100 in
  // range [0, 900] represent keywords such as light, normal, bold, etc. 0 is
  // the default.
  kFontWeight,

  // The text indent of the text, in mm.
  kTextIndent,
};

// These attributes can take three states:
// true, false, or undefined/unset.
//
// Some attributes are only ever true or unset. In these cases, undefined is
// equivalent to false. In other attributes, all three states have meaning.
//
// Finally, note that different tree sources can use all three states for a
// given attribute, while another tree source only uses two.
enum BoolAttribute {
  kNone,

  // Generic busy state, does not have to be on a live region.
  kBusy,

  // The object is at the root of an editable field, such as a content
  // editable.
  kEditableRoot,

  // Live region attributes.
  kContainerLiveAtomic,
  kContainerLiveBusy,
  kLiveAtomic,

  // If a dialog box is marked as explicitly modal
  kModal,

  // If this is set, all of the other fields in this struct should
  // be ignored and only the locations should change.
  kUpdateLocationOnly,

  // Set on a canvas element if it has fallback content.
  kCanvasHasFallback,

  // Indicates this node is user-scrollable, e.g. overflow:scroll|auto, as
  // opposed to only programmatically scrollable, like overflow:hidden, or
  // not scrollable at all, e.g. overflow:visible.
  kScrollable,

  // A hint to clients that the node is clickable.
  kClickable,

  // Indicates that this node clips its children, i.e. may have
  // overflow: hidden or clip children by default.
  kClipsChildren,

  // Indicates that this node is not selectable because the style has
  // user-select: none. Note that there may be other reasons why a node is
  // not selectable - for example, bullets in a list. However, this attribute
  // is only set on user-select: none.
  kNotUserSelectableStyle,

  // Indicates whether this node is selected or unselected.
  kSelected,

  // Indicates whether this node is selected due to selection follows focus.
  kSelectedFromFocus,

  // Indicates whether this node supports text location.
  kSupportsTextLocation,

  // Indicates whether this node can be grabbed for drag-and-drop operation.
  // Note: aria-grabbed is deprecated in WAI-ARIA 1.1.
  kGrabbed,

  // Indicates whether this node causes a hard line-break
  // (e.g. block level elements, or <br>)
  kIsLineBreakingObject,

  // Indicates whether this node causes a page break
  kIsPageBreakingObject,

  // True if the node has any ARIA attributes set.
  kHasAriaAttribute,

  // This element allows touches to be passed through when a screen reader
  // is in touch exploration mode, e.g. a virtual keyboard normally
  // behaves this way.
  kTouchPassthrough,
};

enum IntListAttribute {
  kNone,
  // Ids of nodes that are children of this node logically, but are
  // not children of this node in the tree structure. As an example,
  // a table cell is a child of a row, and an 'indirect' child of a
  // column.
  kIndirectChildIds,

  // Relationships between this element and other elements.
  kControlsIds,
  kDetailsIds,
  kDescribedbyIds,
  kFlowtoIds,
  kLabelledbyIds,
  kRadioGroupIds,

  // For static text. These int lists must be the same size; they represent
  // the start and end character offset of each marker. Examples of markers
  // include spelling and grammar errors, and find-in-page matches.
  kMarkerTypes,
  kMarkerStarts,
  kMarkerEnds,

  // For inline text. This is the pixel position of the end of this
  // character within the bounding rectangle of this object, in the
  // direction given by StringAttribute::kTextDirection. For example,
  // for left-to-right text, the first offset is the right coordinate of
  // the first character within the object's bounds, the second offset
  // is the right coordinate of the second character, and so on.
  kCharacterOffsets,

  // Used for caching. Do not read directly. Use
  // |AXNode::GetOrComputeLineStartOffsets|
  // For all text fields and content editable roots: A list of the start
  // offsets of each line inside this object.
  kCachedLineStarts,

  // For inline text. These int lists must be the same size; they represent
  // the start and end character offset of each word within this text.
  kWordStarts,
  kWordEnds,

  // Used for an UI element to define custom actions for it. For example, a
  // list UI will allow a user to reorder items in the list by dragging the
  // items. Developer can expose those actions as custom actions. Currently
  // custom actions are used only in Android window.
  kCustomActionIds,
};

enum StringListAttribute {
  kNone,
  // Descriptions for custom actions. This must be aligned with
  // custom_action_ids.
  kCustomActionDescriptions,
};

enum ListStyle {
  kNone,
  kCircle,
  kDisc,
  kImage,
  kNumeric,
  kSquare,
  kOther, // Language specific ordering (alpha, roman, cjk-ideographic, etc...)
};

enum MarkerType {
  kNone = 0,
  kSpelling = 1,
  kGrammar = 2,
  kTextMatch = 4,
  // DocumentMarker::MarkerType::Composition = 8 is ignored for accessibility
  // purposes
  kActiveSuggestion = 16,
  kSuggestion = 32,
};

// Describes a move direction in the accessibility tree that is independent of
// the left-to-right or right-to-left direction of the text. For example, a
// forward movement will always move to the next node in depth-first pre-order
// traversal.
enum MoveDirection {
  kNone,
  kBackward,
  kForward
};

// Describes the edit or selection command that resulted in a selection, a text
// changed or a text attributes changed event.
//
// An edit command, such as "kInsert" or "kDelete" is further described by its
// "InputEvent" - see the relevant enum in this file.
// A selection command may be further described by its "TextBoundary" and
// "MoveDirection" - see the relevant enums in this file.
enum Command {
  kNone,
  kClearSelection,
  kDelete,
  kDictate,
  kExtendSelection,  // The existing selection has been extended or shrunk.
  kFormat,  // Some text attributes, such as font weight, have changed.
  kHistory,  // An undo or a redo operation has been performed.
  kInsert,
  kMarker,  // Document markers have been added or removed.
  kMoveSelection,  // The selection has been moved by a specific granularity.
  kSetSelection  // A completely new selection has been set.
};

// Describes an edit command in more detail.
//
// Please keep in sync with the following specification and file:
// https://w3c.github.io/input-events/#h-interface-inputevent-attributes
// //third_party/blink/renderer/core/events/input_event.h
enum InputEventType {
  kNone,
  // Insertion.
  kInsertText,
  kInsertLineBreak,
  kInsertParagraph,
  kInsertOrderedList,
  kInsertUnorderedList,
  kInsertHorizontalRule,
  kInsertFromPaste,
  kInsertFromDrop,
  kInsertFromYank,
  kInsertTranspose,
  kInsertReplacementText,
  kInsertCompositionText,
  // Deletion.
  kDeleteWordBackward,
  kDeleteWordForward,
  kDeleteSoftLineBackward,
  kDeleteSoftLineForward,
  kDeleteHardLineBackward,
  kDeleteHardLineForward,
  kDeleteContentBackward,
  kDeleteContentForward,
  kDeleteByCut,
  kDeleteByDrag,
  // History.
  kHistoryUndo,
  kHistoryRedo,
  // Formatting.
  kFormatBold,
  kFormatItalic,
  kFormatUnderline,
  kFormatStrikeThrough,
  kFormatSuperscript,
  kFormatSubscript,
  kFormatJustifyCenter,
  kFormatJustifyFull,
  kFormatJustifyRight,
  kFormatJustifyLeft,
  kFormatIndent,
  kFormatOutdent,
  kFormatRemove,
  kFormatSetBlockTextDirection
};

// Defines a set of text boundaries in the accessibility tree.
//
// Most boundaries come in three flavors: A "WordStartOrEnd" boundary for
// example differs from a "WordStart" or a "WordEnd" boundary in that the first
// would consider both the start and the end of the word to be boundaries, while
// the other two would consider only the start or the end respectively.
//
// An "Object" boundary is found at the start or end of a node's entire text,
// e.g. at the start or end of a text field.
//
// TODO(nektar): Split TextBoundary into TextUnit and TextBoundary.
enum TextBoundary {
  kNone,
  kCharacter,
  kFormat,
  kLineEnd,
  kLineStart,
  kLineStartOrEnd,
  kObject,
  kPageEnd,
  kPageStart,
  kPageStartOrEnd,
  kParagraphEnd,
  kParagraphStart,
  kParagraphStartOrEnd,
  kSentenceEnd,
  kSentenceStart,
  kSentenceStartOrEnd,
  kWebPage,
  kWordEnd,
  kWordStart,
  kWordStartOrEnd
};

// Types of text alignment according to the IAccessible2 Object Attributes spec.
enum TextAlign {
  kNone,
  kLeft,
  kRight,
  kCenter,
  kJustify,
};

enum WritingDirection {
  kNone,
  kLtr,
  kRtl,
  kTtb,
  kBtt,
};

enum TextPosition {
  kNone,
  kSubscript,
  kSuperscript,
};

// A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.accessibility
enum TextStyle {
  kBold,
  kItalic,
  kUnderline,
  kLineThrough,
  kOverline,
  kNone
};

enum TextDecorationStyle {
  kNone,
  kDotted,
  kDashed,
  kSolid,
  kDouble,
  kWavy,
};

enum AriaCurrentState {
  kNone,
  kFalse,
  kTrue,
  kPage,
  kStep,
  kLocation,
  kDate,
  kTime,
};

enum HasPopup {
  kFalse = 0,
  kTrue,
  kMenu,
  kListbox,
  kTree,
  kGrid,
  kDialog,
  kNone = kFalse
};

enum InvalidState {
  kNone,
  kFalse,
  kTrue,
  kOther,
};

// Input restriction associated with an object.
// No value for a control means it is enabled.
// Use read_only for a textbox that allows focus/selection but not input.
// Use disabled for a control or group of controls that disallows input.
enum Restriction {
  kNone,
  kReadOnly,
  kDisabled,
};

enum CheckedState {
  kNone,
  kFalse,
  kTrue,
  kMixed,
};

enum SortDirection {
  kNone,
  kUnsorted,
  kAscending,
  kDescending,
  kOther,
};

enum NameFrom {
  kNone,
  kUninitialized,
  kAttribute,  // E.g. aria-label.
  kAttributeExplicitlyEmpty,
  kCaption,  // E.g. in the case of a table, from a caption element.
  kContents,
  kPlaceholder,  // E.g. from an HTML placeholder attribute on a text field.
  kRelatedElement, // E.g. from a figcaption Element in a figure.
  kTitle,  // E.g. <input type="text" title="title">.
  kValue,  // E.g. <input type="button" value="Button's name">.
};

enum DescriptionFrom {
  kNone,
  kUninitialized,
  kAttribute,
  kContents,
  kRelatedElement,
  kTitle,
};

enum EventFrom {
  kNone,
  kUser,
  kPage,
  kAction,
};

// Touch gestures on Chrome OS.
enum Gesture {
  kNone,
  kClick,
  kSwipeLeft1,
  kSwipeUp1,
  kSwipeRight1,
  kSwipeDown1,
  kSwipeLeft2,
  kSwipeUp2,
  kSwipeRight2,
  kSwipeDown2,
  kSwipeLeft3,
  kSwipeUp3,
  kSwipeRight3,
  kSwipeDown3,
  kSwipeLeft4,
  kSwipeUp4,
  kSwipeRight4,
  kSwipeDown4,
  kTap2,
  kTap3,
  kTap4,
  kTouchExplore,
};

enum TextAffinity {
  kNone,
  kDownstream,
  kUpstream,
};

// Compares two nodes in an accessibility tree in pre-order traversal.
enum TreeOrder {
  kNone,
  // Not in the same tree, or other error.
  kUndefined,

  // First node is before the second one.
  kBefore,

  // Nodes are the same.
  kEqual,

  // First node is after the second one.
  kAfter,
};

// For internal use by ui::AXTreeID / ax::mojom::AXTreeID.
enum AXTreeIDType {
  kUnknown,  // The Tree ID is unknown.
  kToken,    // Every other tree ID must have a valid unguessable token.
};

enum ImageAnnotationStatus {
  // Not an image, or image annotation feature not enabled.
  kNone,

  // Not eligible due to the scheme of the page. Image annotations are only
  // generated for images on http, https, file and data URLs.
  kWillNotAnnotateDueToScheme,

  // Not loaded yet, already labeled by the author, or not eligible
  // due to size, type, etc.
  kIneligibleForAnnotation,

  // Eligible to be automatically annotated if the user requests it.
  // This is communicated to the user via a tutor message.
  kEligibleForAnnotation,

  // Eligible to be automatically annotated but this is not communicated to the
  // user.
  kSilentlyEligibleForAnnotation,

  // An annotation has been requested but has not been received yet.
  kAnnotationPending,

  // An annotation has been provided and kImageAnnotation contains the
  // annotation text.
  kAnnotationSucceeded,

  // The annotation request was processed successfully, but it was not
  // possible to come up with an annotation for this image.
  kAnnotationEmpty,

  // The image is classified as adult content and no annotation will
  // be generated.
  kAnnotationAdult,

  // The annotation process failed, e.g. unable to contact the server,
  // request timed out, etc.
  kAnnotationProcessFailed,
};

enum Dropeffect {
  kNone,
  kCopy,
  kExecute,
  kLink,
  kMove,
  kPopup,
};