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

Side by Side Diff: third_party/WebKit/public/web/WebAXObject.h

Issue 2589273002: Add sparse accessibility attribute interface to Blink (Closed)
Patch Set: Address feedback Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/public/web/WebAXEnums.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class WebAXObject; 48 class WebAXObject;
49 class WebNode; 49 class WebNode;
50 class WebDocument; 50 class WebDocument;
51 class WebString; 51 class WebString;
52 class WebURL; 52 class WebURL;
53 struct WebFloatRect; 53 struct WebFloatRect;
54 struct WebPoint; 54 struct WebPoint;
55 struct WebRect; 55 struct WebRect;
56 struct WebSize; 56 struct WebSize;
57 57
58 class BLINK_EXPORT WebAXSparseAttributeClient {
59 public:
60 WebAXSparseAttributeClient() {}
61 virtual ~WebAXSparseAttributeClient() {}
62
63 virtual void addBoolAttribute(WebAXBoolAttribute, bool) = 0;
64 virtual void addStringAttribute(WebAXStringAttribute, const WebString&) = 0;
65 virtual void addObjectAttribute(WebAXObjectAttribute, const WebAXObject&) = 0;
66 virtual void addObjectVectorAttribute(WebAXObjectVectorAttribute,
67 const WebVector<WebAXObject>&) = 0;
68 };
69
58 // An instance of this class, while kept alive, indicates that accessibility 70 // An instance of this class, while kept alive, indicates that accessibility
59 // should be temporarily enabled. If accessibility was enabled globally 71 // should be temporarily enabled. If accessibility was enabled globally
60 // (WebSettings::setAccessibilityEnabled), this will have no effect. 72 // (WebSettings::setAccessibilityEnabled), this will have no effect.
61 class WebScopedAXContext { 73 class WebScopedAXContext {
62 public: 74 public:
63 BLINK_EXPORT WebScopedAXContext(WebDocument& rootDocument); 75 BLINK_EXPORT WebScopedAXContext(WebDocument& rootDocument);
64 BLINK_EXPORT ~WebScopedAXContext(); 76 BLINK_EXPORT ~WebScopedAXContext();
65 77
66 BLINK_EXPORT WebAXObject root() const; 78 BLINK_EXPORT WebAXObject root() const;
67 79
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // still valid (not detached). Note that calling this method 112 // still valid (not detached). Note that calling this method
101 // can cause other WebAXObjects to become invalid, too, 113 // can cause other WebAXObjects to become invalid, too,
102 // so always call isDetached if any other WebCore code has run. 114 // so always call isDetached if any other WebCore code has run.
103 BLINK_EXPORT bool updateLayoutAndCheckValidity(); 115 BLINK_EXPORT bool updateLayoutAndCheckValidity();
104 116
105 BLINK_EXPORT unsigned childCount() const; 117 BLINK_EXPORT unsigned childCount() const;
106 118
107 BLINK_EXPORT WebAXObject childAt(unsigned) const; 119 BLINK_EXPORT WebAXObject childAt(unsigned) const;
108 BLINK_EXPORT WebAXObject parentObject() const; 120 BLINK_EXPORT WebAXObject parentObject() const;
109 121
122 // Retrieve accessibility attributes that apply to only a small
123 // fraction of WebAXObjects by passing an implementation of
124 // WebAXSparseAttributeClient, which will be called with only the attributes
125 // that apply to this object.
126 BLINK_EXPORT void getSparseAXAttributes(WebAXSparseAttributeClient&) const;
127
110 BLINK_EXPORT bool isAnchor() const; 128 BLINK_EXPORT bool isAnchor() const;
111 BLINK_EXPORT bool isAriaReadOnly() const; 129 BLINK_EXPORT bool isAriaReadOnly() const;
112 BLINK_EXPORT bool isButtonStateMixed() const; 130 BLINK_EXPORT bool isButtonStateMixed() const;
113 BLINK_EXPORT bool isChecked() const; 131 BLINK_EXPORT bool isChecked() const;
114 BLINK_EXPORT bool isClickable() const; 132 BLINK_EXPORT bool isClickable() const;
115 BLINK_EXPORT bool isCollapsed() const; 133 BLINK_EXPORT bool isCollapsed() const;
116 BLINK_EXPORT bool isControl() const; 134 BLINK_EXPORT bool isControl() const;
117 BLINK_EXPORT bool isEnabled() const; 135 BLINK_EXPORT bool isEnabled() const;
118 BLINK_EXPORT WebAXExpanded isExpanded() const; 136 BLINK_EXPORT WebAXExpanded isExpanded() const;
119 BLINK_EXPORT bool isFocused() const; 137 BLINK_EXPORT bool isFocused() const;
(...skipping 12 matching lines...) Expand all
132 BLINK_EXPORT bool isVisited() const; 150 BLINK_EXPORT bool isVisited() const;
133 151
134 BLINK_EXPORT WebString accessKey() const; 152 BLINK_EXPORT WebString accessKey() const;
135 BLINK_EXPORT unsigned backgroundColor() const; 153 BLINK_EXPORT unsigned backgroundColor() const;
136 BLINK_EXPORT unsigned color() const; 154 BLINK_EXPORT unsigned color() const;
137 // Deprecated. 155 // Deprecated.
138 BLINK_EXPORT void colorValue(int& r, int& g, int& b) const; 156 BLINK_EXPORT void colorValue(int& r, int& g, int& b) const;
139 BLINK_EXPORT unsigned colorValue() const; 157 BLINK_EXPORT unsigned colorValue() const;
140 BLINK_EXPORT WebAXObject ariaActiveDescendant() const; 158 BLINK_EXPORT WebAXObject ariaActiveDescendant() const;
141 BLINK_EXPORT WebString ariaAutoComplete() const; 159 BLINK_EXPORT WebString ariaAutoComplete() const;
142 BLINK_EXPORT bool ariaControls(
143 WebVector<WebAXObject>& controlsElements) const;
144 BLINK_EXPORT WebAXAriaCurrentState ariaCurrentState() const; 160 BLINK_EXPORT WebAXAriaCurrentState ariaCurrentState() const;
145 BLINK_EXPORT bool ariaFlowTo(WebVector<WebAXObject>& flowToElements) const;
146 BLINK_EXPORT bool ariaHasPopup() const; 161 BLINK_EXPORT bool ariaHasPopup() const;
147 BLINK_EXPORT bool isEditable() const; 162 BLINK_EXPORT bool isEditable() const;
148 BLINK_EXPORT bool isMultiline() const; 163 BLINK_EXPORT bool isMultiline() const;
149 BLINK_EXPORT bool isRichlyEditable() const; 164 BLINK_EXPORT bool isRichlyEditable() const;
150 BLINK_EXPORT bool ariaOwns(WebVector<WebAXObject>& ownsElements) const; 165 BLINK_EXPORT bool ariaOwns(WebVector<WebAXObject>& ownsElements) const;
151 BLINK_EXPORT WebString fontFamily() const; 166 BLINK_EXPORT WebString fontFamily() const;
152 BLINK_EXPORT float fontSize() const; 167 BLINK_EXPORT float fontSize() const;
153 BLINK_EXPORT bool canvasHasFallbackContent() const; 168 BLINK_EXPORT bool canvasHasFallbackContent() const;
154 // If this is an image, returns the image (scaled to maxSize) as a data url. 169 // If this is an image, returns the image (scaled to maxSize) as a data url.
155 BLINK_EXPORT WebString imageDataUrl(const WebSize& maxSize) const; 170 BLINK_EXPORT WebString imageDataUrl(const WebSize& maxSize) const;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 operator AXObject*() const; 355 operator AXObject*() const;
341 #endif 356 #endif
342 357
343 private: 358 private:
344 WebPrivatePtr<AXObject> m_private; 359 WebPrivatePtr<AXObject> m_private;
345 }; 360 };
346 361
347 } // namespace blink 362 } // namespace blink
348 363
349 #endif 364 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/public/web/WebAXEnums.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698