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

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: Formatting merge 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43f8c820672d3f50b3a7c99b9b3d737be4d31e63..28006cabf0a4aea5176a84566b9fe40aa7936b2f 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
@@ -46,6 +46,13 @@ struct SameSizeAsComputedStyleBase {
// The generated portion of ComputedStyle. For more info, see the header comment
// in ComputedStyle.h.
+
+// ComputedStyleBase is a templated class to allow it to use functions
+// on ComputedStyle. This allows ComputedStyleBase to use hand written
+// functions it would otherwise not know about.
+// It should only be templated with the ComputedStyle class and no other class
+// is allowed.
+template <class ComputedStyleFinal>
class CORE_EXPORT ComputedStyleBase {
public:
inline bool IndependentInheritedEqual(const ComputedStyleBase& o) const {
@@ -122,7 +129,7 @@ class CORE_EXPORT ComputedStyleBase {
}
{% for name, groups_to_diff in diff_functions_map.items() %}
- bool {{name}}(const ComputedStyleBase& other) const {
+ bool {{name}}(const ComputedStyleFinal& other) const {
{{fieldwise_diff(groups_to_diff)|indent(4)}}
return false;
}
@@ -183,11 +190,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);
-
} // namespace blink
#endif // ComputedStyleBase_h
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698