Commit 64252e63 authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::SVGFEDiffuseLightingElement

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

Bug: 891908
Change-Id: I49b225ca6095376c1c72352569a845f02987e5c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936574
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720343}
parent 4d417ad4
......@@ -67,7 +67,7 @@ void LayoutSVGResourceFilterPrimitive::StyleDidChange(
new_style.FloodColor());
if (new_style.FloodOpacity() != old_style->SvgStyle().FloodOpacity())
element.PrimitiveAttributeChanged(svg_names::kFloodOpacityAttr);
} else if (IsSVGFEDiffuseLightingElement(element) ||
} else if (IsA<SVGFEDiffuseLightingElement>(element) ||
IsA<SVGFESpecularLightingElement>(element)) {
CheckForColorChange(element, svg_names::kLightingColorAttr, diff,
old_style->SvgStyle().LightingColor(),
......
......@@ -131,7 +131,7 @@ void SVGFELightElement::SvgAttributeChanged(const QualifiedName& attr_name) {
return;
SVGElement::InvalidationGuard invalidation_guard(this);
if (auto* diffuse = ToSVGFEDiffuseLightingElementOrNull(*parent))
if (auto* diffuse = DynamicTo<SVGFEDiffuseLightingElement>(*parent))
diffuse->LightElementAttributeChanged(this, attr_name);
else if (auto* specular = DynamicTo<SVGFESpecularLightingElement>(*parent))
specular->LightElementAttributeChanged(this, attr_name);
......
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