Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObjectImpl.h

Issue 2876453003: Move enums from AXObjectImpl to AXObject (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 class IntPoint; 52 class IntPoint;
53 class Node; 53 class Node;
54 class LayoutObject; 54 class LayoutObject;
55 class ScrollableArea; 55 class ScrollableArea;
56 56
57 enum class AOMBooleanProperty; 57 enum class AOMBooleanProperty;
58 enum class AOMStringProperty; 58 enum class AOMStringProperty;
59 59
60 typedef unsigned AXID; 60 typedef unsigned AXID;
61 61
62 enum AccessibilityRole {
63 kUnknownRole = 0, // Not mapped in platform APIs, generally indicates a bug
64 kAbbrRole, // No mapping to ARIA role.
65 kAlertDialogRole,
66 kAlertRole,
67 kAnchorRole, // No mapping to ARIA role.
68 kAnnotationRole, // No mapping to ARIA role.
69 kApplicationRole,
70 kArticleRole,
71 kAudioRole, // No mapping to ARIA role.
72 kBannerRole,
73 kBlockquoteRole, // No mapping to ARIA role.
74 kBusyIndicatorRole, // No mapping to ARIA role.
75 kButtonRole,
76 kCanvasRole, // No mapping to ARIA role.
77 kCaptionRole, // No mapping to ARIA role.
78 kCellRole,
79 kCheckBoxRole,
80 kColorWellRole, // No mapping to ARIA role.
81 kColumnHeaderRole,
82 kColumnRole, // No mapping to ARIA role.
83 kComboBoxRole,
84 kComplementaryRole,
85 kContentInfoRole,
86 kDateRole, // No mapping to ARIA role.
87 kDateTimeRole, // No mapping to ARIA role.
88 kDefinitionRole,
89 kDescriptionListDetailRole, // No mapping to ARIA role.
90 kDescriptionListRole, // No mapping to ARIA role.
91 kDescriptionListTermRole, // No mapping to ARIA role.
92 kDetailsRole, // No mapping to ARIA role.
93 kDialogRole,
94 kDirectoryRole,
95 kDisclosureTriangleRole, // No mapping to ARIA role.
96 kDocumentRole,
97 kEmbeddedObjectRole, // No mapping to ARIA role.
98 kFeedRole,
99 kFigcaptionRole, // No mapping to ARIA role.
100 kFigureRole,
101 kFooterRole,
102 kFormRole,
103 kGenericContainerRole, // No role was defined for this container
104 kGridRole,
105 kGroupRole,
106 kHeadingRole,
107 kIframePresentationalRole, // No mapping to ARIA role.
108 kIframeRole, // No mapping to ARIA role.
109 kIgnoredRole, // No mapping to ARIA role.
110 kImageMapLinkRole, // No mapping to ARIA role.
111 kImageMapRole, // No mapping to ARIA role.
112 kImageRole,
113 kInlineTextBoxRole, // No mapping to ARIA role.
114 kInputTimeRole, // No mapping to ARIA role.
115 kLabelRole,
116 kLegendRole, // No mapping to ARIA role.
117 kLineBreakRole, // No mapping to ARIA role.
118 kLinkRole,
119 kListBoxOptionRole,
120 kListBoxRole,
121 kListItemRole,
122 kListMarkerRole, // No mapping to ARIA role.
123 kListRole,
124 kLogRole,
125 kMainRole,
126 kMarkRole, // No mapping to ARIA role.
127 kMarqueeRole,
128 kMathRole,
129 kMenuBarRole,
130 kMenuButtonRole,
131 kMenuItemRole,
132 kMenuItemCheckBoxRole,
133 kMenuItemRadioRole,
134 kMenuListOptionRole,
135 kMenuListPopupRole,
136 kMenuRole,
137 kMeterRole,
138 kNavigationRole,
139 kNoneRole, // ARIA role of "none"
140 kNoteRole,
141 kOutlineRole, // No mapping to ARIA role.
142 kParagraphRole, // No mapping to ARIA role.
143 kPopUpButtonRole,
144 kPreRole, // No mapping to ARIA role.
145 kPresentationalRole,
146 kProgressIndicatorRole,
147 kRadioButtonRole,
148 kRadioGroupRole,
149 kRegionRole,
150 kRootWebAreaRole, // No mapping to ARIA role.
151 kRowHeaderRole,
152 kRowRole,
153 kRubyRole, // No mapping to ARIA role.
154 kRulerRole, // No mapping to ARIA role.
155 kSVGRootRole, // No mapping to ARIA role.
156 kScrollAreaRole, // No mapping to ARIA role.
157 kScrollBarRole,
158 kSeamlessWebAreaRole, // No mapping to ARIA role.
159 kSearchRole,
160 kSearchBoxRole,
161 kSliderRole,
162 kSliderThumbRole, // No mapping to ARIA role.
163 kSpinButtonPartRole, // No mapping to ARIA role.
164 kSpinButtonRole,
165 kSplitterRole,
166 kStaticTextRole, // No mapping to ARIA role.
167 kStatusRole,
168 kSwitchRole,
169 kTabGroupRole, // No mapping to ARIA role.
170 kTabListRole,
171 kTabPanelRole,
172 kTabRole,
173 kTableHeaderContainerRole, // No mapping to ARIA role.
174 kTableRole,
175 kTermRole,
176 kTextFieldRole,
177 kTimeRole, // No mapping to ARIA role.
178 kTimerRole,
179 kToggleButtonRole,
180 kToolbarRole,
181 kTreeGridRole,
182 kTreeItemRole,
183 kTreeRole,
184 kUserInterfaceTooltipRole,
185 kVideoRole, // No mapping to ARIA role.
186 kWebAreaRole, // No mapping to ARIA role.
187 kWindowRole, // No mapping to ARIA role.
188 kNumRoles
189 };
190
191 enum AccessibilityTextSource { 62 enum AccessibilityTextSource {
192 kAlternativeText, 63 kAlternativeText,
193 kChildrenText, 64 kChildrenText,
194 kSummaryText, 65 kSummaryText,
195 kHelpText, 66 kHelpText,
196 kVisibleText, 67 kVisibleText,
197 kTitleTagText, 68 kTitleTagText,
198 kPlaceholderText, 69 kPlaceholderText,
199 kLabelByElementText, 70 kLabelByElementText,
200 }; 71 };
201 72
202 enum AccessibilityState {
203 kAXBusyState,
204 kAXCheckedState,
205 kAXEnabledState,
206 kAXExpandedState,
207 kAXFocusableState,
208 kAXFocusedState,
209 kAXHaspopupState,
210 kAXHoveredState,
211 kAXInvisibleState,
212 kAXLinkedState,
213 kAXMultilineState,
214 kAXMultiselectableState,
215 kAXOffscreenState,
216 kAXPressedState,
217 kAXProtectedState,
218 kAXReadonlyState,
219 kAXRequiredState,
220 kAXSelectableState,
221 kAXSelectedState,
222 kAXVerticalState,
223 kAXVisitedState
224 };
225
226 class AccessibilityText final 73 class AccessibilityText final
227 : public GarbageCollectedFinalized<AccessibilityText> { 74 : public GarbageCollectedFinalized<AccessibilityText> {
228 WTF_MAKE_NONCOPYABLE(AccessibilityText); 75 WTF_MAKE_NONCOPYABLE(AccessibilityText);
229 76
230 public: 77 public:
231 DEFINE_INLINE_TRACE() { visitor->Trace(text_element_); } 78 DEFINE_INLINE_TRACE() { visitor->Trace(text_element_); }
232 79
233 private: 80 private:
234 AccessibilityText(const String& text, 81 AccessibilityText(const String& text,
235 const AccessibilityTextSource& source, 82 const AccessibilityTextSource& source,
236 AXObjectImpl* element) 83 AXObjectImpl* element)
237 : text_(text), text_element_(element) {} 84 : text_(text), text_element_(element) {}
238 85
239 String text_; 86 String text_;
240 Member<AXObjectImpl> text_element_; 87 Member<AXObjectImpl> text_element_;
241 }; 88 };
242 89
243 enum AccessibilityOrientation {
244 kAccessibilityOrientationUndefined = 0,
245 kAccessibilityOrientationVertical,
246 kAccessibilityOrientationHorizontal,
247 };
248
249 enum AXObjectInclusion { 90 enum AXObjectInclusion {
250 kIncludeObject, 91 kIncludeObject,
251 kIgnoreObject, 92 kIgnoreObject,
252 kDefaultBehavior, 93 kDefaultBehavior,
253 }; 94 };
254 95
255 enum class AXDefaultActionVerb {
256 kNone = 0,
257 kActivate,
258 kCheck,
259 kClick,
260 kJump,
261 kOpen,
262 kPress,
263 kSelect,
264 kUncheck
265 };
266
267 enum AccessibilityButtonState { 96 enum AccessibilityButtonState {
268 kButtonStateOff = 0, 97 kButtonStateOff = 0,
269 kButtonStateOn, 98 kButtonStateOn,
270 kButtonStateMixed, 99 kButtonStateMixed,
271 }; 100 };
272 101
273 enum AccessibilityTextDirection {
274 kAccessibilityTextDirectionLTR,
275 kAccessibilityTextDirectionRTL,
276 kAccessibilityTextDirectionTTB,
277 kAccessibilityTextDirectionBTT
278 };
279
280 enum SortDirection {
281 kSortDirectionUndefined = 0,
282 kSortDirectionNone,
283 kSortDirectionAscending,
284 kSortDirectionDescending,
285 kSortDirectionOther
286 };
287
288 enum AccessibilityExpanded {
289 kExpandedUndefined = 0,
290 kExpandedCollapsed,
291 kExpandedExpanded,
292 };
293
294 enum AccessibilityOptionalBool { 102 enum AccessibilityOptionalBool {
295 kOptionalBoolUndefined = 0, 103 kOptionalBoolUndefined = 0,
296 kOptionalBoolTrue, 104 kOptionalBoolTrue,
297 kOptionalBoolFalse 105 kOptionalBoolFalse
298 }; 106 };
299 107
300 enum AriaCurrentState {
301 kAriaCurrentStateUndefined = 0,
302 kAriaCurrentStateFalse,
303 kAriaCurrentStateTrue,
304 kAriaCurrentStatePage,
305 kAriaCurrentStateStep,
306 kAriaCurrentStateLocation,
307 kAriaCurrentStateDate,
308 kAriaCurrentStateTime
309 };
310
311 enum InvalidState {
312 kInvalidStateUndefined = 0,
313 kInvalidStateFalse,
314 kInvalidStateTrue,
315 kInvalidStateSpelling,
316 kInvalidStateGrammar,
317 kInvalidStateOther
318 };
319
320 enum TextStyle {
321 kTextStyleNone = 0,
322 kTextStyleBold = 1 << 0,
323 kTextStyleItalic = 1 << 1,
324 kTextStyleUnderline = 1 << 2,
325 kTextStyleLineThrough = 1 << 3
326 };
327
328 enum TextUnderElementMode { 108 enum TextUnderElementMode {
329 kTextUnderElementAll, 109 kTextUnderElementAll,
330 kTextUnderElementAny // If the text is unimportant, just whether or not it's 110 kTextUnderElementAny // If the text is unimportant, just whether or not it's
331 // present 111 // present
332 }; 112 };
333 113
334 enum class AXBoolAttribute {}; 114 enum class AXBoolAttribute {};
335 115
336 enum class AXStringAttribute {
337 kAriaKeyShortcuts,
338 kAriaRoleDescription,
339 };
340
341 enum class AXObjectAttribute {
342 kAriaActiveDescendant,
343 kAriaErrorMessage,
344 };
345
346 enum class AXObjectVectorAttribute {
347 kAriaControls,
348 kAriaDetails,
349 kAriaFlowTo,
350 };
351
352 class AXSparseAttributeClient { 116 class AXSparseAttributeClient {
353 public: 117 public:
354 virtual void AddBoolAttribute(AXBoolAttribute, bool) = 0; 118 virtual void AddBoolAttribute(AXBoolAttribute, bool) = 0;
355 virtual void AddStringAttribute(AXStringAttribute, const String&) = 0; 119 virtual void AddStringAttribute(AXStringAttribute, const String&) = 0;
356 virtual void AddObjectAttribute(AXObjectAttribute, AXObjectImpl&) = 0; 120 virtual void AddObjectAttribute(AXObjectAttribute, AXObjectImpl&) = 0;
357 virtual void AddObjectVectorAttribute(AXObjectVectorAttribute, 121 virtual void AddObjectVectorAttribute(AXObjectVectorAttribute,
358 HeapVector<Member<AXObjectImpl>>&) = 0; 122 HeapVector<Member<AXObjectImpl>>&) = 0;
359 }; 123 };
360 124
361 // The source of the accessible name of an element. This is needed
362 // because on some platforms this determines how the accessible name
363 // is exposed.
364 enum AXNameFrom {
365 kAXNameFromUninitialized = -1,
366 kAXNameFromAttribute = 0,
367 kAXNameFromAttributeExplicitlyEmpty,
368 kAXNameFromCaption,
369 kAXNameFromContents,
370 kAXNameFromPlaceholder,
371 kAXNameFromRelatedElement,
372 kAXNameFromValue,
373 kAXNameFromTitle,
374 };
375
376 // The potential native HTML-based text (name, description or placeholder) 125 // The potential native HTML-based text (name, description or placeholder)
377 // sources for an element. See 126 // sources for an element. See
378 // http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and- description-calculation 127 // http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and- description-calculation
379 enum AXTextFromNativeHTML { 128 enum AXTextFromNativeHTML {
380 kAXTextFromNativeHTMLUninitialized = -1, 129 kAXTextFromNativeHTMLUninitialized = -1,
381 kAXTextFromNativeHTMLFigcaption, 130 kAXTextFromNativeHTMLFigcaption,
382 kAXTextFromNativeHTMLLabel, 131 kAXTextFromNativeHTMLLabel,
383 kAXTextFromNativeHTMLLabelFor, 132 kAXTextFromNativeHTMLLabelFor,
384 kAXTextFromNativeHTMLLabelWrapped, 133 kAXTextFromNativeHTMLLabelWrapped,
385 kAXTextFromNativeHTMLLegend, 134 kAXTextFromNativeHTMLLegend,
386 kAXTextFromNativeHTMLTableCaption, 135 kAXTextFromNativeHTMLTableCaption,
387 kAXTextFromNativeHTMLTitleElement, 136 kAXTextFromNativeHTMLTitleElement,
388 }; 137 };
389 138
390 // The source of the accessible description of an element. This is needed
391 // because on some platforms this determines how the accessible description
392 // is exposed.
393 enum AXDescriptionFrom {
394 kAXDescriptionFromUninitialized = -1,
395 kAXDescriptionFromAttribute = 0,
396 kAXDescriptionFromContents,
397 kAXDescriptionFromRelatedElement,
398 };
399
400 enum AXIgnoredReason { 139 enum AXIgnoredReason {
401 kAXActiveModalDialog, 140 kAXActiveModalDialog,
402 kAXAncestorDisallowsChild, 141 kAXAncestorDisallowsChild,
403 kAXAncestorIsLeafNode, 142 kAXAncestorIsLeafNode,
404 kAXAriaHidden, 143 kAXAriaHidden,
405 kAXAriaHiddenRoot, 144 kAXAriaHiddenRoot,
406 kAXEmptyAlt, 145 kAXEmptyAlt,
407 kAXEmptyText, 146 kAXEmptyText,
408 kAXInert, 147 kAXInert,
409 kAXInheritsPresentation, 148 kAXInheritsPresentation,
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 881
1143 DEFINE_TYPE_CASTS(AXObjectImpl, AXObject, obj, true, true); 882 DEFINE_TYPE_CASTS(AXObjectImpl, AXObject, obj, true, true);
1144 883
1145 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 884 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
1146 DEFINE_TYPE_CASTS(thisType, AXObjectImpl, object, object->predicate, \ 885 DEFINE_TYPE_CASTS(thisType, AXObjectImpl, object, object->predicate, \
1147 object.predicate) 886 object.predicate)
1148 887
1149 } // namespace blink 888 } // namespace blink
1150 889
1151 #endif // AXObjectImpl_h 890 #endif // AXObjectImpl_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/AXObject.h ('k') | third_party/WebKit/Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698