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

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

Issue 1832713002: Optimize dartium dart:html bindings so real world application performance is acceptable. Improves d… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update cached patches Created 4 years, 8 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
« no previous file with comments | « tools/dom/dom.json ('k') | tools/dom/scripts/generate_blink_file.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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()
OLDNEW
« no previous file with comments | « tools/dom/dom.json ('k') | tools/dom/scripts/generate_blink_file.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698