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

Use new downcast helper for blink::SVGMaskElement

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

Bug: 891908
Change-Id: I2781f717a10afb6187228647581b99a864ad851e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936612Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#720432}
parent 12b264ed
......@@ -96,14 +96,14 @@ void LayoutSVGResourceMasker::CalculateMaskContentVisualRect() {
}
SVGUnitTypes::SVGUnitType LayoutSVGResourceMasker::MaskUnits() const {
return ToSVGMaskElement(GetElement())
return To<SVGMaskElement>(GetElement())
->maskUnits()
->CurrentValue()
->EnumValue();
}
SVGUnitTypes::SVGUnitType LayoutSVGResourceMasker::MaskContentUnits() const {
return ToSVGMaskElement(GetElement())
return To<SVGMaskElement>(GetElement())
->maskContentUnits()
->CurrentValue()
->EnumValue();
......@@ -111,7 +111,7 @@ SVGUnitTypes::SVGUnitType LayoutSVGResourceMasker::MaskContentUnits() const {
FloatRect LayoutSVGResourceMasker::ResourceBoundingBox(
const FloatRect& reference_box) {
SVGMaskElement* mask_element = ToSVGMaskElement(GetElement());
auto* mask_element = To<SVGMaskElement>(GetElement());
DCHECK(mask_element);
FloatRect mask_boundaries = SVGLengthContext::ResolveRectangle(
......
......@@ -51,7 +51,7 @@ bool TargetCanHaveMotionTransform(const SVGElement& target) {
IsA<SVGEllipseElement>(target) || IsA<SVGLineElement>(target) ||
IsA<SVGPolylineElement>(target) || IsA<SVGPolygonElement>(target) ||
IsA<SVGTextElement>(target) || IsSVGClipPathElement(target) ||
IsSVGMaskElement(target) || IsSVGAElement(target) ||
IsA<SVGMaskElement>(target) || IsSVGAElement(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