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

Use new downcast helper for blink::SVGViewElement

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

Bug: 891908
Change-Id: Ib22d10d67dfa70323919a4d3fdc03d85bbfde055
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936689Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#719619}
parent ae72d4aa
...@@ -699,14 +699,14 @@ void SVGSVGElement::SetupInitialView(const String& fragment_identifier, ...@@ -699,14 +699,14 @@ void SVGSVGElement::SetupInitialView(const String& fragment_identifier,
return; return;
} }
} }
if (IsSVGViewElement(anchor_node)) { if (auto* svg_view_element = DynamicTo<SVGViewElement>(anchor_node)) {
// Spec: If the SVG fragment identifier addresses a 'view' element within an // Spec: If the SVG fragment identifier addresses a 'view' element within an
// SVG document (e.g., MyDrawing.svg#MyView) then the root 'svg' element is // SVG document (e.g., MyDrawing.svg#MyView) then the root 'svg' element is
// displayed in the SVG viewport. Any view specification attributes included // displayed in the SVG viewport. Any view specification attributes included
// on the given 'view' element override the corresponding view specification // on the given 'view' element override the corresponding view specification
// attributes on the root 'svg' element. // attributes on the root 'svg' element.
SVGViewSpec* view_spec = SVGViewSpec* view_spec =
SVGViewSpec::CreateForViewElement(ToSVGViewElement(*anchor_node)); SVGViewSpec::CreateForViewElement(*svg_view_element);
UseCounter::Count(GetDocument(), UseCounter::Count(GetDocument(),
WebFeature::kSVGSVGElementFragmentSVGViewElement); WebFeature::kSVGSVGElementFragmentSVGViewElement);
SetViewSpec(view_spec); SetViewSpec(view_spec);
......
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