OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of csslib.parser; | 5 part of csslib.parser; |
6 | 6 |
7 /** | 7 /** |
8 * CSS polyfill emits CSS to be understood by older parsers that which do not | 8 * CSS polyfill emits CSS to be understood by older parsers that which do not |
9 * understand (var, calc, etc.). | 9 * understand (var, calc, etc.). |
10 */ | 10 */ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 void processVars(StyleSheet styleSheet) { | 48 void processVars(StyleSheet styleSheet) { |
49 // Build list of all var definitions. | 49 // Build list of all var definitions. |
50 var mainStyleSheetVarDefs = (new _VarDefAndUsage( | 50 var mainStyleSheetVarDefs = (new _VarDefAndUsage( |
51 this._messages, _allVarDefinitions)..visitTree(styleSheet)).varDefs; | 51 this._messages, _allVarDefinitions)..visitTree(styleSheet)).varDefs; |
52 | 52 |
53 // Resolve all definitions to a non-VarUsage (terminal expression). | 53 // Resolve all definitions to a non-VarUsage (terminal expression). |
54 mainStyleSheetVarDefs.forEach((key, value) { | 54 mainStyleSheetVarDefs.forEach((key, value) { |
55 for (Expression expr in (value.expression as Expressions).expressions) { | 55 for (var _ in (value.expression as Expressions).expressions) { |
56 mainStyleSheetVarDefs[key] = | 56 mainStyleSheetVarDefs[key] = |
57 _findTerminalVarDefinition(_allVarDefinitions, value); | 57 _findTerminalVarDefinition(_allVarDefinitions, value); |
58 } | 58 } |
59 }); | 59 }); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 /** Build list of all var definitions in all includes. */ | 63 /** Build list of all var definitions in all includes. */ |
64 class _VarDefinitionsIncludes extends Visitor { | 64 class _VarDefinitionsIncludes extends Visitor { |
65 final Map<String, VarDefinition> varDefs; | 65 final Map<String, VarDefinition> varDefs; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 247 } |
248 } else { | 248 } else { |
249 // Return real CSS property. | 249 // Return real CSS property. |
250 return varDef; | 250 return varDef; |
251 } | 251 } |
252 } | 252 } |
253 | 253 |
254 // Didn't point to a var definition that existed. | 254 // Didn't point to a var definition that existed. |
255 return varDef; | 255 return varDef; |
256 } | 256 } |
OLD | NEW |