Index: Source/core/editing/TextIterator.cpp |
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp |
index a0e041e37711a138cb41304f1836e854b95ce80b..3c452ce0bcb46bf8bd74f4379d47a8edb93838d9 100644 |
--- a/Source/core/editing/TextIterator.cpp |
+++ b/Source/core/editing/TextIterator.cpp |
@@ -406,9 +406,9 @@ void TextIterator::advance() |
} else if (renderer && (renderer->isImage() || renderer->isWidget() |
|| (m_node && m_node->isElementNode() |
&& (toElement(m_node)->isFormControlElement() |
- || toElement(m_node)->hasTagName(legendTag) |
- || toElement(m_node)->hasTagName(meterTag) |
- || toElement(m_node)->hasTagName(progressTag))))) { |
+ || isHTMLLegendElement(toElement(*m_node)) |
+ || isHTMLMeterElement(toElement(*m_node)) |
+ || isHTMLProgressElement(toElement(*m_node)))))) { |
handledNode = handleReplacedElement(); |
} else { |
handledNode = handleNonTextNode(); |
@@ -808,9 +808,9 @@ static bool shouldEmitNewlineForNode(Node* node, bool emitsOriginalText) |
{ |
RenderObject* renderer = node->renderer(); |
- if (renderer ? !renderer->isBR() : !node->hasTagName(brTag)) |
+ if (renderer ? !renderer->isBR() : !isHTMLBRElement(node)) |
return false; |
- return emitsOriginalText || !(node->isInShadowTree() && node->shadowHost()->hasTagName(inputTag)); |
+ return emitsOriginalText || !(node->isInShadowTree() && isHTMLInputElement(*node->shadowHost())); |
} |
static bool shouldEmitNewlinesBeforeAndAfterNode(Node& node) |
@@ -975,7 +975,7 @@ bool TextIterator::shouldRepresentNodeOffsetZero() |
// Additionally, if the range we are iterating over contains huge sections of unrendered content, |
// we would create VisiblePositions on every call to this function without this check. |
if (!m_node->renderer() || m_node->renderer()->style()->visibility() != VISIBLE |
- || (m_node->renderer()->isRenderBlockFlow() && !toRenderBlock(m_node->renderer())->height() && !m_node->hasTagName(bodyTag))) |
+ || (m_node->renderer()->isRenderBlockFlow() && !toRenderBlock(m_node->renderer())->height() && !isHTMLBodyElement(*m_node))) |
return false; |
// The startPos.isNotNull() check is needed because the start could be before the body, |