OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Provides output services for ChromeVox. | 6 * @fileoverview Provides output services for ChromeVox. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('Output'); | 9 goog.provide('Output'); |
10 goog.provide('Output.EventType'); | 10 goog.provide('Output.EventType'); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 braille: '' | 87 braille: '' |
88 }, | 88 }, |
89 alert: { | 89 alert: { |
90 speak: '!doNotInterrupt ' + | 90 speak: '!doNotInterrupt ' + |
91 '@aria_role_alert $name $earcon(ALERT_NONMODAL) $descendants' | 91 '@aria_role_alert $name $earcon(ALERT_NONMODAL) $descendants' |
92 }, | 92 }, |
93 button: { | 93 button: { |
94 speak: '$name $earcon(BUTTON, @tag_button)' | 94 speak: '$name $earcon(BUTTON, @tag_button)' |
95 }, | 95 }, |
96 checkBox: { | 96 checkBox: { |
97 speak: '$or($checked, @describe_checkbox_checked($name), ' + | 97 speak: '$if($checked, @describe_checkbox_checked($name), ' + |
98 '@describe_checkbox_unchecked($name)) ' + | 98 '@describe_checkbox_unchecked($name)) ' + |
99 '$or($checked, ' + | 99 '$if($checked, ' + |
100 '$earcon(CHECK_ON, @input_type_checkbox), ' + | 100 '$earcon(CHECK_ON, @input_type_checkbox), ' + |
101 '$earcon(CHECK_OFF, @input_type_checkbox))' | 101 '$earcon(CHECK_OFF, @input_type_checkbox))' |
102 }, | 102 }, |
103 dialog: { | 103 dialog: { |
104 enter: '$name $role' | 104 enter: '$name $role' |
105 }, | 105 }, |
106 heading: { | 106 heading: { |
107 enter: '@aria_role_heading', | 107 enter: '@aria_role_heading', |
108 speak: '@aria_role_heading $name=' | 108 speak: '@aria_role_heading $name=' |
109 }, | 109 }, |
110 inlineTextBox: { | 110 inlineTextBox: { |
111 speak: '$value=' | 111 speak: '$value=' |
112 }, | 112 }, |
113 link: { | 113 link: { |
114 enter: '$name= $visited $earcon(LINK, @tag_link)=', | 114 enter: '$name= $visited $earcon(LINK, @tag_link)=', |
115 stay: '$name= $visited @tag_link', | 115 stay: '$name= $visited @tag_link', |
116 speak: '$name= $visited $earcon(LINK, @tag_link)=' | 116 speak: '$name= $visited $earcon(LINK, @tag_link)=' |
117 }, | 117 }, |
118 list: { | 118 list: { |
119 enter: '$role' | 119 enter: '$role' |
120 }, | 120 }, |
121 listItem: { | 121 listItem: { |
122 enter: '$role' | 122 enter: '$role' |
123 }, | 123 }, |
124 menuItem: { | 124 menuItem: { |
125 speak: '$or($haspopup, @describe_menu_item_with_submenu($name), ' + | 125 speak: '$if($haspopup, @describe_menu_item_with_submenu($name), ' + |
126 '@describe_menu_item($name)) ' + | 126 '@describe_menu_item($name)) ' + |
127 '@describe_index($indexInParent, $parentChildCount)' | 127 '@describe_index($indexInParent, $parentChildCount)' |
128 }, | 128 }, |
129 menuListOption: { | 129 menuListOption: { |
130 speak: '$name $value @aria_role_menuitem ' + | 130 speak: '$name $value @aria_role_menuitem ' + |
131 '@describe_index($indexInParent, $parentChildCount)' | 131 '@describe_index($indexInParent, $parentChildCount)' |
132 }, | 132 }, |
133 paragraph: { | 133 paragraph: { |
134 speak: '$value' | 134 speak: '$value' |
135 }, | 135 }, |
136 popUpButton: { | 136 popUpButton: { |
137 speak: '$value $name @tag_button @aria_has_popup $earcon(LISTBOX) ' + | 137 speak: '$value $name @tag_button @aria_has_popup $earcon(LISTBOX) ' + |
138 '$or($collapsed, @aria_expanded_false, @aria_expanded_true)' | 138 '$if($collapsed, @aria_expanded_false, @aria_expanded_true)' |
139 }, | 139 }, |
140 radioButton: { | 140 radioButton: { |
141 speak: '$or($checked, @describe_radio_selected($name), ' + | 141 speak: '$if($checked, @describe_radio_selected($name), ' + |
142 '@describe_radio_unselected($name)) ' + | 142 '@describe_radio_unselected($name)) ' + |
143 '$or($checked, ' + | 143 '$if($checked, ' + |
144 '$earcon(CHECK_ON, @input_type_radio), ' + | 144 '$earcon(CHECK_ON, @input_type_radio), ' + |
145 '$earcon(CHECK_OFF, @input_type_radio))' | 145 '$earcon(CHECK_OFF, @input_type_radio))' |
146 }, | 146 }, |
147 slider: { | 147 slider: { |
148 speak: '@describe_slider($value, $name)' | 148 speak: '@describe_slider($value, $name)' |
149 }, | 149 }, |
150 staticText: { | 150 staticText: { |
151 speak: '$value' | 151 speak: '$value' |
152 }, | 152 }, |
153 textBox: { | 153 textBox: { |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 var subrange = new cursors.Range( | 502 var subrange = new cursors.Range( |
503 new cursors.Cursor(leftmost, 0), | 503 new cursors.Cursor(leftmost, 0), |
504 new cursors.Cursor(rightmost, 0)); | 504 new cursors.Cursor(rightmost, 0)); |
505 this.range_(subrange, null, 'navigate', buff); | 505 this.range_(subrange, null, 'navigate', buff); |
506 } else if (node.attributes[token]) { | 506 } else if (node.attributes[token]) { |
507 this.addToSpannable_(buff, node.attributes[token], options); | 507 this.addToSpannable_(buff, node.attributes[token], options); |
508 } else if (node.state[token]) { | 508 } else if (node.state[token]) { |
509 this.addToSpannable_(buff, token, options); | 509 this.addToSpannable_(buff, token, options); |
510 } else if (tree.firstChild) { | 510 } else if (tree.firstChild) { |
511 // Custom functions. | 511 // Custom functions. |
512 if (token == 'or') { | 512 if (token == 'if') { |
513 var cond = tree.firstChild; | 513 var cond = tree.firstChild; |
514 var attrib = cond.value.slice(1); | 514 var attrib = cond.value.slice(1); |
515 if (node.attributes[attrib] || node.state[attrib]) | 515 if (node.attributes[attrib] || node.state[attrib]) |
516 this.format_(node, cond.nextSibling, buff); | 516 this.format_(node, cond.nextSibling, buff); |
517 else | 517 else |
518 this.format_(node, cond.nextSibling.nextSibling, buff); | 518 this.format_(node, cond.nextSibling.nextSibling, buff); |
519 } else if (token == 'earcon') { | 519 } else if (token == 'earcon') { |
520 var contentBuff = new cvox.Spannable(); | 520 var contentBuff = new cvox.Spannable(); |
521 if (tree.firstChild.nextSibling) | 521 if (tree.firstChild.nextSibling) |
522 this.format_(node, tree.firstChild.nextSibling, contentBuff); | 522 this.format_(node, tree.firstChild.nextSibling, contentBuff); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 } | 754 } |
755 | 755 |
756 if (currentNode != root) | 756 if (currentNode != root) |
757 throw 'Unbalanced parenthesis.'; | 757 throw 'Unbalanced parenthesis.'; |
758 | 758 |
759 return root; | 759 return root; |
760 } | 760 } |
761 }; | 761 }; |
762 | 762 |
763 }); // goog.scope | 763 }); // goog.scope |
OLD | NEW |