| 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
|
|
|