chromium/third_party/blink/renderer/core/animation/keyframe_effect.cc

/*
 * Copyright (C) 2013 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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 {

// Verifies that a pseudo-element selector lexes and canonicalizes legacy forms
bool ValidateAndCanonicalizePseudo(String& selector) {}

enum class KeyframeOrderStrategy {};

Vector<int> CalculateKeyframeOrdering(const KeyframeVector& keyframes,
                                      KeyframeOrderStrategy strategy) {}

}  // namespace

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) {}

// Returns a list of 'ComputedKeyframes'. A ComputedKeyframe consists of the
// normal keyframe data combined with the computed offset for the given
// keyframe.
// https://w3.org/TR/web-animations-1/#dom-keyframeeffect-getkeyframes
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() {}

}  // namespace

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

// Returns true if transform, translate, rotate or scale is composited
// and a motion path or other transform properties
// has been introduced on the element
bool KeyframeEffect::HasIncompatibleStyle() const {}

bool KeyframeEffect::AffectsImportantProperty() const {}

ActiveInterpolationsMap KeyframeEffect::InterpolationsForCommitStyles() {}

void KeyframeEffect::SetLogicalPropertyResolutionContext(
    WritingDirectionMode writing_direction) {}

void KeyframeEffect::CountAnimatedProperties() const {}

}  // namespace blink