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

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

Issue 2707263011: Test aria-pressed=mixed on windows (Closed)
Patch Set: git cl try Created 3 years, 7 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/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 7e3a068ce75315036f1db885e32053cd5c3767df..10d953f2c6c7d44f467b3e0425018a7d6dcae2d4 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -1218,24 +1218,18 @@ bool AXNodeObject::IsModal() const {
return false;
}
-bool AXNodeObject::IsPressed() const {
- if (!IsButton())
- return false;
-
- Node* node = this->GetNode();
- if (!node)
- return false;
-
+AccessibilityButtonState AXNodeObject::PressedState() const {
// ARIA button with aria-pressed not undefined, then check for aria-pressed
// attribute rather than getNode()->active()
- if (AriaRoleAttribute() == kToggleButtonRole) {
- if (EqualIgnoringASCIICase(GetAttribute(aria_pressedAttr), "true") ||
- EqualIgnoringASCIICase(GetAttribute(aria_pressedAttr), "mixed"))
- return true;
- return false;
+ if (this->GetNode() && RoleValue() == kToggleButtonRole) {
+ auto pressed = GetAttribute(aria_pressedAttr);
+ if (EqualIgnoringASCIICase(pressed, "true"))
+ return kButtonStateOn;
+ if (EqualIgnoringASCIICase(pressed, "mixed"))
+ return kButtonStateMixed;
}
- return node->IsActive();
+ return kButtonStateOff;
}
bool AXNodeObject::IsReadOnly() const {

Powered by Google App Engine
This is Rietveld 408576698