#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/animation/keyframe_effect.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_keyframe_effect_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_object_builder.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_keyframeeffectoptions_unrestricteddouble.h"
#include "third_party/blink/renderer/core/animation/animation_input_helpers.h"
#include "third_party/blink/renderer/core/animation/animation_utils.h"
#include "third_party/blink/renderer/core/animation/compositor_animations.h"
#include "third_party/blink/renderer/core/animation/css/compositor_keyframe_transform.h"
#include "third_party/blink/renderer/core/animation/effect_input.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/animation/sampled_effect.h"
#include "third_party/blink/renderer/core/animation/timing_calculations.h"
#include "third_party/blink/renderer/core/animation/timing_input.h"
#include "third_party/blink/renderer/core/css/parser/css_selector_parser.h"
#include "third_party/blink/renderer/core/css/properties/css_property_ref.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/pseudo_element.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/style/computed_style_constants.h"
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
namespace blink {
namespace {
bool ValidateAndCanonicalizePseudo(String& selector) { … }
enum class KeyframeOrderStrategy { … };
Vector<int> CalculateKeyframeOrdering(const KeyframeVector& keyframes,
KeyframeOrderStrategy strategy) { … }
}
KeyframeEffect* KeyframeEffect::Create(
ScriptState* script_state,
Element* element,
const ScriptValue& keyframes,
const V8UnionKeyframeEffectOptionsOrUnrestrictedDouble* options,
ExceptionState& exception_state) { … }
KeyframeEffect* KeyframeEffect::Create(ScriptState* script_state,
Element* element,
const ScriptValue& keyframes,
ExceptionState& exception_state) { … }
KeyframeEffect* KeyframeEffect::Create(ScriptState* script_state,
KeyframeEffect* source,
ExceptionState& exception_state) { … }
KeyframeEffect::KeyframeEffect(Element* target,
KeyframeEffectModelBase* model,
const Timing& timing,
Priority priority,
EventDelegate* event_delegate)
: … { … }
KeyframeEffect::~KeyframeEffect() = default;
void KeyframeEffect::setTarget(Element* new_target) { … }
const String& KeyframeEffect::pseudoElement() const { … }
void KeyframeEffect::setPseudoElement(String pseudo,
ExceptionState& exception_state) { … }
void KeyframeEffect::RefreshTarget() { … }
String KeyframeEffect::composite() const { … }
void KeyframeEffect::setComposite(String composite_string) { … }
HeapVector<ScriptValue> KeyframeEffect::getKeyframes(
ScriptState* script_state) { … }
void KeyframeEffect::setKeyframes(ScriptState* script_state,
const ScriptValue& keyframes,
ExceptionState& exception_state) { … }
void KeyframeEffect::SetKeyframes(StringKeyframeVector keyframes) { … }
bool KeyframeEffect::Affects(const PropertyHandle& property) const { … }
bool KeyframeEffect::HasRevert() const { … }
void KeyframeEffect::NotifySampledEffectRemovedFromEffectStack() { … }
CompositorAnimations::FailureReasons
KeyframeEffect::CheckCanStartAnimationOnCompositor(
const PaintArtifactCompositor* paint_artifact_compositor,
double animation_playback_rate,
PropertyHandleSet* unsupported_properties) const { … }
void KeyframeEffect::StartAnimationOnCompositor(
int group,
std::optional<double> start_time,
base::TimeDelta time_offset,
double animation_playback_rate,
CompositorAnimation* compositor_animation,
bool is_monotonic_timeline,
bool is_boundary_aligned) { … }
bool KeyframeEffect::HasActiveAnimationsOnCompositor() const { … }
bool KeyframeEffect::HasActiveAnimationsOnCompositor(
const PropertyHandle& property) const { … }
bool KeyframeEffect::CancelAnimationOnCompositor(
CompositorAnimation* compositor_animation) { … }
void KeyframeEffect::CancelIncompatibleAnimationsOnCompositor() { … }
void KeyframeEffect::PauseAnimationForTestingOnCompositor(
base::TimeDelta pause_time) { … }
void KeyframeEffect::AttachCompositedLayers() { … }
bool KeyframeEffect::HasAnimation() const { … }
bool KeyframeEffect::HasPlayingAnimation() const { … }
void KeyframeEffect::Trace(Visitor* visitor) const { … }
namespace {
static const size_t num_transform_properties = …;
const CSSProperty** TransformProperties() { … }
}
bool KeyframeEffect::UpdateBoxSizeAndCheckTransformAxisAlignment(
const gfx::SizeF& box_size) { … }
void KeyframeEffect::RestartRunningAnimationOnCompositor() { … }
bool KeyframeEffect::IsIdentityOrTranslation() const { … }
EffectModel::CompositeOperation KeyframeEffect::CompositeInternal() const { … }
void KeyframeEffect::ApplyEffects() { … }
void KeyframeEffect::ClearEffects() { … }
void KeyframeEffect::UpdateChildrenAndEffects() const { … }
void KeyframeEffect::Attach(AnimationEffectOwner* owner) { … }
void KeyframeEffect::Detach() { … }
void KeyframeEffect::AttachTarget(Animation* animation) { … }
void KeyframeEffect::DetachTarget(Animation* animation) { … }
AnimationTimeDelta KeyframeEffect::CalculateTimeToEffectChange(
bool forwards,
std::optional<AnimationTimeDelta> local_time,
AnimationTimeDelta time_to_next_iteration) const { … }
std::optional<AnimationTimeDelta> KeyframeEffect::TimelineDuration() const { … }
bool KeyframeEffect::HasIncompatibleStyle() const { … }
bool KeyframeEffect::AffectsImportantProperty() const { … }
ActiveInterpolationsMap KeyframeEffect::InterpolationsForCommitStyles() { … }
void KeyframeEffect::SetLogicalPropertyResolutionContext(
WritingDirectionMode writing_direction) { … }
void KeyframeEffect::CountAnimatedProperties() const { … }
}