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

Unified Diff: third_party/WebKit/Source/build/scripts/make_computed_style_base.py

Issue 2558733002: Sort fields in ComputedStyleBase in decreasing order of size (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/make_computed_style_base.py
diff --git a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
index 7889fcb7f85f809356a95b544ae783dcc8ec1662..19a0e73828e2edbe76b38f55ba84262beec73371 100755
--- a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
+++ b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
@@ -138,6 +138,10 @@ class ComputedStyleBaseWriter(make_style_builder.StyleBuilderWriter):
is_inherited_method_name=property_name_lower + 'IsInherited',
))
+ # Small optimization: order fields by size, from largest to smallest,
+ # to reduce wasted space from alignment.
+ self._fields.sort(key=lambda f: f.size, reverse=True)
+
@template_expander.use_jinja('ComputedStyleBase.h.tmpl')
def generate_base_computed_style_h(self):
return {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698