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

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

Issue 2875233002: Move code from from ComputedStyleBase.cpp.tmpl to .h.tmpl (Closed)
Patch Set: Indent 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl
deleted file mode 100644
index 3bcd4386a1e7e4efba2f01ea68daced067f4a953..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl
+++ /dev/null
@@ -1,70 +0,0 @@
-{% from 'macros.tmpl' import license %}
-{% from 'fields/field.tmpl' import getter_expression, setter_expression, fieldwise_copy, fieldwise_diff %}
-{{license()}}
-
-#include "core/ComputedStyleBase.h"
-#include "platform/wtf/SizeAssertions.h"
-
-namespace blink {
-
-struct SameSizeAsComputedStyleBase {
- {% if computed_style.subgroups is defined %}
- void* dataRefs[{{computed_style.subgroups|length}}];
- {% endif %}
- {% for field in computed_style.fields|rejectattr("is_bit_field") %}
- {{field.type_name}} {{field.name}};
- {% endfor %}
- unsigned m_bit_fields[{{computed_style.num_32_bit_words_for_bit_fields}}];
-};
-
-// If this fails, the packing algorithm in make_computed_style_base.py has
-// failed to produce the optimal packed size. To fix, update the algorithm to
-// ensure that the buckets are placed so that each takes up at most 1 word.
-ASSERT_SIZE(ComputedStyleBase, SameSizeAsComputedStyleBase);
-
-void ComputedStyleBase::InheritFrom(const ComputedStyleBase& other,
- IsAtShadowBoundary isAtShadowBoundary) {
- {{fieldwise_copy(computed_style, computed_style.all_fields
- |selectattr("is_property")
- |selectattr("is_inherited")
- |list
- )|indent(2)}}
-}
-
-void ComputedStyleBase::CopyNonInheritedFromCached(
- const ComputedStyleBase& other) {
- {{fieldwise_copy(computed_style, computed_style.all_fields
- |rejectattr("has_custom_compare_and_copy")
- |rejectattr("is_inherited")
- |list
- )|indent(2)}}
-}
-
-void ComputedStyleBase::PropagateIndependentInheritedProperties(
- const ComputedStyleBase& parentStyle) {
- {% for field in computed_style.all_fields if field.is_property and field.is_independent %}
- if ({{field.is_inherited_method_name}}())
- {{setter_expression(field)}} = parentStyle.{{getter_expression(field)}};
- {% endfor %}
-}
-
-bool ComputedStyleBase::ScrollAnchorDisablingPropertyChanged(
- const ComputedStyleBase& other,
- const StyleDifference& diff) const {
- {{fieldwise_diff(computed_style, computed_style.all_fields
- |selectattr("property_name", "in", ["margin-top", "margin-left", "margin-right", "margin-bottom", "left", "right", "top", "bottom", "padding-top", "padding-left", "padding-right", "padding-bottom"])
- |list
- )|indent(2)}}
- return false;
-}
-
-bool ComputedStyleBase::DiffNeedsFullLayoutAndPaintInvalidation(
- const ComputedStyleBase& other) const {
- {{fieldwise_diff(computed_style, computed_style.all_fields
- |selectattr("property_name", "in", ["padding-top", "padding-left", "padding-right", "padding-bottom"])
- |list
- )|indent(2)}}
- return false;
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698