Commit d527f4c6 authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::SVGClipPathElement

This CL has two goals,
  1. Use To<SVGClipPathElement> as new downcast helper
  2. Use IsA<SVGClipPathElement>(element) in place of
     IsSVGClipPathElement(element)

Bug: 891908
Change-Id: Ic2972f94fc26db68a5beca96d9ec23ca2ecb218b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936571
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720504}
parent fb141450
...@@ -217,7 +217,7 @@ void LayoutSVGResourceClipper::CalculateLocalClipBounds() { ...@@ -217,7 +217,7 @@ void LayoutSVGResourceClipper::CalculateLocalClipBounds() {
} }
SVGUnitTypes::SVGUnitType LayoutSVGResourceClipper::ClipPathUnits() const { SVGUnitTypes::SVGUnitType LayoutSVGResourceClipper::ClipPathUnits() const {
return ToSVGClipPathElement(GetElement()) return To<SVGClipPathElement>(GetElement())
->clipPathUnits() ->clipPathUnits()
->CurrentValue() ->CurrentValue()
->EnumValue(); ->EnumValue();
...@@ -226,7 +226,7 @@ SVGUnitTypes::SVGUnitType LayoutSVGResourceClipper::ClipPathUnits() const { ...@@ -226,7 +226,7 @@ SVGUnitTypes::SVGUnitType LayoutSVGResourceClipper::ClipPathUnits() const {
AffineTransform LayoutSVGResourceClipper::CalculateClipTransform( AffineTransform LayoutSVGResourceClipper::CalculateClipTransform(
const FloatRect& reference_box) const { const FloatRect& reference_box) const {
AffineTransform transform = AffineTransform transform =
ToSVGClipPathElement(GetElement()) To<SVGClipPathElement>(GetElement())
->CalculateTransform(SVGElement::kIncludeMotionTransform); ->CalculateTransform(SVGElement::kIncludeMotionTransform);
if (ClipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { if (ClipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
transform.Translate(reference_box.X(), reference_box.Y()); transform.Translate(reference_box.X(), reference_box.Y());
......
...@@ -50,7 +50,7 @@ bool TargetCanHaveMotionTransform(const SVGElement& target) { ...@@ -50,7 +50,7 @@ bool TargetCanHaveMotionTransform(const SVGElement& target) {
IsA<SVGRectElement>(target) || IsSVGCircleElement(target) || IsA<SVGRectElement>(target) || IsSVGCircleElement(target) ||
IsA<SVGEllipseElement>(target) || IsA<SVGLineElement>(target) || IsA<SVGEllipseElement>(target) || IsA<SVGLineElement>(target) ||
IsA<SVGPolylineElement>(target) || IsA<SVGPolygonElement>(target) || IsA<SVGPolylineElement>(target) || IsA<SVGPolygonElement>(target) ||
IsA<SVGTextElement>(target) || IsSVGClipPathElement(target) || IsA<SVGTextElement>(target) || IsA<SVGClipPathElement>(target) ||
IsA<SVGMaskElement>(target) || IsSVGAElement(target) || IsA<SVGMaskElement>(target) || IsSVGAElement(target) ||
IsSVGForeignObjectElement(target); IsSVGForeignObjectElement(target);
} }
......
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