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

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

Issue 1910263003: Generate CSSPropertyEquality instead of using hand-updated file. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests2! Created 4 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/CSSPropertyEquality.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyEquality.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyEquality.cpp.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..47ddfab58d74a7f1f84bc51827399f402b2fdd5e
--- /dev/null
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyEquality.cpp.tmpl
@@ -0,0 +1,43 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/css/CSSPropertyEquality.h"
+
+#include "core/CSSPropertyEqualityCustom.h"
+#include "core/css/CSSProperty.h"
+#include "core/style/ComputedStyle.h"
+#include "core/style/DataEquivalency.h"
+
+namespace blink {
+
+bool CSSPropertyEquality::propertiesEqual(CSSPropertyID id, const ComputedStyle& a, const ComputedStyle& b)
+{
+ switch (id) {
+ {% for property_id, property in properties.items() %}
+ case {{property_id}}:
+ {% if property.longhands %}
+ return {% for longhand_id in property.longhand_property_ids %}propertiesEqual({{longhand_id}}, a, b) {% if not loop.last %}&& {% endif %}{% endfor %};
+ {% elif property.animation or property.transition %}
+ return dataEquivalent(a.{{property.getter}}List(), b.{{property.getter}}List());
+ {% elif property.custom_all %}
+ return CSSPropertyEqualityCustom::{{property_id}}Equal(a, b);
+ {% elif property.use_handlers_for %}
+ return propertiesEqual({{property.use_handlers_for}}, a, b);
+ {% elif property.font %}
+ return dataEquivalent(a.getFontDescription().{{property.getter}}(), b.getFontDescription().{{property.getter}}());
+ {% elif property.builder_skip %}
+ return true;
+ {% elif property.svg %}
+ return dataEquivalent(a.svgStyle().{{property.getter}}(), b.svgStyle().{{property.getter}}());
+ {% else %}
+ return dataEquivalent(a.{{property.getter}}(), b.{{property.getter}}());
+ {% endif %}
+ {% endfor %}
+ default:
+ ASSERT_NOT_REACHED();
+ return true;
+ }
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698