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 A set of classes to support aural CSS. | 6 * @fileoverview A set of classes to support aural CSS. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 goog.provide('cvox.AuralProperty'); | 10 goog.provide('cvox.AuralProperty'); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 ttsProperties[ttsProperty.property] = ttsProperty.value; | 140 ttsProperties[ttsProperty.property] = ttsProperty.value; |
141 } | 141 } |
142 return ttsProperties; | 142 return ttsProperties; |
143 }; | 143 }; |
144 | 144 |
145 | 145 |
146 /** | 146 /** |
147 * Gets the aural style for a node. | 147 * Gets the aural style for a node. |
148 * @param {Node} node The node. | 148 * @param {Node} node The node. |
149 * @return {Object} The aural style, converted to tts properties. | 149 * @return {Object} The aural style, converted to tts properties. |
150 */ | 150 */ |
151 cvox.AuralStyleUtil.getStyleForNode = function(node) { | 151 cvox.AuralStyleUtil.getStyleForNode = function(node) { |
152 var style = cvox.AuralStyleUtil.defaultStyles[node.tagName]; | 152 var style = cvox.AuralStyleUtil.defaultStyles[node.tagName]; |
153 if (!style) { | 153 if (!style) { |
154 return null; | 154 return null; |
155 } | 155 } |
156 return cvox.AuralStyleConverter.convertStyle(style); | 156 return cvox.AuralStyleConverter.convertStyle(style); |
157 }; | 157 }; |
158 | 158 |
159 | 159 |
160 /** | 160 /** |
161 * A list of default aural styles. | 161 * A list of default aural styles. |
162 */ | 162 */ |
163 cvox.AuralStyleUtil.defaultStyles = { | 163 cvox.AuralStyleUtil.defaultStyles = { |
164 'ARTICLE': { | 164 'ARTICLE': {PITCH: -0.1}, |
165 PITCH: -0.1 | 165 'ASIDE': {PITCH: -0.1}, |
166 }, | 166 'FOOTER': {PITCH: -0.1}, |
167 'ASIDE': { | 167 'H1': {PITCH: -0.3}, |
168 PITCH: -0.1 | 168 'H2': {PITCH: -0.25}, |
169 }, | 169 'H3': {PITCH: -0.2}, |
170 'FOOTER': { | 170 'H4': {PITCH: -0.15}, |
171 PITCH: -0.1 | 171 'H5': {PITCH: -0.1}, |
172 }, | 172 'H6': {PITCH: -0.05}, |
173 'H1': { | 173 'HEADER': {PITCH: -0.1}, |
174 PITCH: -0.3 | 174 'HGROUP': {PITCH: -0.1}, |
175 }, | 175 'MARK': {PITCH: -0.1}, |
176 'H2': { | 176 'NAV': {PITCH: -0.1}, |
177 PITCH: -0.25 | 177 'SECTION': {PITCH: -0.1}, |
178 }, | 178 'TIME': {PITCH: -0.1} |
179 'H3': { | |
180 PITCH: -0.2 | |
181 }, | |
182 'H4': { | |
183 PITCH: -0.15 | |
184 }, | |
185 'H5': { | |
186 PITCH: -0.1 | |
187 }, | |
188 'H6': { | |
189 PITCH: -0.05 | |
190 }, | |
191 'HEADER': { | |
192 PITCH: -0.1 | |
193 }, | |
194 'HGROUP': { | |
195 PITCH: -0.1 | |
196 }, | |
197 'MARK': { | |
198 PITCH: -0.1 | |
199 }, | |
200 'NAV': { | |
201 PITCH: -0.1 | |
202 }, | |
203 'SECTION': { | |
204 PITCH: -0.1 | |
205 }, | |
206 'TIME': { | |
207 PITCH: -0.1 | |
208 } | |
209 }; | 179 }; |
OLD | NEW |