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

Use new downcast helper for blink::SVGTextPathElement

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

Bug: 891908
Change-Id: Ib6f170541589d0be1f9cf5bcc4583cf8427d9ed9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936626Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#720266}
parent 1bbc35de
...@@ -60,8 +60,7 @@ bool LayoutSVGTextPath::IsChildAllowed(LayoutObject* child, ...@@ -60,8 +60,7 @@ bool LayoutSVGTextPath::IsChildAllowed(LayoutObject* child,
} }
std::unique_ptr<PathPositionMapper> LayoutSVGTextPath::LayoutPath() const { std::unique_ptr<PathPositionMapper> LayoutSVGTextPath::LayoutPath() const {
const SVGTextPathElement& text_path_element = const auto& text_path_element = To<SVGTextPathElement>(*GetNode());
ToSVGTextPathElement(*GetNode());
Element* target_element = SVGURIReference::TargetElementFromIRIString( Element* target_element = SVGURIReference::TargetElementFromIRIString(
text_path_element.HrefString(), text_path_element.HrefString(),
text_path_element.TreeScopeForIdResolution()); text_path_element.TreeScopeForIdResolution());
......
...@@ -273,7 +273,7 @@ void SVGTextLayoutEngine::LayoutCharactersInTextBoxes(InlineFlowBox* start) { ...@@ -273,7 +273,7 @@ void SVGTextLayoutEngine::LayoutCharactersInTextBoxes(InlineFlowBox* start) {
continue; continue;
SVGInlineFlowBox* flow_box = ToSVGInlineFlowBox(child); SVGInlineFlowBox* flow_box = ToSVGInlineFlowBox(child);
bool is_text_path = IsSVGTextPathElement(*node); bool is_text_path = IsA<SVGTextPathElement>(*node);
if (is_text_path) if (is_text_path)
BeginTextPathLayout(flow_box); BeginTextPathLayout(flow_box);
......
...@@ -36,7 +36,8 @@ LayoutObject* SVGTSpanElement::CreateLayoutObject(const ComputedStyle&, ...@@ -36,7 +36,8 @@ LayoutObject* SVGTSpanElement::CreateLayoutObject(const ComputedStyle&,
bool SVGTSpanElement::LayoutObjectIsNeeded(const ComputedStyle& style) const { bool SVGTSpanElement::LayoutObjectIsNeeded(const ComputedStyle& style) const {
if (parentNode() && if (parentNode() &&
(IsSVGAElement(*parentNode()) || IsSVGTextElement(*parentNode()) || (IsSVGAElement(*parentNode()) || IsSVGTextElement(*parentNode()) ||
IsSVGTextPathElement(*parentNode()) || IsSVGTSpanElement(*parentNode()))) IsA<SVGTextPathElement>(*parentNode()) ||
IsSVGTSpanElement(*parentNode())))
return SVGElement::LayoutObjectIsNeeded(style); return SVGElement::LayoutObjectIsNeeded(style);
return false; return false;
......
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