OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/animation/CSSInterpolationTypesMap.h" | 5 #include "core/animation/CSSInterpolationTypesMap.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/animation/CSSAngleInterpolationType.h" | 8 #include "core/animation/CSSAngleInterpolationType.h" |
9 #include "core/animation/CSSBasicShapeInterpolationType.h" | 9 #include "core/animation/CSSBasicShapeInterpolationType.h" |
10 #include "core/animation/CSSBorderImageLengthBoxInterpolationType.h" | 10 #include "core/animation/CSSBorderImageLengthBoxInterpolationType.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 DEFINE_STATIC_LOCAL(ApplicableTypesMap, applicableTypesMap, ()); | 60 DEFINE_STATIC_LOCAL(ApplicableTypesMap, applicableTypesMap, ()); |
61 auto entry = applicableTypesMap.find(property); | 61 auto entry = applicableTypesMap.find(property); |
62 bool foundEntry = entry != applicableTypesMap.end(); | 62 bool foundEntry = entry != applicableTypesMap.end(); |
63 | 63 |
64 // Custom property interpolation types may change over time so don't trust the | 64 // Custom property interpolation types may change over time so don't trust the |
65 // applicableTypesMap without checking the registry. | 65 // applicableTypesMap without checking the registry. |
66 if (m_registry && property.isCSSCustomProperty()) { | 66 if (m_registry && property.isCSSCustomProperty()) { |
67 const auto* registration = getRegistration(m_registry.get(), property); | 67 const auto* registration = getRegistration(m_registry.get(), property); |
68 if (registration) { | 68 if (registration) { |
69 if (foundEntry) { | 69 if (foundEntry) { |
70 applicableTypesMap.remove(entry); | 70 applicableTypesMap.erase(entry); |
71 } | 71 } |
72 return registration->interpolationTypes(); | 72 return registration->interpolationTypes(); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 if (foundEntry) { | 76 if (foundEntry) { |
77 return *entry->value; | 77 return *entry->value; |
78 } | 78 } |
79 | 79 |
80 std::unique_ptr<InterpolationTypes> applicableTypes = | 80 std::unique_ptr<InterpolationTypes> applicableTypes = |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 default: | 374 default: |
375 NOTREACHED(); | 375 NOTREACHED(); |
376 break; | 376 break; |
377 } | 377 } |
378 } | 378 } |
379 result.push_back(WTF::makeUnique<CSSValueInterpolationType>(property)); | 379 result.push_back(WTF::makeUnique<CSSValueInterpolationType>(property)); |
380 return result; | 380 return result; |
381 } | 381 } |
382 | 382 |
383 } // namespace blink | 383 } // namespace blink |
OLD | NEW |