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

Side by Side Diff: Source/core/accessibility/AXObjectCache.h

Issue 495763005: Switch to using accessibilityEnabled and inlineTextBoxAccessibilityEnabled from settings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove cache->recomputeIsIgnored() calls from RenderBlockFlow; add TestExpectation for one failing … Created 6 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 25 matching lines...) Expand all
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class AbstractInlineTextBox; 39 class AbstractInlineTextBox;
40 class Document; 40 class Document;
41 class HTMLAreaElement; 41 class HTMLAreaElement;
42 class Node; 42 class Node;
43 class Page; 43 class Page;
44 class RenderObject; 44 class RenderObject;
45 class ScrollView; 45 class ScrollView;
46 class Settings;
46 class VisiblePosition; 47 class VisiblePosition;
47 class Widget; 48 class Widget;
48 49
49 struct TextMarkerData { 50 struct TextMarkerData {
50 AXID axID; 51 AXID axID;
51 Node* node; 52 Node* node;
52 int offset; 53 int offset;
53 EAffinity affinity; 54 EAffinity affinity;
54 }; 55 };
55 56
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 139
139 // Called when the scroll offset changes. 140 // Called when the scroll offset changes.
140 void handleScrollPositionChanged(ScrollView*); 141 void handleScrollPositionChanged(ScrollView*);
141 void handleScrollPositionChanged(RenderObject*); 142 void handleScrollPositionChanged(RenderObject*);
142 143
143 void handleAttributeChanged(const QualifiedName& attrName, Element*); 144 void handleAttributeChanged(const QualifiedName& attrName, Element*);
144 void recomputeIsIgnored(RenderObject* renderer); 145 void recomputeIsIgnored(RenderObject* renderer);
145 146
146 void inlineTextBoxesUpdated(RenderObject* renderer); 147 void inlineTextBoxesUpdated(RenderObject* renderer);
147 148
148 static void enableAccessibility() { gAccessibilityEnabled = true; } 149 bool accessibilityEnabled();
149 static bool accessibilityEnabled() { return gAccessibilityEnabled; } 150 bool inlineTextBoxAccessibilityEnabled();
150 static void setInlineTextBoxAccessibility(bool flag) { gInlineTextBoxAccessi bility = flag; }
151 static bool inlineTextBoxAccessibility() { return gInlineTextBoxAccessibilit y; }
152 151
153 void removeAXID(AXObject*); 152 void removeAXID(AXObject*);
154 bool isIDinUse(AXID id) const { return m_idsInUse.contains(id); } 153 bool isIDinUse(AXID id) const { return m_idsInUse.contains(id); }
155 154
156 Element* rootAXEditableElement(Node*); 155 Element* rootAXEditableElement(Node*);
157 const Element* rootAXEditableElement(const Node*); 156 const Element* rootAXEditableElement(const Node*);
158 bool nodeIsTextControl(const Node*); 157 bool nodeIsTextControl(const Node*);
159 158
160 AXID platformGenerateAXID() const; 159 AXID platformGenerateAXID() const;
161 AXObject* objectFromAXID(AXID id) const { return m_objects.get(id); } 160 AXObject* objectFromAXID(AXID id) const { return m_objects.get(id); }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 void textChanged(AXObject*); 205 void textChanged(AXObject*);
207 void labelChanged(Element*); 206 void labelChanged(Element*);
208 207
209 // This is a weak reference cache for knowing if Nodes used by TextMarkers a re valid. 208 // This is a weak reference cache for knowing if Nodes used by TextMarkers a re valid.
210 void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); } 209 void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); }
211 void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); } 210 void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); }
212 bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); } 211 bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); }
213 212
214 private: 213 private:
215 Document& m_document; 214 Document& m_document;
215 Settings* m_settings;
216 HashMap<AXID, RefPtr<AXObject> > m_objects; 216 HashMap<AXID, RefPtr<AXObject> > m_objects;
217 HashMap<RenderObject*, AXID> m_renderObjectMapping; 217 HashMap<RenderObject*, AXID> m_renderObjectMapping;
218 HashMap<Widget*, AXID> m_widgetObjectMapping; 218 HashMap<Widget*, AXID> m_widgetObjectMapping;
219 HashMap<Node*, AXID> m_nodeObjectMapping; 219 HashMap<Node*, AXID> m_nodeObjectMapping;
220 HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping; 220 HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping;
221 HashSet<Node*> m_textMarkerNodes; 221 HashSet<Node*> m_textMarkerNodes;
222 OwnPtr<AXComputedObjectAttributeCache> m_computedObjectAttributeCache; 222 OwnPtr<AXComputedObjectAttributeCache> m_computedObjectAttributeCache;
223 static bool gAccessibilityEnabled;
224 static bool gInlineTextBoxAccessibility;
225 223
226 HashSet<AXID> m_idsInUse; 224 HashSet<AXID> m_idsInUse;
227 225
228 Timer<AXObjectCache> m_notificationPostTimer; 226 Timer<AXObjectCache> m_notificationPostTimer;
229 Vector<pair<RefPtr<AXObject>, AXNotification> > m_notificationsToPost; 227 Vector<pair<RefPtr<AXObject>, AXNotification> > m_notificationsToPost;
230 void notificationPostTimerFired(Timer<AXObjectCache>*); 228 void notificationPostTimerFired(Timer<AXObjectCache>*);
231 229
232 static AXObject* focusedImageMapUIElement(HTMLAreaElement*); 230 static AXObject* focusedImageMapUIElement(HTMLAreaElement*);
233 231
234 AXID getAXID(AXObject*); 232 AXID getAXID(AXObject*);
233
234 Settings* getSettings();
abarth-chromium 2014/08/29 18:32:07 s/getSettings/settings/ We usually skip the "get"
aboxhall 2014/08/29 18:38:39 I deliberately used 'get' as it's not a trivial ge
235 }; 235 };
236 236
237 bool nodeHasRole(Node*, const String& role); 237 bool nodeHasRole(Node*, const String& role);
238 // This will let you know if aria-hidden was explicitly set to false. 238 // This will let you know if aria-hidden was explicitly set to false.
239 bool isNodeAriaVisible(Node*); 239 bool isNodeAriaVisible(Node*);
240 240
241 } 241 }
242 242
243 #endif 243 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698