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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl

Issue 2759343002: Generate inherited nonproperties insideLink and hasSimpleUnderline. (Closed)
Patch Set: Rebase Created 3 years, 9 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 {% from 'macros.tmpl' import license %} 1 {% from 'macros.tmpl' import license %}
2 {{license()}} 2 {{license()}}
3 3
4 #include "core/ComputedStyleBase.h" 4 #include "core/ComputedStyleBase.h"
5 #include "wtf/SizeAssertions.h" 5 #include "wtf/SizeAssertions.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 struct SameSizeAsComputedStyleBase { 9 struct SameSizeAsComputedStyleBase {
10 unsigned m_bitfields[{{expected_total_field_bytes}}]; 10 unsigned m_bitfields[{{expected_total_field_bytes}}];
11 }; 11 };
12 // If this fails, the packing algorithm in make_computed_style_base.py has 12 // If this fails, the packing algorithm in make_computed_style_base.py has
13 // failed to produce the optimal packed size. To fix, update the algorithm to 13 // failed to produce the optimal packed size. To fix, update the algorithm to
14 // ensure that the buckets are placed so that each takes up at most 1 word. 14 // ensure that the buckets are placed so that each takes up at most 1 word.
15 ASSERT_SIZE(ComputedStyleBase, SameSizeAsComputedStyleBase); 15 ASSERT_SIZE(ComputedStyleBase, SameSizeAsComputedStyleBase);
16 16
17 void ComputedStyleBase::inheritFrom(const ComputedStyleBase& inheritParent, 17 void ComputedStyleBase::inheritFrom(const ComputedStyleBase& inheritParent,
18 IsAtShadowBoundary isAtShadowBoundary) { 18 IsAtShadowBoundary isAtShadowBoundary) {
19 {% for field in fields if field.is_property and field.is_inherited %} 19 {% for field in fields if field.is_inherited %}
alancutter (OOO until 2018) 2017/03/22 06:25:19 Good to see is_property checks being removed. Woul
shend 2017/03/22 22:02:00 It is unlikely we'll be able to remove is_property
20 {{field.name}} = inheritParent.{{field.name}}; 20 {{field.name}} = inheritParent.{{field.name}};
21 {% endfor %} 21 {% endfor %}
22 } 22 }
23 23
24 void ComputedStyleBase::copyNonInheritedFromCached( 24 void ComputedStyleBase::copyNonInheritedFromCached(
alancutter (OOO until 2018) 2017/03/22 06:25:19 Unrelated to this patch: This method might be simp
25 const ComputedStyleBase& other) { 25 const ComputedStyleBase& other) {
26 {% for field in fields if (field.is_property and not field.is_inherited) or fi eld.is_inherited_flag %} 26 {% for field in fields if (field.is_property and not field.is_inherited) or fi eld.is_inherited_flag %}
27 {{field.name}} = other.{{field.name}}; 27 {{field.name}} = other.{{field.name}};
28 {% endfor %} 28 {% endfor %}
29 } 29 }
30 30
31 void ComputedStyleBase::propagateIndependentInheritedProperties( 31 void ComputedStyleBase::propagateIndependentInheritedProperties(
32 const ComputedStyleBase& parentStyle) { 32 const ComputedStyleBase& parentStyle) {
33 {% for field in fields if field.is_property and field.is_independent %} 33 {% for field in fields if field.is_property and field.is_independent %}
34 if ({{field.is_inherited_method_name}}()) 34 if ({{field.is_inherited_method_name}}())
35 {{field.setter_method_name}}(parentStyle.{{field.getter_method_name}}()); 35 {{field.setter_method_name}}(parentStyle.{{field.getter_method_name}}());
36 {% endfor %} 36 {% endfor %}
37 } 37 }
38 38
39 } // namespace blink 39 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698