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

Unified Diff: Source/modules/accessibility/AXObject.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
Index: Source/modules/accessibility/AXObject.cpp
diff --git a/Source/modules/accessibility/AXObject.cpp b/Source/modules/accessibility/AXObject.cpp
index 4d7f299b587880356bdb65922419976cefdd4d33..90a72e45f9f2a2836ce7cd19e4c349bcaf4e3785 100644
--- a/Source/modules/accessibility/AXObject.cpp
+++ b/Source/modules/accessibility/AXObject.cpp
@@ -107,10 +107,12 @@ const RoleEntry roles[] = {
{ "rowheader", RowHeaderRole },
{ "scrollbar", ScrollBarRole },
{ "search", SearchRole },
+ { "searchbox", SearchBoxRole },
{ "separator", SplitterRole },
{ "slider", SliderRole },
{ "spinbutton", SpinButtonRole },
{ "status", StatusRole },
+ { "switch", SwitchRole },
{ "tab", TabRole },
{ "tablist", TabListRole },
{ "tabpanel", TabPanelRole },
@@ -260,7 +262,7 @@ bool AXObject::isDetached() const
bool AXObject::isARIATextControl() const
{
- return ariaRoleAttribute() == TextAreaRole || ariaRoleAttribute() == TextFieldRole;
+ return ariaRoleAttribute() == TextAreaRole || ariaRoleAttribute() == TextFieldRole || ariaRoleAttribute() == SearchBoxRole;
}
bool AXObject::isButton() const
@@ -320,6 +322,7 @@ bool AXObject::isTextControl() const
case TextAreaRole:
case TextFieldRole:
case ComboBoxRole:
+ case SearchBoxRole:
return true;
default:
return false;
@@ -482,6 +485,7 @@ String AXObject::actionVerb() const
case RadioButtonRole:
return queryString(WebLocalizedString::AXRadioButtonActionVerb);
case CheckBoxRole:
+ case SwitchRole:
return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxActionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb);
case LinkRole:
return queryString(WebLocalizedString::AXLinkActionVerb);
@@ -506,7 +510,7 @@ AccessibilityButtonState AXObject::checkboxOrRadioValue() const
return ButtonStateOn;
if (equalIgnoringCase(result, "mixed")) {
AccessibilityRole role = ariaRoleAttribute();
- if (role == RadioButtonRole || role == MenuItemRadioRole)
+ if (role == RadioButtonRole || role == MenuItemRadioRole || role == SwitchRole)
return ButtonStateOff;
return ButtonStateMixed;
}
@@ -1038,7 +1042,7 @@ bool AXObject::isARIAControl(AccessibilityRole ariaRole)
bool AXObject::isARIAInput(AccessibilityRole ariaRole)
{
- return ariaRole == RadioButtonRole || ariaRole == CheckBoxRole || ariaRole == TextFieldRole;
+ return ariaRole == RadioButtonRole || ariaRole == CheckBoxRole || ariaRole == TextFieldRole || ariaRole == SwitchRole || ariaRole == SearchBoxRole;
}
AccessibilityRole AXObject::ariaRoleToWebCoreRole(const String& value)
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | Source/modules/accessibility/InspectorAccessibilityAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698