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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObject.cpp

Issue 1809573003: Fix support for accessible action verbs and performing the default action. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix two tests Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 return AccessibilityOrientationUndefined; 910 return AccessibilityOrientationUndefined;
911 } 911 }
912 912
913 static String queryString(WebLocalizedString::Name name) 913 static String queryString(WebLocalizedString::Name name)
914 { 914 {
915 return Locale::defaultLocale().queryString(name); 915 return Locale::defaultLocale().queryString(name);
916 } 916 }
917 917
918 String AXObject::actionVerb() const 918 String AXObject::actionVerb() const
919 { 919 {
920 // FIXME: Need to add verbs for select elements. 920 if (!actionElement())
921 return emptyString();
921 922
922 switch (roleValue()) { 923 switch (roleValue()) {
923 case ButtonRole: 924 case ButtonRole:
924 case ToggleButtonRole: 925 case ToggleButtonRole:
925 return queryString(WebLocalizedString::AXButtonActionVerb); 926 return queryString(WebLocalizedString::AXButtonActionVerb);
926 case TextFieldRole: 927 case TextFieldRole:
927 return queryString(WebLocalizedString::AXTextFieldActionVerb); 928 return queryString(WebLocalizedString::AXTextFieldActionVerb);
928 case RadioButtonRole: 929 case RadioButtonRole:
929 return queryString(WebLocalizedString::AXRadioButtonActionVerb); 930 return queryString(WebLocalizedString::AXRadioButtonActionVerb);
930 case CheckBoxRole: 931 case CheckBoxRole:
931 case SwitchRole: 932 case SwitchRole:
932 return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxAc tionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb); 933 return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxAc tionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb);
933 case LinkRole: 934 case LinkRole:
934 return queryString(WebLocalizedString::AXLinkActionVerb); 935 return queryString(WebLocalizedString::AXLinkActionVerb);
935 case PopUpButtonRole: 936 case PopUpButtonRole:
936 // FIXME: Implement. 937 return queryString(WebLocalizedString::AXPopUpButtonActionVerb);
937 return String();
938 case MenuListPopupRole:
939 // FIXME: Implement.
940 return String();
941 default: 938 default:
942 return emptyString(); 939 return queryString(WebLocalizedString::AXDefaultActionVerb);
943 } 940 }
944 } 941 }
945 942
946 AccessibilityButtonState AXObject::checkboxOrRadioValue() const 943 AccessibilityButtonState AXObject::checkboxOrRadioValue() const
947 { 944 {
948 const AtomicString& checkedAttribute = getAttribute(aria_checkedAttr); 945 const AtomicString& checkedAttribute = getAttribute(aria_checkedAttr);
949 if (equalIgnoringCase(checkedAttribute, "true")) 946 if (equalIgnoringCase(checkedAttribute, "true"))
950 return ButtonStateOn; 947 return ButtonStateOn;
951 948
952 if (equalIgnoringCase(checkedAttribute, "mixed")) { 949 if (equalIgnoringCase(checkedAttribute, "mixed")) {
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 1685
1689 DEFINE_TRACE(AXObject) 1686 DEFINE_TRACE(AXObject)
1690 { 1687 {
1691 visitor->trace(m_children); 1688 visitor->trace(m_children);
1692 visitor->trace(m_parent); 1689 visitor->trace(m_parent);
1693 visitor->trace(m_cachedLiveRegionRoot); 1690 visitor->trace(m_cachedLiveRegionRoot);
1694 visitor->trace(m_axObjectCache); 1691 visitor->trace(m_axObjectCache);
1695 } 1692 }
1696 1693
1697 } // namespace blink 1694 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXObject.h ('k') | third_party/WebKit/public/platform/WebLocalizedString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698