Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: Source/core/dom/Range.cpp

Issue 425223005: Move Node/ContainerNode's traverseToChildAt() to NodeTraversal (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/PositionIterator.h ('k') | Source/core/dom/RangeBoundaryPoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 6df09014175cf654ddad1eb8d39b7fd4496e95b6..0020d59410cc9e7d97e78678df1c14b96fb39b8b 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -908,7 +908,7 @@ void Range::insertNode(PassRefPtrWillBeRawPtr<Node> prpNewNode, ExceptionState&
}
container = m_start.container();
- container->insertBefore(newNode.release(), container->traverseToChildAt(m_start.offset()), exceptionState);
+ container->insertBefore(newNode.release(), NodeTraversal::childAt(*container, m_start.offset()), exceptionState);
if (exceptionState.hadException())
return;
@@ -1020,7 +1020,7 @@ Node* Range::checkNodeWOffset(Node* n, int offset, ExceptionState& exceptionStat
case Node::ELEMENT_NODE: {
if (!offset)
return 0;
- Node* childBefore = n->traverseToChildAt(offset - 1);
+ Node* childBefore = NodeTraversal::childAt(*n, offset - 1);
if (!childBefore)
exceptionState.throwDOMException(IndexSizeError, "There is no child at offset " + String::number(offset) + ".");
return childBefore;
@@ -1310,7 +1310,7 @@ Node* Range::firstNode() const
{
if (m_start.container()->offsetInCharacters())
return m_start.container();
- if (Node* child = m_start.container()->traverseToChildAt(m_start.offset()))
+ if (Node* child = NodeTraversal::childAt(*m_start.container(), m_start.offset()))
return child;
if (!m_start.offset())
return m_start.container();
@@ -1326,7 +1326,7 @@ Node* Range::pastLastNode() const
{
if (m_end.container()->offsetInCharacters())
return NodeTraversal::nextSkippingChildren(*m_end.container());
- if (Node* child = m_end.container()->traverseToChildAt(m_end.offset()))
+ if (Node* child = NodeTraversal::childAt(*m_end.container(), m_end.offset()))
return child;
return NodeTraversal::nextSkippingChildren(*m_end.container());
}
« no previous file with comments | « Source/core/dom/PositionIterator.h ('k') | Source/core/dom/RangeBoundaryPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698