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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 #include "modules/accessibility/AXObjectCacheImpl.h" | 46 #include "modules/accessibility/AXObjectCacheImpl.h" |
47 #include "modules/accessibility/AXTable.h" | 47 #include "modules/accessibility/AXTable.h" |
48 #include "modules/accessibility/AXTableCell.h" | 48 #include "modules/accessibility/AXTableCell.h" |
49 #include "modules/accessibility/AXTableColumn.h" | 49 #include "modules/accessibility/AXTableColumn.h" |
50 #include "modules/accessibility/AXTableRow.h" | 50 #include "modules/accessibility/AXTableRow.h" |
51 #include "public/platform/WebFloatRect.h" | 51 #include "public/platform/WebFloatRect.h" |
52 #include "public/platform/WebPoint.h" | 52 #include "public/platform/WebPoint.h" |
53 #include "public/platform/WebRect.h" | 53 #include "public/platform/WebRect.h" |
54 #include "public/platform/WebString.h" | 54 #include "public/platform/WebString.h" |
55 #include "public/platform/WebURL.h" | 55 #include "public/platform/WebURL.h" |
56 #include "public/web/WebAXStrings.h" | |
56 #include "public/web/WebDocument.h" | 57 #include "public/web/WebDocument.h" |
57 #include "public/web/WebElement.h" | 58 #include "public/web/WebElement.h" |
58 #include "public/web/WebNode.h" | 59 #include "public/web/WebNode.h" |
59 #include "web/WebLocalFrameImpl.h" | 60 #include "web/WebLocalFrameImpl.h" |
60 #include "web/WebViewImpl.h" | 61 #include "web/WebViewImpl.h" |
61 #include "wtf/text/StringBuilder.h" | 62 #include "wtf/text/StringBuilder.h" |
62 | 63 |
63 namespace blink { | 64 namespace blink { |
64 | 65 |
65 class WebAXSparseAttributeClientAdapter : public AXSparseAttributeClient { | 66 class WebAXSparseAttributeClientAdapter : public AXSparseAttributeClient { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 return m_private->ariaAutoComplete(); | 275 return m_private->ariaAutoComplete(); |
275 } | 276 } |
276 | 277 |
277 WebAXAriaCurrentState WebAXObject::ariaCurrentState() const { | 278 WebAXAriaCurrentState WebAXObject::ariaCurrentState() const { |
278 if (isDetached()) | 279 if (isDetached()) |
279 return WebAXAriaCurrentStateUndefined; | 280 return WebAXAriaCurrentStateUndefined; |
280 | 281 |
281 return static_cast<WebAXAriaCurrentState>(m_private->ariaCurrentState()); | 282 return static_cast<WebAXAriaCurrentState>(m_private->ariaCurrentState()); |
282 } | 283 } |
283 | 284 |
284 bool WebAXObject::isButtonStateMixed() const { | 285 WebAXCheckedState WebAXObject::checkedState() const { |
285 if (isDetached()) | 286 if (isDetached()) |
286 return false; | 287 return WebAXCheckedFalse; |
287 | 288 |
288 return m_private->checkboxOrRadioValue() == ButtonStateMixed; | 289 return static_cast<WebAXCheckedState>(m_private->checkedState()); |
289 } | 290 } |
290 | 291 |
291 bool WebAXObject::isChecked() const { | 292 WebString WebAXObject::checked() const { |
dmazzoni
2017/02/28 00:10:50
You shouldn't need this. checkedState() should be
| |
292 if (isDetached()) | 293 if (isDetached() || !m_private->isCheckable()) { |
293 return false; | 294 return WebString(); |
295 } | |
294 | 296 |
295 return m_private->isChecked(); | 297 switch(m_private->checkedState()) { |
298 case ButtonStateOff: | |
299 return WebString::fromUTF8(kWebAXCheckedFalse); | |
300 break; | |
301 case ButtonStateOn: | |
302 return WebString::fromUTF8(kWebAXCheckedTrue); | |
303 break; | |
304 case ButtonStateMixed: | |
305 return WebString::fromUTF8(kWebAXCheckedMixed); | |
306 break; | |
307 } | |
296 } | 308 } |
297 | 309 |
298 bool WebAXObject::isClickable() const { | 310 bool WebAXObject::isClickable() const { |
299 if (isDetached()) | 311 if (isDetached()) |
300 return false; | 312 return false; |
301 | 313 |
302 return m_private->isClickable(); | 314 return m_private->isClickable(); |
303 } | 315 } |
304 | 316 |
305 bool WebAXObject::isCollapsed() const { | 317 bool WebAXObject::isCollapsed() const { |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1532 WebAXObject& WebAXObject::operator=(AXObject* object) { | 1544 WebAXObject& WebAXObject::operator=(AXObject* object) { |
1533 m_private = object; | 1545 m_private = object; |
1534 return *this; | 1546 return *this; |
1535 } | 1547 } |
1536 | 1548 |
1537 WebAXObject::operator AXObject*() const { | 1549 WebAXObject::operator AXObject*() const { |
1538 return m_private.get(); | 1550 return m_private.get(); |
1539 } | 1551 } |
1540 | 1552 |
1541 } // namespace blink | 1553 } // namespace blink |
OLD | NEW |