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

Unified Diff: content/browser/accessibility/browser_accessibility_android.cc

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: content/browser/accessibility/browser_accessibility_android.cc
diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc
index ef7d00893e993cc69f2f0d213e2717fd3703d421..2efc3e1349c9b59ea5cca6ed904a61262ab8c599 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -140,28 +140,23 @@ bool BrowserAccessibilityAndroid::PlatformIsLeaf() const {
}
bool BrowserAccessibilityAndroid::IsCheckable() const {
- bool checkable = false;
- bool is_aria_pressed_defined;
- bool is_mixed;
- GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed);
- if (GetRole() == ui::AX_ROLE_CHECK_BOX ||
- GetRole() == ui::AX_ROLE_RADIO_BUTTON ||
- GetRole() == ui::AX_ROLE_MENU_ITEM_CHECK_BOX ||
- GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO ||
- is_aria_pressed_defined) {
- checkable = true;
- }
- // TODO(aleventhal) does this ever happen when checkable is not true yet?
- if (HasIntAttribute(ui::AX_ATTR_CHECKED_STATE))
- checkable = true;
- return checkable;
+ return GetRole() == ui::AX_ROLE_CHECK_BOX ||
+ GetRole() == ui::AX_ROLE_RADIO_BUTTON ||
+ GetRole() == ui::AX_ROLE_MENU_ITEM_CHECK_BOX ||
+ GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO ||
+ GetRole() == ui::AX_ROLE_TOGGLE_BUTTON ||
+ // TODO(aleventhal) does this ever happen when checkable is not true
+ // yet?
+ HasIntAttribute(ui::AX_ATTR_CHECKED_STATE);
}
bool BrowserAccessibilityAndroid::IsChecked() const {
- const auto checked_state = static_cast<ui::AXCheckedState>(
+ const auto checked_state = static_cast<ui::AXButtonState>(
GetIntAttribute(ui::AX_ATTR_CHECKED_STATE));
- return (checked_state == ui::AX_CHECKED_STATE_TRUE ||
- HasState(ui::AX_STATE_PRESSED));
+ const auto pressed_state = static_cast<ui::AXButtonState>(
+ GetIntAttribute(ui::AX_ATTR_PRESSED_STATE));
+ return (checked_state == ui::AX_BUTTON_STATE_TRUE ||
+ pressed_state == ui::AX_BUTTON_STATE_TRUE);
}
bool BrowserAccessibilityAndroid::IsClickable() const {
@@ -197,8 +192,9 @@ bool BrowserAccessibilityAndroid::IsCollectionItem() const {
}
bool BrowserAccessibilityAndroid::IsContentInvalid() const {
- std::string invalid;
- return GetHtmlAttribute("aria-invalid", &invalid);
+ return HasIntAttribute(ui::AX_ATTR_INVALID_STATE) &&
+ GetIntAttribute(ui::AX_ATTR_INVALID_STATE) != ui
+ : AX_ATTR_INVALID_STATE_FALSE;
}
bool BrowserAccessibilityAndroid::IsDismissable() const {
@@ -1111,7 +1107,7 @@ int BrowserAccessibilityAndroid::AndroidInputType() const {
return ANDROID_TEXT_INPUTTYPE_TYPE_NULL;
std::string type;
- if (!GetHtmlAttribute("type", &type))
+ if (!GetData().GetHtmlAttribute("type", type))
return ANDROID_TEXT_INPUTTYPE_TYPE_TEXT;
if (type.empty() || type == "text" || type == "search")
« no previous file with comments | « content/browser/accessibility/browser_accessibility.cc ('k') | content/browser/accessibility/browser_accessibility_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698