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

Side by Side Diff: third_party/WebKit/Source/build/scripts/make_computed_style_base.py

Issue 2826633002: Exploit sharing when comparing and copying groups in ComputedStyle. (Closed)
Patch Set: Add comments Created 3 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import math 6 import math
7 import sys 7 import sys
8 8
9 import json5_generator 9 import json5_generator
10 import template_expander 10 import template_expander
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 # is ComputedStyleBase. 418 # is ComputedStyleBase.
419 self._root_group = _group_fields(all_fields) 419 self._root_group = _group_fields(all_fields)
420 420
421 self._include_paths = _get_include_paths(all_properties) 421 self._include_paths = _get_include_paths(all_properties)
422 self._outputs = { 422 self._outputs = {
423 'ComputedStyleBase.h': self.generate_base_computed_style_h, 423 'ComputedStyleBase.h': self.generate_base_computed_style_h,
424 'ComputedStyleBase.cpp': self.generate_base_computed_style_cpp, 424 'ComputedStyleBase.cpp': self.generate_base_computed_style_cpp,
425 'ComputedStyleBaseConstants.h': self.generate_base_computed_style_co nstants, 425 'ComputedStyleBaseConstants.h': self.generate_base_computed_style_co nstants,
426 } 426 }
427 427
428 @template_expander.use_jinja('ComputedStyleBase.h.tmpl') 428 @template_expander.use_jinja('ComputedStyleBase.h.tmpl', tests={'in': lambda a, b: a in b})
429 def generate_base_computed_style_h(self): 429 def generate_base_computed_style_h(self):
430 return { 430 return {
431 'properties': self._properties, 431 'properties': self._properties,
432 'enums': self._generated_enums, 432 'enums': self._generated_enums,
433 'include_paths': self._include_paths, 433 'include_paths': self._include_paths,
434 'computed_style': self._root_group, 434 'computed_style': self._root_group,
435 } 435 }
436 436
437 @template_expander.use_jinja('ComputedStyleBase.cpp.tmpl') 437 @template_expander.use_jinja('ComputedStyleBase.cpp.tmpl', tests={'in': lamb da a, b: a in b})
438 def generate_base_computed_style_cpp(self): 438 def generate_base_computed_style_cpp(self):
439 return { 439 return {
440 'properties': self._properties, 440 'properties': self._properties,
441 'enums': self._generated_enums, 441 'enums': self._generated_enums,
442 'computed_style': self._root_group, 442 'computed_style': self._root_group,
443 } 443 }
444 444
445 @template_expander.use_jinja('ComputedStyleBaseConstants.h.tmpl') 445 @template_expander.use_jinja('ComputedStyleBaseConstants.h.tmpl')
446 def generate_base_computed_style_constants(self): 446 def generate_base_computed_style_constants(self):
447 return { 447 return {
448 'properties': self._properties, 448 'properties': self._properties,
449 'enums': self._generated_enums, 449 'enums': self._generated_enums,
450 } 450 }
451 451
452 if __name__ == '__main__': 452 if __name__ == '__main__':
453 json5_generator.Maker(ComputedStyleBaseWriter).main() 453 json5_generator.Maker(ComputedStyleBaseWriter).main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698