Commit 597bf82a authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Chromium LUCI CQ

Revert "Skip computing SMIL underlying value if not used"

This reverts commit 6ef82730.

We rely on the side-effect of ensuring computed style to make it
possible to propagate style recalc requests to <use> instances.

Bug: 1162628
Change-Id: I3a96b7a8d95f3c8c9c6b27ad10b48715f50d01e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617838Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#841508}
parent 211a9ad8
......@@ -97,14 +97,11 @@ bool SMILAnimationSandwich::ApplyAnimationValues() {
// Only calculate the relevant animations. If we actually set the
// animation value, we don't need to calculate what is beneath it
// in the sandwich.
bool needs_underlying_value = true;
auto* sandwich_start = active_.end();
while (sandwich_start != active_.begin()) {
--sandwich_start;
if ((*sandwich_start)->OverwritesUnderlyingAnimationValue()) {
needs_underlying_value = false;
if ((*sandwich_start)->OverwritesUnderlyingAnimationValue())
break;
}
}
// For now we need an element to setup and apply an animation. Any animation
......@@ -114,8 +111,7 @@ bool SMILAnimationSandwich::ApplyAnimationValues() {
// Only reset the animated type to the base value once for
// the lowest priority animation that animates and
// contributes to a particular element/attribute pair.
SMILAnimationValue animation_value =
animation->CreateAnimationValue(needs_underlying_value);
SMILAnimationValue animation_value = animation->CreateAnimationValue();
for (auto* sandwich_it = sandwich_start; sandwich_it != active_.end();
sandwich_it++) {
......
......@@ -415,8 +415,7 @@ bool SVGAnimateElement::CalculateFromAndByValues(const String& from_string,
return true;
}
SMILAnimationValue SVGAnimateElement::CreateAnimationValue(
bool needs_underlying_value) const {
SMILAnimationValue SVGAnimateElement::CreateAnimationValue() const {
DCHECK(targetElement());
SMILAnimationValue animation_value;
if (IsAnimatingSVGDom()) {
......@@ -431,9 +430,7 @@ SMILAnimationValue SVGAnimateElement::CreateAnimationValue(
// CSS properties animation code-path.
String base_value =
needs_underlying_value
? ComputeCSSPropertyValue(targetElement(), css_property_id_)
: g_empty_string;
ComputeCSSPropertyValue(targetElement(), css_property_id_);
animation_value.property_value = CreatePropertyForCSSAnimation(base_value);
}
return animation_value;
......
......@@ -61,8 +61,7 @@ class CORE_EXPORT SVGAnimateElement : public SVGAnimationElement {
bool HasValidAnimation() const override;
SMILAnimationValue CreateAnimationValue(
bool needs_underlying_value) const final;
SMILAnimationValue CreateAnimationValue() const final;
void ClearAnimationValue() final;
bool CalculateToAtEndOfDurationValue(
......
......@@ -153,8 +153,7 @@ static bool ParsePoint(const String& string, FloatPoint& point) {
});
}
SMILAnimationValue SVGAnimateMotionElement::CreateAnimationValue(
bool needs_underlying_value) const {
SMILAnimationValue SVGAnimateMotionElement::CreateAnimationValue() const {
DCHECK(targetElement());
DCHECK(TargetCanHaveMotionTransform(*targetElement()));
return SMILAnimationValue();
......
......@@ -42,8 +42,7 @@ class SVGAnimateMotionElement final : public SVGAnimationElement {
void ParseAttribute(const AttributeModificationParams&) override;
SMILAnimationValue CreateAnimationValue(
bool needs_underlying_value) const override;
SMILAnimationValue CreateAnimationValue() const override;
void ClearAnimationValue() override;
bool CalculateToAtEndOfDurationValue(
const String& to_at_end_of_duration_string) override;
......
......@@ -72,8 +72,7 @@ class CORE_EXPORT SVGAnimationElement : public SVGSMILElement {
DEFINE_ATTRIBUTE_EVENT_LISTENER(end, kEndEvent)
DEFINE_ATTRIBUTE_EVENT_LISTENER(repeat, kRepeatEvent)
virtual SMILAnimationValue CreateAnimationValue(
bool needs_underlying_value) const = 0;
virtual SMILAnimationValue CreateAnimationValue() const = 0;
void ApplyAnimation(SMILAnimationValue&);
virtual void ApplyResultsToTarget(const SMILAnimationValue&) = 0;
......
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