Commit 958a990d authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::SVGAnimateMotionElement

This CL has two goals,
  1. Use DynamicTo<SVGAnimateMotionElement> as new downcast helper
  2. Use IsA<SVGAnimateMotionElement>(element) in place of
     IsSVGAnimateMotionElement(element)

Bug: 891908
Change-Id: Idd892a19c8b958253fd0fa7296f1cc803f8cf9a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936569Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#720403}
parent 3b866120
......@@ -187,7 +187,7 @@ void SVGAnimationElement::ParseAttribute(
}
if (name == svg_names::kKeyPointsAttr) {
if (IsSVGAnimateMotionElement(*this)) {
if (IsA<SVGAnimateMotionElement>(*this)) {
// This is specified to be an animateMotion attribute only but it is
// simpler to put it here where the other timing calculatations are.
if (!ParseKeyTimes(params.new_value, key_points_, false)) {
......@@ -316,12 +316,12 @@ void SVGAnimationElement::SetCalcMode(const AtomicString& calc_mode) {
UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModeDiscrete);
SetCalcMode(kCalcModeDiscrete);
} else if (calc_mode == linear) {
if (IsSVGAnimateMotionElement(*this))
if (IsA<SVGAnimateMotionElement>(*this))
UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModeLinear);
// else linear is the default.
SetCalcMode(kCalcModeLinear);
} else if (calc_mode == paced) {
if (!IsSVGAnimateMotionElement(*this))
if (!IsA<SVGAnimateMotionElement>(*this))
UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModePaced);
// else paced is the default.
SetCalcMode(kCalcModePaced);
......@@ -329,8 +329,8 @@ void SVGAnimationElement::SetCalcMode(const AtomicString& calc_mode) {
UseCounter::Count(GetDocument(), WebFeature::kSVGCalcModeSpline);
SetCalcMode(kCalcModeSpline);
} else {
SetCalcMode(IsSVGAnimateMotionElement(*this) ? kCalcModePaced
: kCalcModeLinear);
SetCalcMode(IsA<SVGAnimateMotionElement>(*this) ? kCalcModePaced
: kCalcModeLinear);
}
}
......
......@@ -92,7 +92,7 @@ void SVGMPathElement::TargetPathChanged() {
}
void SVGMPathElement::NotifyParentOfPathChange(ContainerNode* parent) {
if (auto* motion = ToSVGAnimateMotionElementOrNull(parent))
if (auto* motion = DynamicTo<SVGAnimateMotionElement>(parent))
motion->UpdateAnimationPath();
}
......
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