OLD | NEW |
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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 updateCachedAttributeValuesIfNeeded(); | 897 updateCachedAttributeValuesIfNeeded(); |
898 return m_cachedBackgroundColor; | 898 return m_cachedBackgroundColor; |
899 } | 899 } |
900 | 900 |
901 AccessibilityOrientation AXObject::orientation() const { | 901 AccessibilityOrientation AXObject::orientation() const { |
902 // In ARIA 1.1, the default value for aria-orientation changed from | 902 // In ARIA 1.1, the default value for aria-orientation changed from |
903 // horizontal to undefined. | 903 // horizontal to undefined. |
904 return AccessibilityOrientationUndefined; | 904 return AccessibilityOrientationUndefined; |
905 } | 905 } |
906 | 906 |
907 static String queryString(WebLocalizedString::Name name) { | 907 AXSupportedAction AXObject::action() const { |
908 return Locale::defaultLocale().queryString(name); | |
909 } | |
910 | |
911 String AXObject::actionVerb() const { | |
912 if (!actionElement()) | 908 if (!actionElement()) |
913 return emptyString(); | 909 return AXSupportedAction::None; |
914 | 910 |
915 switch (roleValue()) { | 911 switch (roleValue()) { |
916 case ButtonRole: | 912 case ButtonRole: |
917 case ToggleButtonRole: | 913 case ToggleButtonRole: |
918 return queryString(WebLocalizedString::AXButtonActionVerb); | 914 return AXSupportedAction::Press; |
919 case TextFieldRole: | 915 case TextFieldRole: |
920 return queryString(WebLocalizedString::AXTextFieldActionVerb); | 916 return AXSupportedAction::Activate; |
921 case RadioButtonRole: | 917 case RadioButtonRole: |
922 return queryString(WebLocalizedString::AXRadioButtonActionVerb); | 918 return AXSupportedAction::Select; |
923 case CheckBoxRole: | 919 case CheckBoxRole: |
924 case SwitchRole: | 920 case SwitchRole: |
925 return queryString( | 921 return isChecked() ? AXSupportedAction::Check |
926 isChecked() ? WebLocalizedString::AXCheckedCheckBoxActionVerb | 922 : AXSupportedAction::Uncheck; |
927 : WebLocalizedString::AXUncheckedCheckBoxActionVerb); | |
928 case LinkRole: | 923 case LinkRole: |
929 return queryString(WebLocalizedString::AXLinkActionVerb); | 924 return AXSupportedAction::Jump; |
930 case PopUpButtonRole: | 925 case PopUpButtonRole: |
931 return queryString(WebLocalizedString::AXPopUpButtonActionVerb); | 926 return AXSupportedAction::Open; |
932 default: | 927 default: |
933 return queryString(WebLocalizedString::AXDefaultActionVerb); | 928 return AXSupportedAction::Click; |
934 } | 929 } |
935 } | 930 } |
936 | 931 |
937 AccessibilityButtonState AXObject::checkboxOrRadioValue() const { | 932 AccessibilityButtonState AXObject::checkboxOrRadioValue() const { |
938 const AtomicString& checkedAttribute = getAttribute(aria_checkedAttr); | 933 const AtomicString& checkedAttribute = getAttribute(aria_checkedAttr); |
939 if (equalIgnoringCase(checkedAttribute, "true")) | 934 if (equalIgnoringCase(checkedAttribute, "true")) |
940 return ButtonStateOn; | 935 return ButtonStateOn; |
941 | 936 |
942 if (equalIgnoringCase(checkedAttribute, "mixed")) { | 937 if (equalIgnoringCase(checkedAttribute, "mixed")) { |
943 // Only checkboxes should support the mixed state. | 938 // Only checkboxes should support the mixed state. |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 } | 1738 } |
1744 | 1739 |
1745 DEFINE_TRACE(AXObject) { | 1740 DEFINE_TRACE(AXObject) { |
1746 visitor->trace(m_children); | 1741 visitor->trace(m_children); |
1747 visitor->trace(m_parent); | 1742 visitor->trace(m_parent); |
1748 visitor->trace(m_cachedLiveRegionRoot); | 1743 visitor->trace(m_cachedLiveRegionRoot); |
1749 visitor->trace(m_axObjectCache); | 1744 visitor->trace(m_axObjectCache); |
1750 } | 1745 } |
1751 | 1746 |
1752 } // namespace blink | 1747 } // namespace blink |
OLD | NEW |