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() { ...@@ -97,14 +97,11 @@ bool SMILAnimationSandwich::ApplyAnimationValues() {
// Only calculate the relevant animations. If we actually set the // Only calculate the relevant animations. If we actually set the
// animation value, we don't need to calculate what is beneath it // animation value, we don't need to calculate what is beneath it
// in the sandwich. // in the sandwich.
bool needs_underlying_value = true;
auto* sandwich_start = active_.end(); auto* sandwich_start = active_.end();
while (sandwich_start != active_.begin()) { while (sandwich_start != active_.begin()) {
--sandwich_start; --sandwich_start;
if ((*sandwich_start)->OverwritesUnderlyingAnimationValue()) { if ((*sandwich_start)->OverwritesUnderlyingAnimationValue())
needs_underlying_value = false;
break; break;
}
} }
// For now we need an element to setup and apply an animation. Any animation // For now we need an element to setup and apply an animation. Any animation
...@@ -114,8 +111,7 @@ bool SMILAnimationSandwich::ApplyAnimationValues() { ...@@ -114,8 +111,7 @@ bool SMILAnimationSandwich::ApplyAnimationValues() {
// Only reset the animated type to the base value once for // Only reset the animated type to the base value once for
// the lowest priority animation that animates and // the lowest priority animation that animates and
// contributes to a particular element/attribute pair. // contributes to a particular element/attribute pair.
SMILAnimationValue animation_value = SMILAnimationValue animation_value = animation->CreateAnimationValue();
animation->CreateAnimationValue(needs_underlying_value);
for (auto* sandwich_it = sandwich_start; sandwich_it != active_.end(); for (auto* sandwich_it = sandwich_start; sandwich_it != active_.end();
sandwich_it++) { sandwich_it++) {
......
...@@ -415,8 +415,7 @@ bool SVGAnimateElement::CalculateFromAndByValues(const String& from_string, ...@@ -415,8 +415,7 @@ bool SVGAnimateElement::CalculateFromAndByValues(const String& from_string,
return true; return true;
} }
SMILAnimationValue SVGAnimateElement::CreateAnimationValue( SMILAnimationValue SVGAnimateElement::CreateAnimationValue() const {
bool needs_underlying_value) const {
DCHECK(targetElement()); DCHECK(targetElement());
SMILAnimationValue animation_value; SMILAnimationValue animation_value;
if (IsAnimatingSVGDom()) { if (IsAnimatingSVGDom()) {
...@@ -431,9 +430,7 @@ SMILAnimationValue SVGAnimateElement::CreateAnimationValue( ...@@ -431,9 +430,7 @@ SMILAnimationValue SVGAnimateElement::CreateAnimationValue(
// CSS properties animation code-path. // CSS properties animation code-path.
String base_value = String base_value =
needs_underlying_value ComputeCSSPropertyValue(targetElement(), css_property_id_);
? ComputeCSSPropertyValue(targetElement(), css_property_id_)
: g_empty_string;
animation_value.property_value = CreatePropertyForCSSAnimation(base_value); animation_value.property_value = CreatePropertyForCSSAnimation(base_value);
} }
return animation_value; return animation_value;
......
...@@ -61,8 +61,7 @@ class CORE_EXPORT SVGAnimateElement : public SVGAnimationElement { ...@@ -61,8 +61,7 @@ class CORE_EXPORT SVGAnimateElement : public SVGAnimationElement {
bool HasValidAnimation() const override; bool HasValidAnimation() const override;
SMILAnimationValue CreateAnimationValue( SMILAnimationValue CreateAnimationValue() const final;
bool needs_underlying_value) const final;
void ClearAnimationValue() final; void ClearAnimationValue() final;
bool CalculateToAtEndOfDurationValue( bool CalculateToAtEndOfDurationValue(
......
...@@ -153,8 +153,7 @@ static bool ParsePoint(const String& string, FloatPoint& point) { ...@@ -153,8 +153,7 @@ static bool ParsePoint(const String& string, FloatPoint& point) {
}); });
} }
SMILAnimationValue SVGAnimateMotionElement::CreateAnimationValue( SMILAnimationValue SVGAnimateMotionElement::CreateAnimationValue() const {
bool needs_underlying_value) const {
DCHECK(targetElement()); DCHECK(targetElement());
DCHECK(TargetCanHaveMotionTransform(*targetElement())); DCHECK(TargetCanHaveMotionTransform(*targetElement()));
return SMILAnimationValue(); return SMILAnimationValue();
......
...@@ -42,8 +42,7 @@ class SVGAnimateMotionElement final : public SVGAnimationElement { ...@@ -42,8 +42,7 @@ class SVGAnimateMotionElement final : public SVGAnimationElement {
void ParseAttribute(const AttributeModificationParams&) override; void ParseAttribute(const AttributeModificationParams&) override;
SMILAnimationValue CreateAnimationValue( SMILAnimationValue CreateAnimationValue() const override;
bool needs_underlying_value) const override;
void ClearAnimationValue() override; void ClearAnimationValue() override;
bool CalculateToAtEndOfDurationValue( bool CalculateToAtEndOfDurationValue(
const String& to_at_end_of_duration_string) override; const String& to_at_end_of_duration_string) override;
......
...@@ -72,8 +72,7 @@ class CORE_EXPORT SVGAnimationElement : public SVGSMILElement { ...@@ -72,8 +72,7 @@ class CORE_EXPORT SVGAnimationElement : public SVGSMILElement {
DEFINE_ATTRIBUTE_EVENT_LISTENER(end, kEndEvent) DEFINE_ATTRIBUTE_EVENT_LISTENER(end, kEndEvent)
DEFINE_ATTRIBUTE_EVENT_LISTENER(repeat, kRepeatEvent) DEFINE_ATTRIBUTE_EVENT_LISTENER(repeat, kRepeatEvent)
virtual SMILAnimationValue CreateAnimationValue( virtual SMILAnimationValue CreateAnimationValue() const = 0;
bool needs_underlying_value) const = 0;
void ApplyAnimation(SMILAnimationValue&); void ApplyAnimation(SMILAnimationValue&);
virtual void ApplyResultsToTarget(const SMILAnimationValue&) = 0; 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