Commit 2908b7c4 authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::HTMLBaseElement

The primary goal of this CL is to use IsA<HTMLBaseElement>(element) in
place of IsHTMLBaseElement(element)

Bug: 891908
Change-Id: I7ba795ddbf3a0650a0ca212066d53328559d1e38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728537Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#682739}
parent 6b430bef
...@@ -828,7 +828,7 @@ VisiblePosition ReplaceSelectionCommand::PositionAtStartOfInsertedContent() ...@@ -828,7 +828,7 @@ VisiblePosition ReplaceSelectionCommand::PositionAtStartOfInsertedContent()
static void RemoveHeadContents(ReplacementFragment& fragment) { static void RemoveHeadContents(ReplacementFragment& fragment) {
Node* next = nullptr; Node* next = nullptr;
for (Node* node = fragment.FirstChild(); node; node = next) { for (Node* node = fragment.FirstChild(); node; node = next) {
if (IsHTMLBaseElement(*node) || IsHTMLLinkElement(*node) || if (IsA<HTMLBaseElement>(*node) || IsHTMLLinkElement(*node) ||
IsHTMLMetaElement(*node) || IsHTMLTitleElement(*node)) { IsHTMLMetaElement(*node) || IsHTMLTitleElement(*node)) {
next = NodeTraversal::NextSkippingChildren(*node); next = NodeTraversal::NextSkippingChildren(*node);
fragment.RemoveNode(node); fragment.RemoveNode(node);
......
...@@ -160,7 +160,7 @@ String WebFrameSerializerImpl::PreActionBeforeSerializeOpenTag( ...@@ -160,7 +160,7 @@ String WebFrameSerializerImpl::PreActionBeforeSerializeOpenTag(
// See http://msdn2.microsoft.com/en-us/library/ms537628(VS.85).aspx. // See http://msdn2.microsoft.com/en-us/library/ms537628(VS.85).aspx.
result.Append( result.Append(
WebFrameSerializer::GenerateMarkOfTheWebDeclaration(param->url)); WebFrameSerializer::GenerateMarkOfTheWebDeclaration(param->url));
} else if (IsHTMLBaseElement(*element)) { } else if (IsA<HTMLBaseElement>(*element)) {
// Comment the BASE tag when serializing dom. // Comment the BASE tag when serializing dom.
result.Append("<!--"); result.Append("<!--");
} }
...@@ -249,7 +249,7 @@ String WebFrameSerializerImpl::PostActionAfterSerializeEndTag( ...@@ -249,7 +249,7 @@ String WebFrameSerializerImpl::PostActionAfterSerializeEndTag(
if (!param->is_html_document) if (!param->is_html_document)
return result.ToString(); return result.ToString();
// Comment the BASE tag when serializing DOM. // Comment the BASE tag when serializing DOM.
if (IsHTMLBaseElement(*element)) { if (IsA<HTMLBaseElement>(*element)) {
result.Append("-->"); result.Append("-->");
// Append a new base tag declaration. // Append a new base tag declaration.
result.Append(GenerateBaseTagDeclaration(param->document->BaseTarget())); result.Append(GenerateBaseTagDeclaration(param->document->BaseTarget()));
......
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