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

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

Issue 2879813002: Make ComputedStyleBase a templated class to allow it to use functions on ComputedStyle (Closed)
Patch Set: 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.h.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
index c3fa417676719a1b271831bf883904fb2ae33f6b..d7f6a5a100948c2b9b9ac23c35d99896599e2df3 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
@@ -34,18 +34,9 @@
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}}];
-};
-
// The generated portion of ComputedStyle. For more info, see the header comment
// in ComputedStyle.h.
+template <class T>
alancutter (OOO until 2018) 2017/05/12 06:45:43 Rename T to ComputedStyleFinal or something simila
nainar 2017/05/12 06:59:18 Done.
class CORE_EXPORT ComputedStyleBase {
public:
inline bool IndependentInheritedEqual(const ComputedStyleBase& o) const {
@@ -122,7 +113,7 @@ class CORE_EXPORT ComputedStyleBase {
}
{% for name, groups_to_diff in diff_functions_map.items() %}
- bool {{name}}(const ComputedStyleBase& other) const {
+ bool {{name}}(const T& other) const {
{{fieldwise_diff(groups_to_diff)|indent(2)}}
return false;
}
@@ -183,11 +174,6 @@ class CORE_EXPORT ComputedStyleBase {
{% endfor %}
};
-// 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);
-
alancutter (OOO until 2018) 2017/05/12 06:45:42 Put this in ComputedStyle.h
nainar 2017/05/12 06:59:18 Done. Removed the CL description too
} // namespace blink
#endif // ComputedStyleBase_h

Powered by Google App Engine
This is Rietveld 408576698