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

Side by Side Diff: Source/WebKit/chromium/src/WebAccessibilityObject.cpp

Issue 16361013: Get rid of extraneous accessibility tree traversal code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase for reland Created 7 years, 6 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
« no previous file with comments | « no previous file | Source/core/accessibility/AccessibilityNodeObject.h » ('j') | 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 { 185 {
186 if (isDetached()) 186 if (isDetached())
187 return WebAccessibilityObject(); 187 return WebAccessibilityObject();
188 188
189 if (m_private->children().size() <= index) 189 if (m_private->children().size() <= index)
190 return WebAccessibilityObject(); 190 return WebAccessibilityObject();
191 191
192 return WebAccessibilityObject(m_private->children()[index]); 192 return WebAccessibilityObject(m_private->children()[index]);
193 } 193 }
194 194
195 WebAccessibilityObject WebAccessibilityObject::firstChild() const
196 {
197 if (isDetached())
198 return WebAccessibilityObject();
199
200 return WebAccessibilityObject(m_private->firstChild());
201 }
202
203 WebAccessibilityObject WebAccessibilityObject::focusedChild() const
204 {
205 if (isDetached())
206 return WebAccessibilityObject();
207
208 RefPtr<AccessibilityObject> focused = m_private->focusedUIElement();
209 if (m_private.get() == focused.get() || m_private.get() == focused->parentOb ject())
210 return WebAccessibilityObject(focused);
211
212 return WebAccessibilityObject();
213 }
214
215 WebAccessibilityObject WebAccessibilityObject::lastChild() const
216 {
217 if (isDetached())
218 return WebAccessibilityObject();
219
220 return WebAccessibilityObject(m_private->lastChild());
221 }
222
223
224 WebAccessibilityObject WebAccessibilityObject::nextSibling() const
225 {
226 if (isDetached())
227 return WebAccessibilityObject();
228
229 return WebAccessibilityObject(m_private->nextSibling());
230 }
231
232 WebAccessibilityObject WebAccessibilityObject::parentObject() const 195 WebAccessibilityObject WebAccessibilityObject::parentObject() const
233 { 196 {
234 if (isDetached()) 197 if (isDetached())
235 return WebAccessibilityObject(); 198 return WebAccessibilityObject();
236 199
237 return WebAccessibilityObject(m_private->parentObject()); 200 return WebAccessibilityObject(m_private->parentObject());
238 } 201 }
239 202
240
241 WebAccessibilityObject WebAccessibilityObject::previousSibling() const
242 {
243 if (isDetached())
244 return WebAccessibilityObject();
245
246 return WebAccessibilityObject(m_private->previousSibling());
247 }
248
249 bool WebAccessibilityObject::canSetSelectedAttribute() const 203 bool WebAccessibilityObject::canSetSelectedAttribute() const
250 { 204 {
251 if (isDetached()) 205 if (isDetached())
252 return 0; 206 return 0;
253 207
254 return m_private->canSetSelectedAttribute(); 208 return m_private->canSetSelectedAttribute();
255 } 209 }
256 210
257 bool WebAccessibilityObject::isAnchor() const 211 bool WebAccessibilityObject::isAnchor() const
258 { 212 {
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 m_private = object; 1012 m_private = object;
1059 return *this; 1013 return *this;
1060 } 1014 }
1061 1015
1062 WebAccessibilityObject::operator WTF::PassRefPtr<WebCore::AccessibilityObject>() const 1016 WebAccessibilityObject::operator WTF::PassRefPtr<WebCore::AccessibilityObject>() const
1063 { 1017 {
1064 return m_private.get(); 1018 return m_private.get();
1065 } 1019 }
1066 1020
1067 } // namespace WebKit 1021 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | Source/core/accessibility/AccessibilityNodeObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698