Commit 56eadac0 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Eliminate SVGAnimationElement dependency from SVGListPropertyHelper

SVGListPropertyHelper::AdjustFromToListValues only need to know if the
current animation mode is 'to' or not. Pass a bool with that information
instead and avoid pulling in svg_animation_element.h.

Bug: 1017723
Change-Id: Id9cfacd44b22eaf928d27ac8f1732dd9e7c43507
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893205Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#712556}
parent b37d3402
......@@ -10,6 +10,7 @@
#include "third_party/blink/renderer/core/animation/svg_interpolation_environment.h"
#include "third_party/blink/renderer/core/animation/svg_length_interpolation_type.h"
#include "third_party/blink/renderer/core/animation/underlying_length_checker.h"
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_length_list.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
......
......@@ -32,7 +32,6 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_SVG_PROPERTIES_SVG_LIST_PROPERTY_HELPER_H_
#include "third_party/blink/renderer/core/svg/properties/svg_property_helper.h"
#include "third_party/blink/renderer/core/svg/svg_animation_element.h"
#include "third_party/blink/renderer/platform/bindings/exception_messages.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
......@@ -136,7 +135,7 @@ class SVGListPropertyHelper : public SVGPropertyHelper<Derived> {
bool AdjustFromToListValues(Derived* from_list,
Derived* to_list,
float percentage,
AnimationMode);
bool is_to_animation);
String SerializeList() const;
......@@ -262,7 +261,7 @@ bool SVGListPropertyHelper<Derived, ItemProperty>::AdjustFromToListValues(
Derived* from_list,
Derived* to_list,
float percentage,
AnimationMode mode) {
bool is_to_animation) {
// If no 'to' value is given, nothing to animate.
uint32_t to_list_size = to_list->length();
if (!to_list_size)
......@@ -273,7 +272,7 @@ bool SVGListPropertyHelper<Derived, ItemProperty>::AdjustFromToListValues(
uint32_t from_list_size = from_list->length();
if (from_list_size != to_list_size && from_list_size) {
if (percentage < 0.5) {
if (mode != kToAnimation)
if (!is_to_animation)
DeepCopy(from_list);
} else {
DeepCopy(to_list);
......
......@@ -128,8 +128,9 @@ void SVGLengthList::CalculateAnimatedValue(
uint32_t to_at_end_of_duration_list_size =
to_at_end_of_duration_list->length();
if (!AdjustFromToListValues(from_list, to_list, percentage,
animation_element.GetAnimationMode()))
const bool is_to_animation =
animation_element.GetAnimationMode() == kToAnimation;
if (!AdjustFromToListValues(from_list, to_list, percentage, is_to_animation))
return;
for (uint32_t i = 0; i < to_length_list_size; ++i) {
......
......@@ -96,8 +96,9 @@ void SVGNumberList::CalculateAnimatedValue(
uint32_t to_at_end_of_duration_list_size =
to_at_end_of_duration_list->length();
if (!AdjustFromToListValues(from_list, to_list, percentage,
animation_element.GetAnimationMode()))
const bool is_to_animation =
animation_element.GetAnimationMode() == kToAnimation;
if (!AdjustFromToListValues(from_list, to_list, percentage, is_to_animation))
return;
for (uint32_t i = 0; i < to_list_size; ++i) {
......
......@@ -110,8 +110,9 @@ void SVGPointList::CalculateAnimatedValue(
uint32_t to_at_end_of_duration_list_size =
to_at_end_of_duration_list->length();
if (!AdjustFromToListValues(from_list, to_list, percentage,
animation_element.GetAnimationMode()))
const bool is_to_animation =
animation_element.GetAnimationMode() == kToAnimation;
if (!AdjustFromToListValues(from_list, to_list, percentage, is_to_animation))
return;
for (uint32_t i = 0; i < to_point_list_size; ++i) {
......
......@@ -37,6 +37,7 @@
namespace blink {
class CSSValue;
class SVGTransformListTearOff;
class SVGTransformList final
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment