Commit 448848ff authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::HTMLProgressElement

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

Bug: 891908
Change-Id: I7ee5385b2118582742a389815f8790a39e431c9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847455Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#704180}
parent a529449a
......@@ -305,7 +305,7 @@ static void AdjustStyleForHTMLElement(ComputedStyle& style,
// See https://drafts.csswg.org/css-display/#unbox-html
// Some of these elements are handled with other adjustments above.
if (IsA<HTMLBRElement>(element) || IsHTMLWBRElement(element) ||
IsA<HTMLMeterElement>(element) || IsHTMLProgressElement(element) ||
IsA<HTMLMeterElement>(element) || IsA<HTMLProgressElement>(element) ||
IsA<HTMLCanvasElement>(element) || IsHTMLMediaElement(element) ||
IsHTMLInputElement(element) || IsHTMLTextAreaElement(element) ||
IsHTMLSelectElement(element)) {
......
......@@ -104,7 +104,7 @@ bool ShouldIgnoreContents(const Node& node) {
return (!element->ShouldSerializeEndTag() && !IsHTMLInputElement(*element)) ||
IsA<HTMLIFrameElement>(*element) || IsHTMLImageElement(*element) ||
IsA<HTMLLegendElement>(*element) || IsA<HTMLMeterElement>(*element) ||
IsHTMLObjectElement(*element) || IsHTMLProgressElement(*element) ||
IsHTMLObjectElement(*element) || IsA<HTMLProgressElement>(*element) ||
(IsHTMLSelectElement(*element) &&
ToHTMLSelectElement(*element).UsesMenuList()) ||
IsHTMLStyleElement(*element) || IsHTMLScriptElement(*element) ||
......
......@@ -379,7 +379,7 @@ void TextIteratorAlgorithm<Strategy>::Advance() {
IsA<HTMLLegendElement>(html_element) ||
IsHTMLImageElement(html_element) ||
IsA<HTMLMeterElement>(html_element) ||
IsHTMLProgressElement(html_element))))) {
IsA<HTMLProgressElement>(html_element))))) {
HandleReplacedElement();
} else {
HandleNonTextNode();
......
......@@ -41,7 +41,7 @@ ProgressShadowElement::ProgressShadowElement(Document& document)
}
HTMLProgressElement* ProgressShadowElement::ProgressElement() const {
return ToHTMLProgressElement(OwnerShadowHost());
return To<HTMLProgressElement>(OwnerShadowHost());
}
scoped_refptr<ComputedStyle>
......
......@@ -30,8 +30,8 @@ TEST_F(ProgressShadowElementTest, LayoutObjectIsNeeded) {
<progress id='prog' style='-webkit-appearance:none' />
)HTML");
HTMLProgressElement* progress =
ToHTMLProgressElement(GetDocument().getElementById("prog"));
auto* progress =
To<HTMLProgressElement>(GetDocument().getElementById("prog"));
ASSERT_TRUE(progress);
auto* shadow_element = To<Element>(progress->GetShadowRoot()->firstChild());
......
......@@ -105,7 +105,7 @@ void LayoutProgress::UpdateAnimationState() {
}
HTMLProgressElement* LayoutProgress::ProgressElement() const {
return ToHTMLProgressElement(GetNode());
return To<HTMLProgressElement>(GetNode());
}
} // namespace blink
......@@ -602,7 +602,7 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const {
if (IsA<HTMLMeterElement>(*GetNode()))
return ax::mojom::Role::kMeter;
if (IsHTMLProgressElement(*GetNode()))
if (IsA<HTMLProgressElement>(*GetNode()))
return ax::mojom::Role::kProgressIndicator;
if (IsA<HTMLOutputElement>(*GetNode()))
......
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