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

Use new downcast helper for blink::SVGScriptElement

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

Bug: 891908
Change-Id: I74d59ca2549e7e19291f205b37b721e4eb3da5ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1936690Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#719614}
parent fcd1f0ea
...@@ -98,7 +98,7 @@ static bool HasImpliedEndTag(const HTMLStackItem* item) { ...@@ -98,7 +98,7 @@ static bool HasImpliedEndTag(const HTMLStackItem* item) {
static bool ShouldUseLengthLimit(const ContainerNode& node) { static bool ShouldUseLengthLimit(const ContainerNode& node) {
return !IsA<HTMLScriptElement>(node) && !IsA<HTMLStyleElement>(node) && return !IsA<HTMLScriptElement>(node) && !IsA<HTMLStyleElement>(node) &&
!IsSVGScriptElement(node); !IsA<SVGScriptElement>(node);
} }
static unsigned TextLengthLimitForContainer(const ContainerNode& node) { static unsigned TextLengthLimitForContainer(const ContainerNode& node) {
......
...@@ -13,7 +13,7 @@ ScriptLoader* ScriptLoaderFromElement(Element* element) { ...@@ -13,7 +13,7 @@ ScriptLoader* ScriptLoaderFromElement(Element* element) {
ScriptLoader* script_loader = nullptr; ScriptLoader* script_loader = nullptr;
if (auto* html_script = DynamicTo<HTMLScriptElement>(*element)) if (auto* html_script = DynamicTo<HTMLScriptElement>(*element))
script_loader = html_script->Loader(); script_loader = html_script->Loader();
else if (auto* svg_script = ToSVGScriptElementOrNull(*element)) else if (auto* svg_script = DynamicTo<SVGScriptElement>(*element))
script_loader = svg_script->Loader(); script_loader = svg_script->Loader();
DCHECK(script_loader); DCHECK(script_loader);
return script_loader; return script_loader;
......
...@@ -188,7 +188,7 @@ void SVGAnimateElement::ResolveTargetProperty() { ...@@ -188,7 +188,7 @@ void SVGAnimateElement::ResolveTargetProperty() {
// also disallows the perfectly "valid" animation of 'className' on said // also disallows the perfectly "valid" animation of 'className' on said
// element. If SVGScriptElement.href is transitioned off of SVGAnimatedHref, // element. If SVGScriptElement.href is transitioned off of SVGAnimatedHref,
// this can be removed. // this can be removed.
if (IsSVGScriptElement(*targetElement())) { if (IsA<SVGScriptElement>(*targetElement())) {
type_ = kAnimatedUnknown; type_ = kAnimatedUnknown;
css_property_id_ = CSSPropertyID::kInvalid; css_property_id_ = CSSPropertyID::kInvalid;
} }
......
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