OLD | NEW |
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 11 matching lines...) Expand all Loading... |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "WebAccessibilityObject.h" | 32 #include "WebAXObject.h" |
33 | 33 |
34 #include "HTMLNames.h" | 34 #include "HTMLNames.h" |
35 #include "WebDocument.h" | 35 #include "WebDocument.h" |
36 #include "WebNode.h" | 36 #include "WebNode.h" |
37 #include "core/accessibility/AXObjectCache.h" | 37 #include "core/accessibility/AXObjectCache.h" |
38 #include "core/accessibility/AccessibilityObject.h" | 38 #include "core/accessibility/AccessibilityObject.h" |
39 #include "core/accessibility/AccessibilityTable.h" | 39 #include "core/accessibility/AccessibilityTable.h" |
40 #include "core/accessibility/AccessibilityTableCell.h" | 40 #include "core/accessibility/AccessibilityTableCell.h" |
41 #include "core/accessibility/AccessibilityTableColumn.h" | 41 #include "core/accessibility/AccessibilityTableColumn.h" |
42 #include "core/accessibility/AccessibilityTableRow.h" | 42 #include "core/accessibility/AccessibilityTableRow.h" |
43 #include "core/css/CSSPrimitiveValueMappings.h" | 43 #include "core/css/CSSPrimitiveValueMappings.h" |
44 #include "core/dom/Document.h" | 44 #include "core/dom/Document.h" |
45 #include "core/dom/Node.h" | 45 #include "core/dom/Node.h" |
46 #include "core/page/EventHandler.h" | 46 #include "core/page/EventHandler.h" |
47 #include "core/page/FrameView.h" | 47 #include "core/page/FrameView.h" |
48 #include "core/platform/PlatformKeyboardEvent.h" | 48 #include "core/platform/PlatformKeyboardEvent.h" |
49 #include "core/rendering/style/RenderStyle.h" | 49 #include "core/rendering/style/RenderStyle.h" |
50 #include "public/platform/WebPoint.h" | 50 #include "public/platform/WebPoint.h" |
51 #include "public/platform/WebRect.h" | 51 #include "public/platform/WebRect.h" |
52 #include "public/platform/WebString.h" | 52 #include "public/platform/WebString.h" |
53 #include "public/platform/WebURL.h" | 53 #include "public/platform/WebURL.h" |
54 #include "wtf/text/StringBuilder.h" | 54 #include "wtf/text/StringBuilder.h" |
55 | 55 |
56 using namespace WebCore; | 56 using namespace WebCore; |
57 | 57 |
58 namespace WebKit { | 58 namespace WebKit { |
59 | 59 |
60 void WebAccessibilityObject::reset() | 60 void WebAXObject::reset() |
61 { | 61 { |
62 m_private.reset(); | 62 m_private.reset(); |
63 } | 63 } |
64 | 64 |
65 void WebAccessibilityObject::assign(const WebKit::WebAccessibilityObject& other) | 65 void WebAXObject::assign(const WebKit::WebAXObject& other) |
66 { | 66 { |
67 m_private = other.m_private; | 67 m_private = other.m_private; |
68 } | 68 } |
69 | 69 |
70 bool WebAccessibilityObject::equals(const WebAccessibilityObject& n) const | 70 bool WebAXObject::equals(const WebAXObject& n) const |
71 { | 71 { |
72 return m_private.get() == n.m_private.get(); | 72 return m_private.get() == n.m_private.get(); |
73 } | 73 } |
74 | 74 |
75 // static | 75 // static |
76 void WebAccessibilityObject::enableAccessibility() | 76 void WebAXObject::enableAccessibility() |
77 { | 77 { |
78 AXObjectCache::enableAccessibility(); | 78 AXObjectCache::enableAccessibility(); |
79 } | 79 } |
80 | 80 |
81 // static | 81 // static |
82 bool WebAccessibilityObject::accessibilityEnabled() | 82 bool WebAXObject::accessibilityEnabled() |
83 { | 83 { |
84 return AXObjectCache::accessibilityEnabled(); | 84 return AXObjectCache::accessibilityEnabled(); |
85 } | 85 } |
86 | 86 |
87 void WebAccessibilityObject::startCachingComputedObjectAttributesUntilTreeMutate
s() | 87 void WebAXObject::startCachingComputedObjectAttributesUntilTreeMutates() |
88 { | 88 { |
89 m_private->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMut
ates(); | 89 m_private->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMut
ates(); |
90 } | 90 } |
91 | 91 |
92 void WebAccessibilityObject::stopCachingComputedObjectAttributes() | 92 void WebAXObject::stopCachingComputedObjectAttributes() |
93 { | 93 { |
94 m_private->axObjectCache()->stopCachingComputedObjectAttributes(); | 94 m_private->axObjectCache()->stopCachingComputedObjectAttributes(); |
95 } | 95 } |
96 | 96 |
97 bool WebAccessibilityObject::isDetached() const | 97 bool WebAXObject::isDetached() const |
98 { | 98 { |
99 if (m_private.isNull()) | 99 if (m_private.isNull()) |
100 return true; | 100 return true; |
101 | 101 |
102 return m_private->isDetached(); | 102 return m_private->isDetached(); |
103 } | 103 } |
104 | 104 |
105 int WebAccessibilityObject::axID() const | 105 int WebAXObject::axID() const |
106 { | 106 { |
107 if (isDetached()) | 107 if (isDetached()) |
108 return -1; | 108 return -1; |
109 | 109 |
110 return m_private->axObjectID(); | 110 return m_private->axObjectID(); |
111 } | 111 } |
112 | 112 |
113 bool WebAccessibilityObject::updateBackingStoreAndCheckValidity() | 113 bool WebAXObject::updateBackingStoreAndCheckValidity() |
114 { | 114 { |
115 if (!isDetached()) | 115 if (!isDetached()) |
116 m_private->updateBackingStore(); | 116 m_private->updateBackingStore(); |
117 return !isDetached(); | 117 return !isDetached(); |
118 } | 118 } |
119 | 119 |
120 WebString WebAccessibilityObject::accessibilityDescription() const | 120 WebString WebAXObject::accessibilityDescription() const |
121 { | 121 { |
122 if (isDetached()) | 122 if (isDetached()) |
123 return WebString(); | 123 return WebString(); |
124 | 124 |
125 return m_private->accessibilityDescription(); | 125 return m_private->accessibilityDescription(); |
126 } | 126 } |
127 | 127 |
128 WebString WebAccessibilityObject::actionVerb() const | 128 WebString WebAXObject::actionVerb() const |
129 { | 129 { |
130 if (isDetached()) | 130 if (isDetached()) |
131 return WebString(); | 131 return WebString(); |
132 | 132 |
133 return m_private->actionVerb(); | 133 return m_private->actionVerb(); |
134 } | 134 } |
135 | 135 |
136 bool WebAccessibilityObject::canDecrement() const | 136 bool WebAXObject::canDecrement() const |
137 { | 137 { |
138 if (isDetached()) | 138 if (isDetached()) |
139 return false; | 139 return false; |
140 | 140 |
141 return m_private->isSlider(); | 141 return m_private->isSlider(); |
142 } | 142 } |
143 | 143 |
144 bool WebAccessibilityObject::canIncrement() const | 144 bool WebAXObject::canIncrement() const |
145 { | 145 { |
146 if (isDetached()) | 146 if (isDetached()) |
147 return false; | 147 return false; |
148 | 148 |
149 return m_private->isSlider(); | 149 return m_private->isSlider(); |
150 } | 150 } |
151 | 151 |
152 bool WebAccessibilityObject::canPress() const | 152 bool WebAXObject::canPress() const |
153 { | 153 { |
154 if (isDetached()) | 154 if (isDetached()) |
155 return false; | 155 return false; |
156 | 156 |
157 return m_private->actionElement() || m_private->isButton() || m_private->isM
enuRelated(); | 157 return m_private->actionElement() || m_private->isButton() || m_private->isM
enuRelated(); |
158 } | 158 } |
159 | 159 |
160 bool WebAccessibilityObject::canSetFocusAttribute() const | 160 bool WebAXObject::canSetFocusAttribute() const |
161 { | 161 { |
162 if (isDetached()) | 162 if (isDetached()) |
163 return false; | 163 return false; |
164 | 164 |
165 return m_private->canSetFocusAttribute(); | 165 return m_private->canSetFocusAttribute(); |
166 } | 166 } |
167 | 167 |
168 bool WebAccessibilityObject::canSetValueAttribute() const | 168 bool WebAXObject::canSetValueAttribute() const |
169 { | 169 { |
170 if (isDetached()) | 170 if (isDetached()) |
171 return false; | 171 return false; |
172 | 172 |
173 return m_private->canSetValueAttribute(); | 173 return m_private->canSetValueAttribute(); |
174 } | 174 } |
175 | 175 |
176 unsigned WebAccessibilityObject::childCount() const | 176 unsigned WebAXObject::childCount() const |
177 { | 177 { |
178 if (isDetached()) | 178 if (isDetached()) |
179 return 0; | 179 return 0; |
180 | 180 |
181 return m_private->children().size(); | 181 return m_private->children().size(); |
182 } | 182 } |
183 | 183 |
184 WebAccessibilityObject WebAccessibilityObject::childAt(unsigned index) const | 184 WebAXObject WebAXObject::childAt(unsigned index) const |
185 { | 185 { |
186 if (isDetached()) | 186 if (isDetached()) |
187 return WebAccessibilityObject(); | 187 return WebAXObject(); |
188 | 188 |
189 if (m_private->children().size() <= index) | 189 if (m_private->children().size() <= index) |
190 return WebAccessibilityObject(); | 190 return WebAXObject(); |
191 | 191 |
192 return WebAccessibilityObject(m_private->children()[index]); | 192 return WebAXObject(m_private->children()[index]); |
193 } | 193 } |
194 | 194 |
195 WebAccessibilityObject WebAccessibilityObject::parentObject() const | 195 WebAXObject WebAXObject::parentObject() const |
196 { | 196 { |
197 if (isDetached()) | 197 if (isDetached()) |
198 return WebAccessibilityObject(); | 198 return WebAXObject(); |
199 | 199 |
200 return WebAccessibilityObject(m_private->parentObject()); | 200 return WebAXObject(m_private->parentObject()); |
201 } | 201 } |
202 | 202 |
203 bool WebAccessibilityObject::canSetSelectedAttribute() const | 203 bool WebAXObject::canSetSelectedAttribute() const |
204 { | 204 { |
205 if (isDetached()) | 205 if (isDetached()) |
206 return 0; | 206 return 0; |
207 | 207 |
208 return m_private->canSetSelectedAttribute(); | 208 return m_private->canSetSelectedAttribute(); |
209 } | 209 } |
210 | 210 |
211 bool WebAccessibilityObject::isAnchor() const | 211 bool WebAXObject::isAnchor() const |
212 { | 212 { |
213 if (isDetached()) | 213 if (isDetached()) |
214 return 0; | 214 return 0; |
215 | 215 |
216 return m_private->isAnchor(); | 216 return m_private->isAnchor(); |
217 } | 217 } |
218 | 218 |
219 bool WebAccessibilityObject::isAriaReadOnly() const | 219 bool WebAXObject::isAriaReadOnly() const |
220 { | 220 { |
221 if (isDetached()) | 221 if (isDetached()) |
222 return 0; | 222 return 0; |
223 | 223 |
224 return equalIgnoringCase(m_private->getAttribute(HTMLNames::aria_readonlyAtt
r), "true"); | 224 return equalIgnoringCase(m_private->getAttribute(HTMLNames::aria_readonlyAtt
r), "true"); |
225 } | 225 } |
226 | 226 |
227 bool WebAccessibilityObject::isButtonStateMixed() const | 227 bool WebAXObject::isButtonStateMixed() const |
228 { | 228 { |
229 if (isDetached()) | 229 if (isDetached()) |
230 return 0; | 230 return 0; |
231 | 231 |
232 return m_private->checkboxOrRadioValue() == ButtonStateMixed; | 232 return m_private->checkboxOrRadioValue() == ButtonStateMixed; |
233 } | 233 } |
234 | 234 |
235 bool WebAccessibilityObject::isChecked() const | 235 bool WebAXObject::isChecked() const |
236 { | 236 { |
237 if (isDetached()) | 237 if (isDetached()) |
238 return 0; | 238 return 0; |
239 | 239 |
240 return m_private->isChecked(); | 240 return m_private->isChecked(); |
241 } | 241 } |
242 | 242 |
243 bool WebAccessibilityObject::isClickable() const | 243 bool WebAXObject::isClickable() const |
244 { | 244 { |
245 if (isDetached()) | 245 if (isDetached()) |
246 return 0; | 246 return 0; |
247 | 247 |
248 return m_private->isClickable(); | 248 return m_private->isClickable(); |
249 } | 249 } |
250 | 250 |
251 bool WebAccessibilityObject::isCollapsed() const | 251 bool WebAXObject::isCollapsed() const |
252 { | 252 { |
253 if (isDetached()) | 253 if (isDetached()) |
254 return 0; | 254 return 0; |
255 | 255 |
256 return m_private->isCollapsed(); | 256 return m_private->isCollapsed(); |
257 } | 257 } |
258 | 258 |
259 bool WebAccessibilityObject::isControl() const | 259 bool WebAXObject::isControl() const |
260 { | 260 { |
261 if (isDetached()) | 261 if (isDetached()) |
262 return 0; | 262 return 0; |
263 | 263 |
264 return m_private->isControl(); | 264 return m_private->isControl(); |
265 } | 265 } |
266 | 266 |
267 bool WebAccessibilityObject::isEnabled() const | 267 bool WebAXObject::isEnabled() const |
268 { | 268 { |
269 if (isDetached()) | 269 if (isDetached()) |
270 return 0; | 270 return 0; |
271 | 271 |
272 return m_private->isEnabled(); | 272 return m_private->isEnabled(); |
273 } | 273 } |
274 | 274 |
275 bool WebAccessibilityObject::isFocused() const | 275 bool WebAXObject::isFocused() const |
276 { | 276 { |
277 if (isDetached()) | 277 if (isDetached()) |
278 return 0; | 278 return 0; |
279 | 279 |
280 return m_private->isFocused(); | 280 return m_private->isFocused(); |
281 } | 281 } |
282 | 282 |
283 bool WebAccessibilityObject::isHovered() const | 283 bool WebAXObject::isHovered() const |
284 { | 284 { |
285 if (isDetached()) | 285 if (isDetached()) |
286 return 0; | 286 return 0; |
287 | 287 |
288 return m_private->isHovered(); | 288 return m_private->isHovered(); |
289 } | 289 } |
290 | 290 |
291 bool WebAccessibilityObject::isIndeterminate() const | 291 bool WebAXObject::isIndeterminate() const |
292 { | 292 { |
293 if (isDetached()) | 293 if (isDetached()) |
294 return 0; | 294 return 0; |
295 | 295 |
296 return m_private->isIndeterminate(); | 296 return m_private->isIndeterminate(); |
297 } | 297 } |
298 | 298 |
299 bool WebAccessibilityObject::isLinked() const | 299 bool WebAXObject::isLinked() const |
300 { | 300 { |
301 if (isDetached()) | 301 if (isDetached()) |
302 return 0; | 302 return 0; |
303 | 303 |
304 return m_private->isLinked(); | 304 return m_private->isLinked(); |
305 } | 305 } |
306 | 306 |
307 bool WebAccessibilityObject::isLoaded() const | 307 bool WebAXObject::isLoaded() const |
308 { | 308 { |
309 if (isDetached()) | 309 if (isDetached()) |
310 return 0; | 310 return 0; |
311 | 311 |
312 return m_private->isLoaded(); | 312 return m_private->isLoaded(); |
313 } | 313 } |
314 | 314 |
315 bool WebAccessibilityObject::isMultiSelectable() const | 315 bool WebAXObject::isMultiSelectable() const |
316 { | 316 { |
317 if (isDetached()) | 317 if (isDetached()) |
318 return 0; | 318 return 0; |
319 | 319 |
320 return m_private->isMultiSelectable(); | 320 return m_private->isMultiSelectable(); |
321 } | 321 } |
322 | 322 |
323 bool WebAccessibilityObject::isOffScreen() const | 323 bool WebAXObject::isOffScreen() const |
324 { | 324 { |
325 if (isDetached()) | 325 if (isDetached()) |
326 return 0; | 326 return 0; |
327 | 327 |
328 return m_private->isOffScreen(); | 328 return m_private->isOffScreen(); |
329 } | 329 } |
330 | 330 |
331 bool WebAccessibilityObject::isPasswordField() const | 331 bool WebAXObject::isPasswordField() const |
332 { | 332 { |
333 if (isDetached()) | 333 if (isDetached()) |
334 return 0; | 334 return 0; |
335 | 335 |
336 return m_private->isPasswordField(); | 336 return m_private->isPasswordField(); |
337 } | 337 } |
338 | 338 |
339 bool WebAccessibilityObject::isPressed() const | 339 bool WebAXObject::isPressed() const |
340 { | 340 { |
341 if (isDetached()) | 341 if (isDetached()) |
342 return 0; | 342 return 0; |
343 | 343 |
344 return m_private->isPressed(); | 344 return m_private->isPressed(); |
345 } | 345 } |
346 | 346 |
347 bool WebAccessibilityObject::isReadOnly() const | 347 bool WebAXObject::isReadOnly() const |
348 { | 348 { |
349 if (isDetached()) | 349 if (isDetached()) |
350 return 0; | 350 return 0; |
351 | 351 |
352 return m_private->isReadOnly(); | 352 return m_private->isReadOnly(); |
353 } | 353 } |
354 | 354 |
355 bool WebAccessibilityObject::isRequired() const | 355 bool WebAXObject::isRequired() const |
356 { | 356 { |
357 if (isDetached()) | 357 if (isDetached()) |
358 return 0; | 358 return 0; |
359 | 359 |
360 return m_private->isRequired(); | 360 return m_private->isRequired(); |
361 } | 361 } |
362 | 362 |
363 bool WebAccessibilityObject::isSelected() const | 363 bool WebAXObject::isSelected() const |
364 { | 364 { |
365 if (isDetached()) | 365 if (isDetached()) |
366 return 0; | 366 return 0; |
367 | 367 |
368 return m_private->isSelected(); | 368 return m_private->isSelected(); |
369 } | 369 } |
370 | 370 |
371 bool WebAccessibilityObject::isSelectedOptionActive() const | 371 bool WebAXObject::isSelectedOptionActive() const |
372 { | 372 { |
373 if (isDetached()) | 373 if (isDetached()) |
374 return false; | 374 return false; |
375 | 375 |
376 return m_private->isSelectedOptionActive(); | 376 return m_private->isSelectedOptionActive(); |
377 } | 377 } |
378 | 378 |
379 bool WebAccessibilityObject::isVertical() const | 379 bool WebAXObject::isVertical() const |
380 { | 380 { |
381 if (isDetached()) | 381 if (isDetached()) |
382 return 0; | 382 return 0; |
383 | 383 |
384 return m_private->orientation() == AccessibilityOrientationVertical; | 384 return m_private->orientation() == AccessibilityOrientationVertical; |
385 } | 385 } |
386 | 386 |
387 bool WebAccessibilityObject::isVisible() const | 387 bool WebAXObject::isVisible() const |
388 { | 388 { |
389 if (isDetached()) | 389 if (isDetached()) |
390 return 0; | 390 return 0; |
391 | 391 |
392 return m_private->isVisible(); | 392 return m_private->isVisible(); |
393 } | 393 } |
394 | 394 |
395 bool WebAccessibilityObject::isVisited() const | 395 bool WebAXObject::isVisited() const |
396 { | 396 { |
397 if (isDetached()) | 397 if (isDetached()) |
398 return 0; | 398 return 0; |
399 | 399 |
400 return m_private->isVisited(); | 400 return m_private->isVisited(); |
401 } | 401 } |
402 | 402 |
403 WebString WebAccessibilityObject::accessKey() const | 403 WebString WebAXObject::accessKey() const |
404 { | 404 { |
405 if (isDetached()) | 405 if (isDetached()) |
406 return WebString(); | 406 return WebString(); |
407 | 407 |
408 return WebString(m_private->accessKey()); | 408 return WebString(m_private->accessKey()); |
409 } | 409 } |
410 | 410 |
411 bool WebAccessibilityObject::ariaHasPopup() const | 411 bool WebAXObject::ariaHasPopup() const |
412 { | 412 { |
413 if (isDetached()) | 413 if (isDetached()) |
414 return 0; | 414 return 0; |
415 | 415 |
416 return m_private->ariaHasPopup(); | 416 return m_private->ariaHasPopup(); |
417 } | 417 } |
418 | 418 |
419 bool WebAccessibilityObject::ariaLiveRegionAtomic() const | 419 bool WebAXObject::ariaLiveRegionAtomic() const |
420 { | 420 { |
421 if (isDetached()) | 421 if (isDetached()) |
422 return 0; | 422 return 0; |
423 | 423 |
424 return m_private->ariaLiveRegionAtomic(); | 424 return m_private->ariaLiveRegionAtomic(); |
425 } | 425 } |
426 | 426 |
427 bool WebAccessibilityObject::ariaLiveRegionBusy() const | 427 bool WebAXObject::ariaLiveRegionBusy() const |
428 { | 428 { |
429 if (isDetached()) | 429 if (isDetached()) |
430 return 0; | 430 return 0; |
431 | 431 |
432 return m_private->ariaLiveRegionBusy(); | 432 return m_private->ariaLiveRegionBusy(); |
433 } | 433 } |
434 | 434 |
435 WebString WebAccessibilityObject::ariaLiveRegionRelevant() const | 435 WebString WebAXObject::ariaLiveRegionRelevant() const |
436 { | 436 { |
437 if (isDetached()) | 437 if (isDetached()) |
438 return WebString(); | 438 return WebString(); |
439 | 439 |
440 return m_private->ariaLiveRegionRelevant(); | 440 return m_private->ariaLiveRegionRelevant(); |
441 } | 441 } |
442 | 442 |
443 WebString WebAccessibilityObject::ariaLiveRegionStatus() const | 443 WebString WebAXObject::ariaLiveRegionStatus() const |
444 { | 444 { |
445 if (isDetached()) | 445 if (isDetached()) |
446 return WebString(); | 446 return WebString(); |
447 | 447 |
448 return m_private->ariaLiveRegionStatus(); | 448 return m_private->ariaLiveRegionStatus(); |
449 } | 449 } |
450 | 450 |
451 WebRect WebAccessibilityObject::boundingBoxRect() const | 451 WebRect WebAXObject::boundingBoxRect() const |
452 { | 452 { |
453 if (isDetached()) | 453 if (isDetached()) |
454 return WebRect(); | 454 return WebRect(); |
455 | 455 |
456 return pixelSnappedIntRect(m_private->elementRect()); | 456 return pixelSnappedIntRect(m_private->elementRect()); |
457 } | 457 } |
458 | 458 |
459 bool WebAccessibilityObject::canvasHasFallbackContent() const | 459 bool WebAXObject::canvasHasFallbackContent() const |
460 { | 460 { |
461 if (isDetached()) | 461 if (isDetached()) |
462 return false; | 462 return false; |
463 | 463 |
464 return m_private->canvasHasFallbackContent(); | 464 return m_private->canvasHasFallbackContent(); |
465 } | 465 } |
466 | 466 |
467 WebPoint WebAccessibilityObject::clickPoint() const | 467 WebPoint WebAXObject::clickPoint() const |
468 { | 468 { |
469 if (isDetached()) | 469 if (isDetached()) |
470 return WebPoint(); | 470 return WebPoint(); |
471 | 471 |
472 return WebPoint(m_private->clickPoint()); | 472 return WebPoint(m_private->clickPoint()); |
473 } | 473 } |
474 | 474 |
475 void WebAccessibilityObject::colorValue(int& r, int& g, int& b) const | 475 void WebAXObject::colorValue(int& r, int& g, int& b) const |
476 { | 476 { |
477 if (isDetached()) | 477 if (isDetached()) |
478 return; | 478 return; |
479 | 479 |
480 m_private->colorValue(r, g, b); | 480 m_private->colorValue(r, g, b); |
481 } | 481 } |
482 | 482 |
483 double WebAccessibilityObject::estimatedLoadingProgress() const | 483 double WebAXObject::estimatedLoadingProgress() const |
484 { | 484 { |
485 if (isDetached()) | 485 if (isDetached()) |
486 return 0.0; | 486 return 0.0; |
487 | 487 |
488 return m_private->estimatedLoadingProgress(); | 488 return m_private->estimatedLoadingProgress(); |
489 } | 489 } |
490 | 490 |
491 WebString WebAccessibilityObject::helpText() const | 491 WebString WebAXObject::helpText() const |
492 { | 492 { |
493 if (isDetached()) | 493 if (isDetached()) |
494 return WebString(); | 494 return WebString(); |
495 | 495 |
496 return m_private->helpText(); | 496 return m_private->helpText(); |
497 } | 497 } |
498 | 498 |
499 int WebAccessibilityObject::headingLevel() const | 499 int WebAXObject::headingLevel() const |
500 { | 500 { |
501 if (isDetached()) | 501 if (isDetached()) |
502 return 0; | 502 return 0; |
503 | 503 |
504 return m_private->headingLevel(); | 504 return m_private->headingLevel(); |
505 } | 505 } |
506 | 506 |
507 int WebAccessibilityObject::hierarchicalLevel() const | 507 int WebAXObject::hierarchicalLevel() const |
508 { | 508 { |
509 if (isDetached()) | 509 if (isDetached()) |
510 return 0; | 510 return 0; |
511 | 511 |
512 return m_private->hierarchicalLevel(); | 512 return m_private->hierarchicalLevel(); |
513 } | 513 } |
514 | 514 |
515 WebAccessibilityObject WebAccessibilityObject::hitTest(const WebPoint& point) co
nst | 515 WebAXObject WebAXObject::hitTest(const WebPoint& point) const |
516 { | 516 { |
517 if (isDetached()) | 517 if (isDetached()) |
518 return WebAccessibilityObject(); | 518 return WebAXObject(); |
519 | 519 |
520 IntPoint contentsPoint = m_private->documentFrameView()->windowToContents(po
int); | 520 IntPoint contentsPoint = m_private->documentFrameView()->windowToContents(po
int); |
521 RefPtr<AccessibilityObject> hit = m_private->accessibilityHitTest(contentsPo
int); | 521 RefPtr<AccessibilityObject> hit = m_private->accessibilityHitTest(contentsPo
int); |
522 | 522 |
523 if (hit) | 523 if (hit) |
524 return WebAccessibilityObject(hit); | 524 return WebAXObject(hit); |
525 | 525 |
526 if (m_private->elementRect().contains(contentsPoint)) | 526 if (m_private->elementRect().contains(contentsPoint)) |
527 return *this; | 527 return *this; |
528 | 528 |
529 return WebAccessibilityObject(); | 529 return WebAXObject(); |
530 } | 530 } |
531 | 531 |
532 WebString WebAccessibilityObject::keyboardShortcut() const | 532 WebString WebAXObject::keyboardShortcut() const |
533 { | 533 { |
534 if (isDetached()) | 534 if (isDetached()) |
535 return WebString(); | 535 return WebString(); |
536 | 536 |
537 String accessKey = m_private->accessKey(); | 537 String accessKey = m_private->accessKey(); |
538 if (accessKey.isNull()) | 538 if (accessKey.isNull()) |
539 return WebString(); | 539 return WebString(); |
540 | 540 |
541 DEFINE_STATIC_LOCAL(String, modifierString, ()); | 541 DEFINE_STATIC_LOCAL(String, modifierString, ()); |
542 if (modifierString.isNull()) { | 542 if (modifierString.isNull()) { |
543 unsigned modifiers = EventHandler::accessKeyModifiers(); | 543 unsigned modifiers = EventHandler::accessKeyModifiers(); |
544 // Follow the same order as Mozilla MSAA implementation: | 544 // Follow the same order as Mozilla MSAA implementation: |
545 // Ctrl+Alt+Shift+Meta+key. MSDN states that keyboard shortcut strings | 545 // Ctrl+Alt+Shift+Meta+key. MSDN states that keyboard shortcut strings |
546 // should not be localized and defines the separator as "+". | 546 // should not be localized and defines the separator as "+". |
547 StringBuilder modifierStringBuilder; | 547 StringBuilder modifierStringBuilder; |
548 if (modifiers & PlatformEvent::CtrlKey) | 548 if (modifiers & PlatformEvent::CtrlKey) |
549 modifierStringBuilder.appendLiteral("Ctrl+"); | 549 modifierStringBuilder.appendLiteral("Ctrl+"); |
550 if (modifiers & PlatformEvent::AltKey) | 550 if (modifiers & PlatformEvent::AltKey) |
551 modifierStringBuilder.appendLiteral("Alt+"); | 551 modifierStringBuilder.appendLiteral("Alt+"); |
552 if (modifiers & PlatformEvent::ShiftKey) | 552 if (modifiers & PlatformEvent::ShiftKey) |
553 modifierStringBuilder.appendLiteral("Shift+"); | 553 modifierStringBuilder.appendLiteral("Shift+"); |
554 if (modifiers & PlatformEvent::MetaKey) | 554 if (modifiers & PlatformEvent::MetaKey) |
555 modifierStringBuilder.appendLiteral("Win+"); | 555 modifierStringBuilder.appendLiteral("Win+"); |
556 modifierString = modifierStringBuilder.toString(); | 556 modifierString = modifierStringBuilder.toString(); |
557 } | 557 } |
558 | 558 |
559 return String(modifierString + accessKey); | 559 return String(modifierString + accessKey); |
560 } | 560 } |
561 | 561 |
562 bool WebAccessibilityObject::performDefaultAction() const | 562 bool WebAXObject::performDefaultAction() const |
563 { | 563 { |
564 if (isDetached()) | 564 if (isDetached()) |
565 return false; | 565 return false; |
566 | 566 |
567 return m_private->performDefaultAction(); | 567 return m_private->performDefaultAction(); |
568 } | 568 } |
569 | 569 |
570 bool WebAccessibilityObject::increment() const | 570 bool WebAXObject::increment() const |
571 { | 571 { |
572 if (isDetached()) | 572 if (isDetached()) |
573 return false; | 573 return false; |
574 | 574 |
575 if (canIncrement()) { | 575 if (canIncrement()) { |
576 m_private->increment(); | 576 m_private->increment(); |
577 return true; | 577 return true; |
578 } | 578 } |
579 return false; | 579 return false; |
580 } | 580 } |
581 | 581 |
582 bool WebAccessibilityObject::decrement() const | 582 bool WebAXObject::decrement() const |
583 { | 583 { |
584 if (isDetached()) | 584 if (isDetached()) |
585 return false; | 585 return false; |
586 | 586 |
587 if (canDecrement()) { | 587 if (canDecrement()) { |
588 m_private->decrement(); | 588 m_private->decrement(); |
589 return true; | 589 return true; |
590 } | 590 } |
591 return false; | 591 return false; |
592 } | 592 } |
593 | 593 |
594 bool WebAccessibilityObject::press() const | 594 bool WebAXObject::press() const |
595 { | 595 { |
596 if (isDetached()) | 596 if (isDetached()) |
597 return false; | 597 return false; |
598 | 598 |
599 return m_private->press(); | 599 return m_private->press(); |
600 } | 600 } |
601 | 601 |
602 // Deprecated in favor of role(). | 602 WebAXRole WebAXObject::role() const |
603 WebAccessibilityRole WebAccessibilityObject::roleValue() const | |
604 { | |
605 if (isDetached()) | |
606 return WebKit::WebAccessibilityRoleUnknown; | |
607 | |
608 return static_cast<WebAccessibilityRole>(m_private->roleValue()); | |
609 } | |
610 | |
611 WebAXRole WebAccessibilityObject::role() const | |
612 { | 603 { |
613 if (isDetached()) | 604 if (isDetached()) |
614 return WebKit::WebAXRoleUnknown; | 605 return WebKit::WebAXRoleUnknown; |
615 | 606 |
616 return static_cast<WebAXRole>(m_private->roleValue()); | 607 return static_cast<WebAXRole>(m_private->roleValue()); |
617 } | 608 } |
618 | 609 |
619 unsigned WebAccessibilityObject::selectionEnd() const | 610 unsigned WebAXObject::selectionEnd() const |
620 { | 611 { |
621 if (isDetached()) | 612 if (isDetached()) |
622 return 0; | 613 return 0; |
623 | 614 |
624 return m_private->selectedTextRange().start + m_private->selectedTextRange()
.length; | 615 return m_private->selectedTextRange().start + m_private->selectedTextRange()
.length; |
625 } | 616 } |
626 | 617 |
627 unsigned WebAccessibilityObject::selectionStart() const | 618 unsigned WebAXObject::selectionStart() const |
628 { | 619 { |
629 if (isDetached()) | 620 if (isDetached()) |
630 return 0; | 621 return 0; |
631 | 622 |
632 return m_private->selectedTextRange().start; | 623 return m_private->selectedTextRange().start; |
633 } | 624 } |
634 | 625 |
635 unsigned WebAccessibilityObject::selectionEndLineNumber() const | 626 unsigned WebAXObject::selectionEndLineNumber() const |
636 { | 627 { |
637 if (isDetached()) | 628 if (isDetached()) |
638 return 0; | 629 return 0; |
639 | 630 |
640 VisiblePosition position = m_private->visiblePositionForIndex(selectionEnd()
); | 631 VisiblePosition position = m_private->visiblePositionForIndex(selectionEnd()
); |
641 int lineNumber = m_private->lineForPosition(position); | 632 int lineNumber = m_private->lineForPosition(position); |
642 if (lineNumber < 0) | 633 if (lineNumber < 0) |
643 return 0; | 634 return 0; |
644 return lineNumber; | 635 return lineNumber; |
645 } | 636 } |
646 | 637 |
647 unsigned WebAccessibilityObject::selectionStartLineNumber() const | 638 unsigned WebAXObject::selectionStartLineNumber() const |
648 { | 639 { |
649 if (isDetached()) | 640 if (isDetached()) |
650 return 0; | 641 return 0; |
651 | 642 |
652 VisiblePosition position = m_private->visiblePositionForIndex(selectionStart
()); | 643 VisiblePosition position = m_private->visiblePositionForIndex(selectionStart
()); |
653 int lineNumber = m_private->lineForPosition(position); | 644 int lineNumber = m_private->lineForPosition(position); |
654 if (lineNumber < 0) | 645 if (lineNumber < 0) |
655 return 0; | 646 return 0; |
656 return lineNumber; | 647 return lineNumber; |
657 } | 648 } |
658 | 649 |
659 void WebAccessibilityObject::setFocused(bool on) const | 650 void WebAXObject::setFocused(bool on) const |
660 { | 651 { |
661 if (!isDetached()) | 652 if (!isDetached()) |
662 m_private->setFocused(on); | 653 m_private->setFocused(on); |
663 } | 654 } |
664 | 655 |
665 void WebAccessibilityObject::setSelectedTextRange(int selectionStart, int select
ionEnd) const | 656 void WebAXObject::setSelectedTextRange(int selectionStart, int selectionEnd) con
st |
666 { | 657 { |
667 if (isDetached()) | 658 if (isDetached()) |
668 return; | 659 return; |
669 | 660 |
670 m_private->setSelectedTextRange(PlainTextRange(selectionStart, selectionEnd
- selectionStart)); | 661 m_private->setSelectedTextRange(PlainTextRange(selectionStart, selectionEnd
- selectionStart)); |
671 } | 662 } |
672 | 663 |
673 WebString WebAccessibilityObject::stringValue() const | 664 WebString WebAXObject::stringValue() const |
674 { | 665 { |
675 if (isDetached()) | 666 if (isDetached()) |
676 return WebString(); | 667 return WebString(); |
677 | 668 |
678 return m_private->stringValue(); | 669 return m_private->stringValue(); |
679 } | 670 } |
680 | 671 |
681 WebString WebAccessibilityObject::title() const | 672 WebString WebAXObject::title() const |
682 { | 673 { |
683 if (isDetached()) | 674 if (isDetached()) |
684 return WebString(); | 675 return WebString(); |
685 | 676 |
686 return m_private->title(); | 677 return m_private->title(); |
687 } | 678 } |
688 | 679 |
689 WebAccessibilityObject WebAccessibilityObject::titleUIElement() const | 680 WebAXObject WebAXObject::titleUIElement() const |
690 { | 681 { |
691 if (isDetached()) | 682 if (isDetached()) |
692 return WebAccessibilityObject(); | 683 return WebAXObject(); |
693 | 684 |
694 if (!m_private->exposesTitleUIElement()) | 685 if (!m_private->exposesTitleUIElement()) |
695 return WebAccessibilityObject(); | 686 return WebAXObject(); |
696 | 687 |
697 return WebAccessibilityObject(m_private->titleUIElement()); | 688 return WebAXObject(m_private->titleUIElement()); |
698 } | 689 } |
699 | 690 |
700 WebURL WebAccessibilityObject::url() const | 691 WebURL WebAXObject::url() const |
701 { | 692 { |
702 if (isDetached()) | 693 if (isDetached()) |
703 return WebURL(); | 694 return WebURL(); |
704 | 695 |
705 return m_private->url(); | 696 return m_private->url(); |
706 } | 697 } |
707 | 698 |
708 bool WebAccessibilityObject::supportsRangeValue() const | 699 bool WebAXObject::supportsRangeValue() const |
709 { | 700 { |
710 if (isDetached()) | 701 if (isDetached()) |
711 return false; | 702 return false; |
712 | 703 |
713 return m_private->supportsRangeValue(); | 704 return m_private->supportsRangeValue(); |
714 } | 705 } |
715 | 706 |
716 WebString WebAccessibilityObject::valueDescription() const | 707 WebString WebAXObject::valueDescription() const |
717 { | 708 { |
718 if (isDetached()) | 709 if (isDetached()) |
719 return WebString(); | 710 return WebString(); |
720 | 711 |
721 return m_private->valueDescription(); | 712 return m_private->valueDescription(); |
722 } | 713 } |
723 | 714 |
724 float WebAccessibilityObject::valueForRange() const | 715 float WebAXObject::valueForRange() const |
725 { | 716 { |
726 if (isDetached()) | 717 if (isDetached()) |
727 return 0.0; | 718 return 0.0; |
728 | 719 |
729 return m_private->valueForRange(); | 720 return m_private->valueForRange(); |
730 } | 721 } |
731 | 722 |
732 float WebAccessibilityObject::maxValueForRange() const | 723 float WebAXObject::maxValueForRange() const |
733 { | 724 { |
734 if (isDetached()) | 725 if (isDetached()) |
735 return 0.0; | 726 return 0.0; |
736 | 727 |
737 return m_private->maxValueForRange(); | 728 return m_private->maxValueForRange(); |
738 } | 729 } |
739 | 730 |
740 float WebAccessibilityObject::minValueForRange() const | 731 float WebAXObject::minValueForRange() const |
741 { | 732 { |
742 if (isDetached()) | 733 if (isDetached()) |
743 return 0.0; | 734 return 0.0; |
744 | 735 |
745 return m_private->minValueForRange(); | 736 return m_private->minValueForRange(); |
746 } | 737 } |
747 | 738 |
748 WebNode WebAccessibilityObject::node() const | 739 WebNode WebAXObject::node() const |
749 { | 740 { |
750 if (isDetached()) | 741 if (isDetached()) |
751 return WebNode(); | 742 return WebNode(); |
752 | 743 |
753 Node* node = m_private->node(); | 744 Node* node = m_private->node(); |
754 if (!node) | 745 if (!node) |
755 return WebNode(); | 746 return WebNode(); |
756 | 747 |
757 return WebNode(node); | 748 return WebNode(node); |
758 } | 749 } |
759 | 750 |
760 WebDocument WebAccessibilityObject::document() const | 751 WebDocument WebAXObject::document() const |
761 { | 752 { |
762 if (isDetached()) | 753 if (isDetached()) |
763 return WebDocument(); | 754 return WebDocument(); |
764 | 755 |
765 Document* document = m_private->document(); | 756 Document* document = m_private->document(); |
766 if (!document) | 757 if (!document) |
767 return WebDocument(); | 758 return WebDocument(); |
768 | 759 |
769 return WebDocument(document); | 760 return WebDocument(document); |
770 } | 761 } |
771 | 762 |
772 bool WebAccessibilityObject::hasComputedStyle() const | 763 bool WebAXObject::hasComputedStyle() const |
773 { | 764 { |
774 if (isDetached()) | 765 if (isDetached()) |
775 return false; | 766 return false; |
776 | 767 |
777 Document* document = m_private->document(); | 768 Document* document = m_private->document(); |
778 if (document) | 769 if (document) |
779 document->updateStyleIfNeeded(); | 770 document->updateStyleIfNeeded(); |
780 | 771 |
781 Node* node = m_private->node(); | 772 Node* node = m_private->node(); |
782 if (!node) | 773 if (!node) |
783 return false; | 774 return false; |
784 | 775 |
785 return node->computedStyle(); | 776 return node->computedStyle(); |
786 } | 777 } |
787 | 778 |
788 WebString WebAccessibilityObject::computedStyleDisplay() const | 779 WebString WebAXObject::computedStyleDisplay() const |
789 { | 780 { |
790 if (isDetached()) | 781 if (isDetached()) |
791 return WebString(); | 782 return WebString(); |
792 | 783 |
793 Document* document = m_private->document(); | 784 Document* document = m_private->document(); |
794 if (document) | 785 if (document) |
795 document->updateStyleIfNeeded(); | 786 document->updateStyleIfNeeded(); |
796 | 787 |
797 Node* node = m_private->node(); | 788 Node* node = m_private->node(); |
798 if (!node) | 789 if (!node) |
799 return WebString(); | 790 return WebString(); |
800 | 791 |
801 RenderStyle* renderStyle = node->computedStyle(); | 792 RenderStyle* renderStyle = node->computedStyle(); |
802 if (!renderStyle) | 793 if (!renderStyle) |
803 return WebString(); | 794 return WebString(); |
804 | 795 |
805 return WebString(CSSPrimitiveValue::create(renderStyle->display())->getStrin
gValue()); | 796 return WebString(CSSPrimitiveValue::create(renderStyle->display())->getStrin
gValue()); |
806 } | 797 } |
807 | 798 |
808 bool WebAccessibilityObject::accessibilityIsIgnored() const | 799 bool WebAXObject::accessibilityIsIgnored() const |
809 { | 800 { |
810 if (isDetached()) | 801 if (isDetached()) |
811 return false; | 802 return false; |
812 | 803 |
813 return m_private->accessibilityIsIgnored(); | 804 return m_private->accessibilityIsIgnored(); |
814 } | 805 } |
815 | 806 |
816 bool WebAccessibilityObject::lineBreaks(WebVector<int>& result) const | 807 bool WebAXObject::lineBreaks(WebVector<int>& result) const |
817 { | 808 { |
818 if (isDetached()) | 809 if (isDetached()) |
819 return false; | 810 return false; |
820 | 811 |
821 Vector<int> lineBreaksVector; | 812 Vector<int> lineBreaksVector; |
822 m_private->lineBreaks(lineBreaksVector); | 813 m_private->lineBreaks(lineBreaksVector); |
823 | 814 |
824 size_t vectorSize = lineBreaksVector.size(); | 815 size_t vectorSize = lineBreaksVector.size(); |
825 WebVector<int> lineBreaksWebVector(vectorSize); | 816 WebVector<int> lineBreaksWebVector(vectorSize); |
826 for (size_t i = 0; i< vectorSize; i++) | 817 for (size_t i = 0; i< vectorSize; i++) |
827 lineBreaksWebVector[i] = lineBreaksVector[i]; | 818 lineBreaksWebVector[i] = lineBreaksVector[i]; |
828 result.swap(lineBreaksWebVector); | 819 result.swap(lineBreaksWebVector); |
829 | 820 |
830 return true; | 821 return true; |
831 } | 822 } |
832 | 823 |
833 unsigned WebAccessibilityObject::columnCount() const | 824 unsigned WebAXObject::columnCount() const |
834 { | 825 { |
835 if (isDetached()) | 826 if (isDetached()) |
836 return false; | 827 return false; |
837 | 828 |
838 if (!m_private->isAccessibilityTable()) | 829 if (!m_private->isAccessibilityTable()) |
839 return 0; | 830 return 0; |
840 | 831 |
841 return static_cast<WebCore::AccessibilityTable*>(m_private.get())->columnCou
nt(); | 832 return static_cast<WebCore::AccessibilityTable*>(m_private.get())->columnCou
nt(); |
842 } | 833 } |
843 | 834 |
844 unsigned WebAccessibilityObject::rowCount() const | 835 unsigned WebAXObject::rowCount() const |
845 { | 836 { |
846 if (isDetached()) | 837 if (isDetached()) |
847 return false; | 838 return false; |
848 | 839 |
849 if (!m_private->isAccessibilityTable()) | 840 if (!m_private->isAccessibilityTable()) |
850 return 0; | 841 return 0; |
851 | 842 |
852 return static_cast<WebCore::AccessibilityTable*>(m_private.get())->rowCount(
); | 843 return static_cast<WebCore::AccessibilityTable*>(m_private.get())->rowCount(
); |
853 } | 844 } |
854 | 845 |
855 WebAccessibilityObject WebAccessibilityObject::cellForColumnAndRow(unsigned colu
mn, unsigned row) const | 846 WebAXObject WebAXObject::cellForColumnAndRow(unsigned column, unsigned row) cons
t |
856 { | 847 { |
857 if (isDetached()) | 848 if (isDetached()) |
858 return WebAccessibilityObject(); | 849 return WebAXObject(); |
859 | 850 |
860 if (!m_private->isAccessibilityTable()) | 851 if (!m_private->isAccessibilityTable()) |
861 return WebAccessibilityObject(); | 852 return WebAXObject(); |
862 | 853 |
863 WebCore::AccessibilityTableCell* cell = static_cast<WebCore::AccessibilityTa
ble*>(m_private.get())->cellForColumnAndRow(column, row); | 854 WebCore::AccessibilityTableCell* cell = static_cast<WebCore::AccessibilityTa
ble*>(m_private.get())->cellForColumnAndRow(column, row); |
864 return WebAccessibilityObject(static_cast<WebCore::AccessibilityObject*>(cel
l)); | 855 return WebAXObject(static_cast<WebCore::AccessibilityObject*>(cell)); |
865 } | 856 } |
866 | 857 |
867 WebAccessibilityObject WebAccessibilityObject::headerContainerObject() const | 858 WebAXObject WebAXObject::headerContainerObject() const |
868 { | 859 { |
869 if (isDetached()) | 860 if (isDetached()) |
870 return WebAccessibilityObject(); | 861 return WebAXObject(); |
871 | 862 |
872 if (!m_private->isAccessibilityTable()) | 863 if (!m_private->isAccessibilityTable()) |
873 return WebAccessibilityObject(); | 864 return WebAXObject(); |
874 | 865 |
875 return WebAccessibilityObject(static_cast<WebCore::AccessibilityTable*>(m_pr
ivate.get())->headerContainer()); | 866 return WebAXObject(static_cast<WebCore::AccessibilityTable*>(m_private.get()
)->headerContainer()); |
876 } | 867 } |
877 | 868 |
878 WebAccessibilityObject WebAccessibilityObject::rowAtIndex(unsigned int rowIndex)
const | 869 WebAXObject WebAXObject::rowAtIndex(unsigned rowIndex) const |
879 { | 870 { |
880 if (isDetached()) | 871 if (isDetached()) |
881 return WebAccessibilityObject(); | 872 return WebAXObject(); |
882 | 873 |
883 if (!m_private->isAccessibilityTable()) | 874 if (!m_private->isAccessibilityTable()) |
884 return WebAccessibilityObject(); | 875 return WebAXObject(); |
885 | 876 |
886 const AccessibilityObject::AccessibilityChildrenVector& rows = static_cast<W
ebCore::AccessibilityTable*>(m_private.get())->rows(); | 877 const AccessibilityObject::AccessibilityChildrenVector& rows = static_cast<W
ebCore::AccessibilityTable*>(m_private.get())->rows(); |
887 if (rowIndex < rows.size()) | 878 if (rowIndex < rows.size()) |
888 return WebAccessibilityObject(rows[rowIndex]); | 879 return WebAXObject(rows[rowIndex]); |
889 | 880 |
890 return WebAccessibilityObject(); | 881 return WebAXObject(); |
891 } | 882 } |
892 | 883 |
893 WebAccessibilityObject WebAccessibilityObject::columnAtIndex(unsigned int column
Index) const | 884 WebAXObject WebAXObject::columnAtIndex(unsigned columnIndex) const |
894 { | 885 { |
895 if (isDetached()) | 886 if (isDetached()) |
896 return WebAccessibilityObject(); | 887 return WebAXObject(); |
897 | 888 |
898 if (!m_private->isAccessibilityTable()) | 889 if (!m_private->isAccessibilityTable()) |
899 return WebAccessibilityObject(); | 890 return WebAXObject(); |
900 | 891 |
901 const AccessibilityObject::AccessibilityChildrenVector& columns = static_cas
t<WebCore::AccessibilityTable*>(m_private.get())->columns(); | 892 const AccessibilityObject::AccessibilityChildrenVector& columns = static_cas
t<WebCore::AccessibilityTable*>(m_private.get())->columns(); |
902 if (columnIndex < columns.size()) | 893 if (columnIndex < columns.size()) |
903 return WebAccessibilityObject(columns[columnIndex]); | 894 return WebAXObject(columns[columnIndex]); |
904 | 895 |
905 return WebAccessibilityObject(); | 896 return WebAXObject(); |
906 } | 897 } |
907 | 898 |
908 unsigned WebAccessibilityObject::rowIndex() const | 899 unsigned WebAXObject::rowIndex() const |
909 { | 900 { |
910 if (isDetached()) | 901 if (isDetached()) |
911 return 0; | 902 return 0; |
912 | 903 |
913 if (!m_private->isTableRow()) | 904 if (!m_private->isTableRow()) |
914 return 0; | 905 return 0; |
915 | 906 |
916 return static_cast<WebCore::AccessibilityTableRow*>(m_private.get())->rowInd
ex(); | 907 return static_cast<WebCore::AccessibilityTableRow*>(m_private.get())->rowInd
ex(); |
917 } | 908 } |
918 | 909 |
919 WebAccessibilityObject WebAccessibilityObject::rowHeader() const | 910 WebAXObject WebAXObject::rowHeader() const |
920 { | 911 { |
921 if (isDetached()) | 912 if (isDetached()) |
922 return WebAccessibilityObject(); | 913 return WebAXObject(); |
923 | 914 |
924 if (!m_private->isTableRow()) | 915 if (!m_private->isTableRow()) |
925 return WebAccessibilityObject(); | 916 return WebAXObject(); |
926 | 917 |
927 return WebAccessibilityObject(static_cast<WebCore::AccessibilityTableRow*>(m
_private.get())->headerObject()); | 918 return WebAXObject(static_cast<WebCore::AccessibilityTableRow*>(m_private.ge
t())->headerObject()); |
928 } | 919 } |
929 | 920 |
930 unsigned WebAccessibilityObject::columnIndex() const | 921 unsigned WebAXObject::columnIndex() const |
931 { | 922 { |
932 if (isDetached()) | 923 if (isDetached()) |
933 return 0; | 924 return 0; |
934 | 925 |
935 if (m_private->roleValue() != ColumnRole) | 926 if (m_private->roleValue() != ColumnRole) |
936 return 0; | 927 return 0; |
937 | 928 |
938 return static_cast<WebCore::AccessibilityTableColumn*>(m_private.get())->col
umnIndex(); | 929 return static_cast<WebCore::AccessibilityTableColumn*>(m_private.get())->col
umnIndex(); |
939 } | 930 } |
940 | 931 |
941 WebAccessibilityObject WebAccessibilityObject::columnHeader() const | 932 WebAXObject WebAXObject::columnHeader() const |
942 { | 933 { |
943 if (isDetached()) | 934 if (isDetached()) |
944 return WebAccessibilityObject(); | 935 return WebAXObject(); |
945 | 936 |
946 if (m_private->roleValue() != ColumnRole) | 937 if (m_private->roleValue() != ColumnRole) |
947 return WebAccessibilityObject(); | 938 return WebAXObject(); |
948 | 939 |
949 return WebAccessibilityObject(static_cast<WebCore::AccessibilityTableColumn*
>(m_private.get())->headerObject()); | 940 return WebAXObject(static_cast<WebCore::AccessibilityTableColumn*>(m_private
.get())->headerObject()); |
950 } | 941 } |
951 | 942 |
952 unsigned WebAccessibilityObject::cellColumnIndex() const | 943 unsigned WebAXObject::cellColumnIndex() const |
953 { | 944 { |
954 if (isDetached()) | 945 if (isDetached()) |
955 return 0; | 946 return 0; |
956 | 947 |
957 if (!m_private->isTableCell()) | 948 if (!m_private->isTableCell()) |
958 return 0; | 949 return 0; |
959 | 950 |
960 pair<unsigned, unsigned> columnRange; | 951 pair<unsigned, unsigned> columnRange; |
961 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->columnIndexR
ange(columnRange); | 952 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->columnIndexR
ange(columnRange); |
962 return columnRange.first; | 953 return columnRange.first; |
963 } | 954 } |
964 | 955 |
965 unsigned WebAccessibilityObject::cellColumnSpan() const | 956 unsigned WebAXObject::cellColumnSpan() const |
966 { | 957 { |
967 if (isDetached()) | 958 if (isDetached()) |
968 return 0; | 959 return 0; |
969 | 960 |
970 if (!m_private->isTableCell()) | 961 if (!m_private->isTableCell()) |
971 return 0; | 962 return 0; |
972 | 963 |
973 pair<unsigned, unsigned> columnRange; | 964 pair<unsigned, unsigned> columnRange; |
974 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->columnIndexR
ange(columnRange); | 965 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->columnIndexR
ange(columnRange); |
975 return columnRange.second; | 966 return columnRange.second; |
976 } | 967 } |
977 | 968 |
978 unsigned WebAccessibilityObject::cellRowIndex() const | 969 unsigned WebAXObject::cellRowIndex() const |
979 { | 970 { |
980 if (isDetached()) | 971 if (isDetached()) |
981 return 0; | 972 return 0; |
982 | 973 |
983 if (!m_private->isTableCell()) | 974 if (!m_private->isTableCell()) |
984 return 0; | 975 return 0; |
985 | 976 |
986 pair<unsigned, unsigned> rowRange; | 977 pair<unsigned, unsigned> rowRange; |
987 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->rowIndexRang
e(rowRange); | 978 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->rowIndexRang
e(rowRange); |
988 return rowRange.first; | 979 return rowRange.first; |
989 } | 980 } |
990 | 981 |
991 unsigned WebAccessibilityObject::cellRowSpan() const | 982 unsigned WebAXObject::cellRowSpan() const |
992 { | 983 { |
993 if (isDetached()) | 984 if (isDetached()) |
994 return 0; | 985 return 0; |
995 | 986 |
996 if (!m_private->isTableCell()) | 987 if (!m_private->isTableCell()) |
997 return 0; | 988 return 0; |
998 | 989 |
999 pair<unsigned, unsigned> rowRange; | 990 pair<unsigned, unsigned> rowRange; |
1000 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->rowIndexRang
e(rowRange); | 991 static_cast<WebCore::AccessibilityTableCell*>(m_private.get())->rowIndexRang
e(rowRange); |
1001 return rowRange.second; | 992 return rowRange.second; |
1002 } | 993 } |
1003 | 994 |
1004 void WebAccessibilityObject::scrollToMakeVisible() const | 995 void WebAXObject::scrollToMakeVisible() const |
1005 { | 996 { |
1006 if (!isDetached()) | 997 if (!isDetached()) |
1007 m_private->scrollToMakeVisible(); | 998 m_private->scrollToMakeVisible(); |
1008 } | 999 } |
1009 | 1000 |
1010 void WebAccessibilityObject::scrollToMakeVisibleWithSubFocus(const WebRect& subf
ocus) const | 1001 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const |
1011 { | 1002 { |
1012 if (!isDetached()) | 1003 if (!isDetached()) |
1013 m_private->scrollToMakeVisibleWithSubFocus(subfocus); | 1004 m_private->scrollToMakeVisibleWithSubFocus(subfocus); |
1014 } | 1005 } |
1015 | 1006 |
1016 void WebAccessibilityObject::scrollToGlobalPoint(const WebPoint& point) const | 1007 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const |
1017 { | 1008 { |
1018 if (!isDetached()) | 1009 if (!isDetached()) |
1019 m_private->scrollToGlobalPoint(point); | 1010 m_private->scrollToGlobalPoint(point); |
1020 } | 1011 } |
1021 | 1012 |
1022 WebAccessibilityObject::WebAccessibilityObject(const WTF::PassRefPtr<WebCore::Ac
cessibilityObject>& object) | 1013 WebAXObject::WebAXObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>& ob
ject) |
1023 : m_private(object) | 1014 : m_private(object) |
1024 { | 1015 { |
1025 } | 1016 } |
1026 | 1017 |
1027 WebAccessibilityObject& WebAccessibilityObject::operator=(const WTF::PassRefPtr<
WebCore::AccessibilityObject>& object) | 1018 WebAXObject& WebAXObject::operator=(const WTF::PassRefPtr<WebCore::Accessibility
Object>& object) |
1028 { | 1019 { |
1029 m_private = object; | 1020 m_private = object; |
1030 return *this; | 1021 return *this; |
1031 } | 1022 } |
1032 | 1023 |
1033 WebAccessibilityObject::operator WTF::PassRefPtr<WebCore::AccessibilityObject>()
const | 1024 WebAXObject::operator WTF::PassRefPtr<WebCore::AccessibilityObject>() const |
1034 { | 1025 { |
1035 return m_private.get(); | 1026 return m_private.get(); |
1036 } | 1027 } |
1037 | 1028 |
1038 } // namespace WebKit | 1029 } // namespace WebKit |
OLD | NEW |