1 // Copyright 2020 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 #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_ANIMATION_UTILS_H_ 6 #define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_ANIMATION_UTILS_H_ 7 8 #include "third_party/blink/renderer/core/animation/interpolation.h" 9 #include "third_party/blink/renderer/core/animation/keyframe.h" 10 #include "third_party/blink/renderer/core/animation/property_handle.h" 11 #include "third_party/blink/renderer/core/dom/element.h" 12 13 namespace blink { 14 15 class CORE_EXPORT AnimationUtils { 16 STATIC_ONLY(AnimationUtils); 17 18 public: 19 static const CSSValue* KeyframeValueFromComputedStyle(const PropertyHandle&, 20 const ComputedStyle&, 21 const Document&, 22 const LayoutObject*); 23 24 // Resolves the value of each property in properties, based on the underlying 25 // value including any animation effects included in the interpolations map. 26 // A callback is triggered for each property with the resolved value. 27 static void ForEachInterpolatedPropertyValue( 28 Element* target, 29 const PropertyHandleSet& properties, 30 ActiveInterpolationsMap& interpolations, 31 base::RepeatingCallback<void(PropertyHandle, const CSSValue*)> callback); 32 }; 33 34 } // namespace blink 35 36 #endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_ANIMATION_UTILS_H_ 37