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

Unified Diff: third_party/WebKit/Source/web/WebAXObject.cpp

Issue 2694903010: AX checked state changes (Closed)
Patch Set: Fix compiler error Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698