| OLD | NEW |
| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 HashMap<AXID, CachedAXObjectAttributes> m_idMapping; | 74 HashMap<AXID, CachedAXObjectAttributes> m_idMapping; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 enum PostType { PostSynchronously, PostAsynchronously }; | 77 enum PostType { PostSynchronously, PostAsynchronously }; |
| 78 | 78 |
| 79 class AXObjectCache { | 79 class AXObjectCache { |
| 80 WTF_MAKE_NONCOPYABLE(AXObjectCache); WTF_MAKE_FAST_ALLOCATED; | 80 WTF_MAKE_NONCOPYABLE(AXObjectCache); WTF_MAKE_FAST_ALLOCATED; |
| 81 public: | 81 public: |
| 82 explicit AXObjectCache(const Document*); | 82 explicit AXObjectCache(Document&); |
| 83 ~AXObjectCache(); | 83 ~AXObjectCache(); |
| 84 | 84 |
| 85 static AXObject* focusedUIElementForPage(const Page*); | 85 static AXObject* focusedUIElementForPage(const Page*); |
| 86 | 86 |
| 87 // Returns the root object for the entire document. | 87 // Returns the root object for the entire document. |
| 88 AXObject* rootObject(); | 88 AXObject* rootObject(); |
| 89 | 89 |
| 90 // For AX objects with elements that back them. | 90 // For AX objects with elements that back them. |
| 91 AXObject* getOrCreate(RenderObject*); | 91 AXObject* getOrCreate(RenderObject*); |
| 92 AXObject* getOrCreate(Widget*); | 92 AXObject* getOrCreate(Widget*); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 void postPlatformNotification(AXObject*, AXNotification); | 204 void postPlatformNotification(AXObject*, AXNotification); |
| 205 void textChanged(AXObject*); | 205 void textChanged(AXObject*); |
| 206 void labelChanged(Element*); | 206 void labelChanged(Element*); |
| 207 | 207 |
| 208 // 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. |
| 209 void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); } | 209 void setNodeInUse(Node* n) { m_textMarkerNodes.add(n); } |
| 210 void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); } | 210 void removeNodeForUse(Node* n) { m_textMarkerNodes.remove(n); } |
| 211 bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); } | 211 bool isNodeInUse(Node* n) { return m_textMarkerNodes.contains(n); } |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 Document* m_document; | 214 Document& m_document; |
| 215 HashMap<AXID, RefPtr<AXObject> > m_objects; | 215 HashMap<AXID, RefPtr<AXObject> > m_objects; |
| 216 HashMap<RenderObject*, AXID> m_renderObjectMapping; | 216 HashMap<RenderObject*, AXID> m_renderObjectMapping; |
| 217 HashMap<Widget*, AXID> m_widgetObjectMapping; | 217 HashMap<Widget*, AXID> m_widgetObjectMapping; |
| 218 HashMap<Node*, AXID> m_nodeObjectMapping; | 218 HashMap<Node*, AXID> m_nodeObjectMapping; |
| 219 HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping; | 219 HashMap<AbstractInlineTextBox*, AXID> m_inlineTextBoxObjectMapping; |
| 220 HashSet<Node*> m_textMarkerNodes; | 220 HashSet<Node*> m_textMarkerNodes; |
| 221 OwnPtr<AXComputedObjectAttributeCache> m_computedObjectAttributeCache; | 221 OwnPtr<AXComputedObjectAttributeCache> m_computedObjectAttributeCache; |
| 222 static bool gAccessibilityEnabled; | 222 static bool gAccessibilityEnabled; |
| 223 static bool gInlineTextBoxAccessibility; | 223 static bool gInlineTextBoxAccessibility; |
| 224 | 224 |
| 225 HashSet<AXID> m_idsInUse; | 225 HashSet<AXID> m_idsInUse; |
| 226 | 226 |
| 227 Timer<AXObjectCache> m_notificationPostTimer; | 227 Timer<AXObjectCache> m_notificationPostTimer; |
| 228 Vector<pair<RefPtr<AXObject>, AXNotification> > m_notificationsToPost; | 228 Vector<pair<RefPtr<AXObject>, AXNotification> > m_notificationsToPost; |
| 229 void notificationPostTimerFired(Timer<AXObjectCache>*); | 229 void notificationPostTimerFired(Timer<AXObjectCache>*); |
| 230 | 230 |
| 231 static AXObject* focusedImageMapUIElement(HTMLAreaElement*); | 231 static AXObject* focusedImageMapUIElement(HTMLAreaElement*); |
| 232 | 232 |
| 233 AXID getAXID(AXObject*); | 233 AXID getAXID(AXObject*); |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 bool nodeHasRole(Node*, const String& role); | 236 bool nodeHasRole(Node*, const String& role); |
| 237 // This will let you know if aria-hidden was explicitly set to false. | 237 // This will let you know if aria-hidden was explicitly set to false. |
| 238 bool isNodeAriaVisible(Node*); | 238 bool isNodeAriaVisible(Node*); |
| 239 | 239 |
| 240 } | 240 } |
| 241 | 241 |
| 242 #endif | 242 #endif |
| OLD | NEW |