Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: tools/dom/scripts/css_code_generator.py

Issue 2875773003: Roll 50: Updated for push to origin/master. (Closed)
Patch Set: Roll 50: Updated to latest Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // to distinguish between property not being present in the browser and 151 // to distinguish between property not being present in the browser and
152 // not having a value at all. (Ultimately we'll want the native method to 152 // not having a value at all. (Ultimately we'll want the native method to
153 // return null if the property doesn't exist and empty string if it's 153 // return null if the property doesn't exist and empty string if it's
154 // defined but just doesn't have a value. 154 // defined but just doesn't have a value.
155 return _hasProperty(propertyName); 155 return _hasProperty(propertyName);
156 $endif 156 $endif
157 } 157 }
158 158
159 $if DARTIUM 159 $if DARTIUM
160 bool _hasProperty(String propertyName) => 160 bool _hasProperty(String propertyName) =>
161 $if JSINTEROP 161 _blink.BlinkCSSStyleDeclaration.instance.$__get___propertyIsEnumerable_Cal lback_1_(this, propertyName);
162 _blink.BlinkCSSStyleDeclaration.instance.$__propertyQuery___Callback_1_(th is, propertyName);
163 $else
164 _blink.BlinkCSSStyleDeclaration.$__propertyQuery___Callback_1(this, proper tyName);
165 $endif
166 $endif 162 $endif
167 163
168 @DomName('CSSStyleDeclaration.setProperty') 164 @DomName('CSSStyleDeclaration.setProperty')
169 void setProperty(String propertyName, String value, [String priority]) { 165 void setProperty(String propertyName, String value, [String priority]) {
170 return _setPropertyHelper(_browserPropertyName(propertyName), 166 return _setPropertyHelper(_browserPropertyName(propertyName),
171 value, priority); 167 value, priority);
172 } 168 }
173 169
174 String _browserPropertyName(String propertyName) { 170 String _browserPropertyName(String propertyName) {
175 String name = _readCache(propertyName); 171 String name = _readCache(propertyName);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 class_lines.append(annotated[base_css_name]) 355 class_lines.append(annotated[base_css_name])
360 class_lines.append(""" 356 class_lines.append("""
361 set %s(String value) { 357 set %s(String value) {
362 setProperty('%s', value, ''); 358 setProperty('%s', value, '');
363 } 359 }
364 """ % (camel_case_name, css_name)) 360 """ % (camel_case_name, css_name))
365 361
366 class_file.write(''.join(class_lines)); 362 class_file.write(''.join(class_lines));
367 class_file.write('}\n') 363 class_file.write('}\n')
368 class_file.close() 364 class_file.close()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698