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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 1488893002: Stops using SYSTEM_STATE_INDETERMINATE as it makes radio buttons appear to have a mixed state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a few test expectations. Created 5 years 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/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index 2e734034e760bf391cec6345f1fd7b944ed3e064..dd04fa5699814abeeac3806a2684a748df40ce3c 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -994,15 +994,6 @@ AccessibilityExpanded AXNodeObject::isExpanded() const
return ExpandedUndefined;
}
-bool AXNodeObject::isIndeterminate() const
-{
- Node* node = this->node();
- if (!isHTMLInputElement(node))
- return false;
-
- return toHTMLInputElement(node)->shouldAppearIndeterminate();
-}
-
bool AXNodeObject::isPressed() const
{
if (!isButton())
@@ -1244,6 +1235,9 @@ String AXNodeObject::text() const
AccessibilityButtonState AXNodeObject::checkboxOrRadioValue() const
{
+ if (isNativeCheckboxInMixedState())
+ return ButtonStateMixed;
+
if (isNativeCheckboxOrRadio())
return isChecked() ? ButtonStateOn : ButtonStateOff;
@@ -1487,6 +1481,16 @@ AXObject* AXNodeObject::findChildWithTagName(const HTMLQualifiedName& tagName) c
return 0;
}
+bool AXNodeObject::isNativeCheckboxInMixedState() const
+{
+ if (!isHTMLInputElement(m_node))
+ return false;
+
+ HTMLInputElement* input = toHTMLInputElement(m_node);
+ return input->type() == InputTypeNames::checkbox
+ && input->shouldAppearIndeterminate();
+}
+
//
// New AX name calculation.
//

Powered by Google App Engine
This is Rietveld 408576698