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

Use new downcast helper for blink::SVGTextPositioningElement

Bug: 891908
Change-Id: I1653b11914eb81117a4d9b35e2ef32ec38ed57bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1714949Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#680306}
parent 131bc8a3
...@@ -106,8 +106,7 @@ static SVGTextPositioningElement* PositioningElementFromLayoutObject( ...@@ -106,8 +106,7 @@ static SVGTextPositioningElement* PositioningElementFromLayoutObject(
DCHECK(node); DCHECK(node);
DCHECK(node->IsSVGElement()); DCHECK(node->IsSVGElement());
return IsSVGTextPositioningElement(*node) ? ToSVGTextPositioningElement(node) return DynamicTo<SVGTextPositioningElement>(node);
: nullptr;
} }
void SVGTextLayoutAttributesBuilder::CollectTextPositioningElements( void SVGTextLayoutAttributesBuilder::CollectTextPositioningElements(
......
...@@ -57,7 +57,13 @@ inline bool IsSVGTextPositioningElement(const SVGElement& element) { ...@@ -57,7 +57,13 @@ inline bool IsSVGTextPositioningElement(const SVGElement& element) {
return element.IsTextPositioning(); return element.IsTextPositioning();
} }
DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGTextPositioningElement); template <>
struct DowncastTraits<SVGTextPositioningElement> {
static bool AllowFrom(const Node& node) {
auto* svg_element = DynamicTo<SVGElement>(node);
return svg_element && IsSVGTextPositioningElement(*svg_element);
}
};
} // namespace blink } // namespace blink
......
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