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

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

Issue 1022673003: Implementation of new roles added in ARIA 1.1 draft. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebasing change to latest Created 5 years, 9 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
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index b57938e365e7efa71f7380b9b08ee9f39cda4570..d803643d6b48e2c8ff00877853baf5c13df0b9cc 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -694,14 +694,19 @@ bool AXNodeObject::isChecked() const
if (isHTMLInputElement(*node))
return toHTMLInputElement(*node).shouldAppearChecked();
- // Else, if this is an ARIA checkbox or radio OR ARIA role menuitemcheckbox
- // or menuitemradio, respect the aria-checked attribute
- AccessibilityRole ariaRole = ariaRoleAttribute();
- if (ariaRole == RadioButtonRole || ariaRole == CheckBoxRole
- || ariaRole == MenuItemCheckBoxRole || ariaRole == MenuItemRadioRole) {
+ // Else, if this is an ARIA role checkbox or radio or menuitemcheckbox
+ // or menuitemradio or switch, respect the aria-checked attribute
+ switch (ariaRoleAttribute()) {
+ case CheckBoxRole:
+ case MenuItemCheckBoxRole:
+ case MenuItemRadioRole:
+ case RadioButtonRole:
+ case SwitchRole:
if (equalIgnoringCase(getAttribute(aria_checkedAttr), "true"))
return true;
return false;
+ default:
+ break;
}
// Otherwise it's not checked
@@ -1420,6 +1425,7 @@ String AXNodeObject::title(TextUnderElementMode mode) const
case MenuItemCheckBoxRole:
case MenuItemRadioRole:
case RadioButtonRole:
+ case SwitchRole:
case TabRole:
return textUnderElement(mode);
// SVGRoots should not use the text under itself as a title. That could include the text of objects like <text>.
@@ -1675,6 +1681,7 @@ bool AXNodeObject::canHaveChildren() const
case PopUpButtonRole:
case CheckBoxRole:
case RadioButtonRole:
+ case SwitchRole:
case TabRole:
case ToggleButtonRole:
case ListBoxOptionRole:
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698