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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 typedef HashMap<String, AccessibilityRole, CaseFoldingHash> ARIARoleMap; | 50 typedef HashMap<String, AccessibilityRole, CaseFoldingHash> ARIARoleMap; |
51 | 51 |
52 struct RoleEntry { | 52 struct RoleEntry { |
53 String ariaRole; | 53 String ariaRole; |
54 AccessibilityRole webcoreRole; | 54 AccessibilityRole webcoreRole; |
55 }; | 55 }; |
56 | 56 |
57 static ARIARoleMap* createARIARoleMap() | 57 static ARIARoleMap* createARIARoleMap() |
58 { | 58 { |
59 const RoleEntry roles[] = { | 59 const RoleEntry roles[] = { |
60 { "alert", ApplicationAlertRole }, | 60 { "alert", AlertRole }, |
61 { "alertdialog", ApplicationAlertDialogRole }, | 61 { "alertdialog", AlertDialogRole }, |
62 { "application", LandmarkApplicationRole }, | 62 { "application", ApplicationRole }, |
63 { "article", DocumentArticleRole }, | 63 { "article", ArticleRole }, |
64 { "banner", LandmarkBannerRole }, | 64 { "banner", BannerRole }, |
65 { "button", ButtonRole }, | 65 { "button", ButtonRole }, |
66 { "checkbox", CheckBoxRole }, | 66 { "checkbox", CheckBoxRole }, |
67 { "complementary", LandmarkComplementaryRole }, | 67 { "complementary", ComplementaryRole }, |
68 { "contentinfo", LandmarkContentInfoRole }, | 68 { "contentinfo", ContentInfoRole }, |
69 { "dialog", ApplicationDialogRole }, | 69 { "dialog", DialogRole }, |
70 { "directory", DirectoryRole }, | 70 { "directory", DirectoryRole }, |
71 { "grid", TableRole }, | 71 { "grid", TableRole }, |
72 { "gridcell", CellRole }, | 72 { "gridcell", CellRole }, |
73 { "columnheader", ColumnHeaderRole }, | 73 { "columnheader", ColumnHeaderRole }, |
74 { "combobox", ComboBoxRole }, | 74 { "combobox", ComboBoxRole }, |
75 { "definition", DefinitionRole }, | 75 { "definition", DefinitionRole }, |
76 { "document", DocumentRole }, | 76 { "document", DocumentRole }, |
77 { "rowheader", RowHeaderRole }, | 77 { "rowheader", RowHeaderRole }, |
78 { "group", GroupRole }, | 78 { "group", GroupRole }, |
79 { "heading", HeadingRole }, | 79 { "heading", HeadingRole }, |
80 { "img", ImageRole }, | 80 { "img", ImageRole }, |
81 { "link", WebCoreLinkRole }, | 81 { "link", LinkRole }, |
82 { "list", ListRole }, | 82 { "list", ListRole }, |
83 { "listitem", ListItemRole }, | 83 { "listitem", ListItemRole }, |
84 { "listbox", ListBoxRole }, | 84 { "listbox", ListBoxRole }, |
85 { "log", ApplicationLogRole }, | 85 { "log", LogRole }, |
86 // "option" isn't here because it may map to different roles depending o
n the parent element's role | 86 // "option" isn't here because it may map to different roles depending o
n the parent element's role |
87 { "main", LandmarkMainRole }, | 87 { "main", MainRole }, |
88 { "marquee", ApplicationMarqueeRole }, | 88 { "marquee", MarqueeRole }, |
89 { "math", DocumentMathRole }, | 89 { "math", MathRole }, |
90 { "menu", MenuRole }, | 90 { "menu", MenuRole }, |
91 { "menubar", MenuBarRole }, | 91 { "menubar", MenuBarRole }, |
92 { "menuitem", MenuItemRole }, | 92 { "menuitem", MenuItemRole }, |
93 { "menuitemcheckbox", MenuItemRole }, | 93 { "menuitemcheckbox", MenuItemRole }, |
94 { "menuitemradio", MenuItemRole }, | 94 { "menuitemradio", MenuItemRole }, |
95 { "note", DocumentNoteRole }, | 95 { "note", NoteRole }, |
96 { "navigation", LandmarkNavigationRole }, | 96 { "navigation", NavigationRole }, |
97 { "option", ListBoxOptionRole }, | 97 { "option", ListBoxOptionRole }, |
98 { "presentation", PresentationalRole }, | 98 { "presentation", PresentationalRole }, |
99 { "progressbar", ProgressIndicatorRole }, | 99 { "progressbar", ProgressIndicatorRole }, |
100 { "radio", RadioButtonRole }, | 100 { "radio", RadioButtonRole }, |
101 { "radiogroup", RadioGroupRole }, | 101 { "radiogroup", RadioGroupRole }, |
102 { "region", DocumentRegionRole }, | 102 { "region", RegionRole }, |
103 { "row", RowRole }, | 103 { "row", RowRole }, |
104 { "scrollbar", ScrollBarRole }, | 104 { "scrollbar", ScrollBarRole }, |
105 { "search", LandmarkSearchRole }, | 105 { "search", SearchRole }, |
106 { "separator", SplitterRole }, | 106 { "separator", SplitterRole }, |
107 { "slider", SliderRole }, | 107 { "slider", SliderRole }, |
108 { "spinbutton", SpinButtonRole }, | 108 { "spinbutton", SpinButtonRole }, |
109 { "status", ApplicationStatusRole }, | 109 { "status", StatusRole }, |
110 { "tab", TabRole }, | 110 { "tab", TabRole }, |
111 { "tablist", TabListRole }, | 111 { "tablist", TabListRole }, |
112 { "tabpanel", TabPanelRole }, | 112 { "tabpanel", TabPanelRole }, |
113 { "text", StaticTextRole }, | 113 { "text", StaticTextRole }, |
114 { "textbox", TextAreaRole }, | 114 { "textbox", TextAreaRole }, |
115 { "timer", ApplicationTimerRole }, | 115 { "timer", TimerRole }, |
116 { "toolbar", ToolbarRole }, | 116 { "toolbar", ToolbarRole }, |
117 { "tooltip", UserInterfaceTooltipRole }, | 117 { "tooltip", UserInterfaceTooltipRole }, |
118 { "tree", TreeRole }, | 118 { "tree", TreeRole }, |
119 { "treegrid", TreeGridRole }, | 119 { "treegrid", TreeGridRole }, |
120 { "treeitem", TreeItemRole } | 120 { "treeitem", TreeItemRole } |
121 }; | 121 }; |
122 ARIARoleMap* roleMap = new ARIARoleMap; | 122 ARIARoleMap* roleMap = new ARIARoleMap; |
123 | 123 |
124 for (size_t i = 0; i < WTF_ARRAY_LENGTH(roles); ++i) | 124 for (size_t i = 0; i < WTF_ARRAY_LENGTH(roles); ++i) |
125 roleMap->set(roles[i].ariaRole, roles[i].webcoreRole); | 125 roleMap->set(roles[i].ariaRole, roles[i].webcoreRole); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 case ToggleButtonRole: | 299 case ToggleButtonRole: |
300 return AXButtonActionVerb(); | 300 return AXButtonActionVerb(); |
301 case TextFieldRole: | 301 case TextFieldRole: |
302 case TextAreaRole: | 302 case TextAreaRole: |
303 return AXTextFieldActionVerb(); | 303 return AXTextFieldActionVerb(); |
304 case RadioButtonRole: | 304 case RadioButtonRole: |
305 return AXRadioButtonActionVerb(); | 305 return AXRadioButtonActionVerb(); |
306 case CheckBoxRole: | 306 case CheckBoxRole: |
307 return isChecked() ? AXCheckedCheckBoxActionVerb() : AXUncheckedCheckBox
ActionVerb(); | 307 return isChecked() ? AXCheckedCheckBoxActionVerb() : AXUncheckedCheckBox
ActionVerb(); |
308 case LinkRole: | 308 case LinkRole: |
309 case WebCoreLinkRole: | |
310 return AXLinkActionVerb(); | 309 return AXLinkActionVerb(); |
311 case PopUpButtonRole: | 310 case PopUpButtonRole: |
312 return AXMenuListActionVerb(); | 311 return AXMenuListActionVerb(); |
313 case MenuListPopupRole: | 312 case MenuListPopupRole: |
314 return AXMenuListPopupActionVerb(); | 313 return AXMenuListPopupActionVerb(); |
315 default: | 314 default: |
316 return emptyString(); | 315 return emptyString(); |
317 } | 316 } |
318 } | 317 } |
319 #endif | 318 #endif |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 | 966 |
968 for (AccessibilityObject* object = parentObject(); object; object = object->
parentObject()) { | 967 for (AccessibilityObject* object = parentObject(); object; object = object->
parentObject()) { |
969 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) | 968 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) |
970 return true; | 969 return true; |
971 } | 970 } |
972 | 971 |
973 return false; | 972 return false; |
974 } | 973 } |
975 | 974 |
976 } // namespace WebCore | 975 } // namespace WebCore |
OLD | NEW |