Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebAXObject.cpp |
| diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp |
| index 648e6c624d90e3a9db877baece686ddc15769a87..7db73cef07df2b9df12d265e3655e79e0404eac8 100644 |
| --- a/third_party/WebKit/Source/web/WebAXObject.cpp |
| +++ b/third_party/WebKit/Source/web/WebAXObject.cpp |
| @@ -53,6 +53,7 @@ |
| #include "public/platform/WebRect.h" |
| #include "public/platform/WebString.h" |
| #include "public/platform/WebURL.h" |
| +#include "public/web/WebAXStrings.h" |
| #include "public/web/WebDocument.h" |
| #include "public/web/WebElement.h" |
| #include "public/web/WebNode.h" |
| @@ -281,18 +282,29 @@ WebAXAriaCurrentState WebAXObject::ariaCurrentState() const { |
| return static_cast<WebAXAriaCurrentState>(m_private->ariaCurrentState()); |
| } |
| -bool WebAXObject::isButtonStateMixed() const { |
| +WebAXCheckedState WebAXObject::checkedState() const { |
| if (isDetached()) |
| - return false; |
| + return WebAXCheckedFalse; |
| - return m_private->checkboxOrRadioValue() == ButtonStateMixed; |
| + return static_cast<WebAXCheckedState>(m_private->checkedState()); |
| } |
| -bool WebAXObject::isChecked() const { |
| - if (isDetached()) |
| - return false; |
| +WebString WebAXObject::checked() const { |
|
dmazzoni
2017/02/28 00:10:50
You shouldn't need this. checkedState() should be
|
| + if (isDetached() || !m_private->isCheckable()) { |
| + return WebString(); |
| + } |
| - return m_private->isChecked(); |
| + switch(m_private->checkedState()) { |
| + case ButtonStateOff: |
| + return WebString::fromUTF8(kWebAXCheckedFalse); |
| + break; |
| + case ButtonStateOn: |
| + return WebString::fromUTF8(kWebAXCheckedTrue); |
| + break; |
| + case ButtonStateMixed: |
| + return WebString::fromUTF8(kWebAXCheckedMixed); |
| + break; |
| + } |
| } |
| bool WebAXObject::isClickable() const { |