OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 """Generates CSSStyleDeclaration template file from css property definitions | 7 """Generates CSSStyleDeclaration template file from css property definitions |
8 defined in WebKit.""" | 8 defined in WebKit.""" |
9 | 9 |
10 import tempfile, os, re | 10 import tempfile, os, re |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // not having a value at all. (Ultimately we'll want the native method to | 147 // not having a value at all. (Ultimately we'll want the native method to |
148 // return null if the property doesn't exist and empty string if it's | 148 // return null if the property doesn't exist and empty string if it's |
149 // defined but just doesn't have a value. | 149 // defined but just doesn't have a value. |
150 return _hasProperty(propertyName); | 150 return _hasProperty(propertyName); |
151 $endif | 151 $endif |
152 } | 152 } |
153 | 153 |
154 $if DARTIUM | 154 $if DARTIUM |
155 bool _hasProperty(String propertyName) => | 155 bool _hasProperty(String propertyName) => |
156 $if JSINTEROP | 156 $if JSINTEROP |
157 _blink.BlinkCSSStyleDeclaration.instance.$__propertyQuery___Callback_1_(un
wrap_jso(this), propertyName) != null; | 157 _blink.BlinkCSSStyleDeclaration.instance.$__propertyQuery___Callback_1_(th
is, propertyName); |
158 $else | 158 $else |
159 _blink.BlinkCSSStyleDeclaration.$__propertyQuery___Callback_1(this, proper
tyName); | 159 _blink.BlinkCSSStyleDeclaration.$__propertyQuery___Callback_1(this, proper
tyName); |
160 $endif | 160 $endif |
161 $endif | 161 $endif |
162 | 162 |
163 @DomName('CSSStyleDeclaration.setProperty') | 163 @DomName('CSSStyleDeclaration.setProperty') |
164 void setProperty(String propertyName, String value, [String priority]) { | 164 void setProperty(String propertyName, String value, [String priority]) { |
165 return _setPropertyHelper(_browserPropertyName(propertyName), | 165 return _setPropertyHelper(_browserPropertyName(propertyName), |
166 value, priority); | 166 value, priority); |
167 } | 167 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 class_lines.append(annotated[base_css_name]) | 354 class_lines.append(annotated[base_css_name]) |
355 class_lines.append(""" | 355 class_lines.append(""" |
356 set %s(String value) { | 356 set %s(String value) { |
357 setProperty('%s', value, ''); | 357 setProperty('%s', value, ''); |
358 } | 358 } |
359 """ % (camel_case_name, css_name)) | 359 """ % (camel_case_name, css_name)) |
360 | 360 |
361 class_file.write(''.join(class_lines)); | 361 class_file.write(''.join(class_lines)); |
362 class_file.write('}\n') | 362 class_file.write('}\n') |
363 class_file.close() | 363 class_file.close() |
OLD | NEW |