OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/css/CSSPropertyEquality.h" |
| 6 |
| 7 #include "core/CSSPropertyEqualityCustom.h" |
| 8 #include "core/css/CSSProperty.h" |
| 9 #include "core/style/ComputedStyle.h" |
| 10 #include "core/style/DataEquivalency.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 bool CSSPropertyEquality::propertiesEqual(CSSPropertyID id, const ComputedStyle&
a, const ComputedStyle& b) |
| 15 { |
| 16 switch (id) { |
| 17 {% for property_id, property in properties.items() %} |
| 18 case {{property_id}}: |
| 19 {% if property.longhands %} |
| 20 return {% for longhand_id in property.longhand_property_ids %}properties
Equal({{longhand_id}}, a, b) {% if not loop.last %}&& {% endif %}{% endfor %}; |
| 21 {% elif property.animation or property.transition %} |
| 22 return dataEquivalent(a.{{property.getter}}List(), b.{{property.getter}}
List()); |
| 23 {% elif property.custom_all %} |
| 24 return CSSPropertyEqualityCustom::{{property_id}}Equal(a, b); |
| 25 {% elif property.use_handlers_for %} |
| 26 return propertiesEqual({{property.use_handlers_for}}, a, b); |
| 27 {% elif property.font %} |
| 28 return dataEquivalent(a.getFontDescription().{{property.getter}}(), b.ge
tFontDescription().{{property.getter}}()); |
| 29 {% elif property.builder_skip %} |
| 30 return true; |
| 31 {% elif property.svg %} |
| 32 return dataEquivalent(a.svgStyle().{{property.getter}}(), b.svgStyle().{
{property.getter}}()); |
| 33 {% else %} |
| 34 return dataEquivalent(a.{{property.getter}}(), b.{{property.getter}}()); |
| 35 {% endif %} |
| 36 {% endfor %} |
| 37 default: |
| 38 ASSERT_NOT_REACHED(); |
| 39 return true; |
| 40 } |
| 41 } |
| 42 |
| 43 } // namespace blink |
OLD | NEW |