Commit e9f2769a authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Simplify SVGAnimateElement::HasValidAnimation()

At this point we will have resolved the type and any CSS property that
'attributeName' maps to, so we can use the (stricter) test
IsAnimatingCSSProperty() instead of IsTargetAttributeCSSProperty().
Similarly we can drop the AnyQName() test because it shouldn't map to
a proper type/CSS property.

Remove IsTargetAttributeCSSProperty() since it is now unused.

Bug: 1017723
Change-Id: I12d231718b335e1c21cff98247fe4869fd3232c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2537837Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#827362}
parent 4e6cae4f
...@@ -43,12 +43,6 @@ namespace blink { ...@@ -43,12 +43,6 @@ namespace blink {
namespace { namespace {
bool IsTargetAttributeCSSProperty(const SVGElement& target_element,
const QualifiedName& attribute_name) {
return SVGElement::IsAnimatableCSSProperty(attribute_name) ||
target_element.IsPresentationAttribute(attribute_name);
}
String ComputeCSSPropertyValue(SVGElement* element, CSSPropertyID id) { String ComputeCSSPropertyValue(SVGElement* element, CSSPropertyID id) {
DCHECK(element); DCHECK(element);
// TODO(fs): StyleEngine doesn't support document without a frame. // TODO(fs): StyleEngine doesn't support document without a frame.
...@@ -217,16 +211,13 @@ void SVGAnimateElement::UpdateTargetProperty() { ...@@ -217,16 +211,13 @@ void SVGAnimateElement::UpdateTargetProperty() {
} }
bool SVGAnimateElement::HasValidAnimation() const { bool SVGAnimateElement::HasValidAnimation() const {
if (AttributeName() == AnyQName())
return false;
if (type_ == kAnimatedUnknown) if (type_ == kAnimatedUnknown)
return false; return false;
// Always animate CSS properties using the ApplyCSSAnimation code path, // Always animate CSS properties using the ApplyCSSAnimation code path,
// regardless of the attributeType value. // regardless of the attributeType value.
// If attributeType="CSS" and attributeName doesn't point to a CSS property, // If attributeType="CSS" and attributeName doesn't point to a CSS property,
// ignore the animation. // ignore the animation.
return IsTargetAttributeCSSProperty(*targetElement(), AttributeName()) || return IsAnimatingCSSProperty() || GetAttributeType() != kAttributeTypeCSS;
GetAttributeType() != kAttributeTypeCSS;
} }
SVGPropertyBase* SVGAnimateElement::CreatePropertyForAttributeAnimation( SVGPropertyBase* SVGAnimateElement::CreatePropertyForAttributeAnimation(
......
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