Chromium Code Reviews| Index: Source/core/dom/Range.cpp |
| diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp |
| index dffd506bc95c1120b7bb0e26b1ce20e35a1bc6cc..a27e461926f28db32139dffb77454fcbbe4abe0f 100644 |
| --- a/Source/core/dom/Range.cpp |
| +++ b/Source/core/dom/Range.cpp |
| @@ -1414,13 +1414,7 @@ void Range::checkExtractPrecondition(ExceptionState& exceptionState) |
| Node* Range::firstNode() const |
| { |
| - if (m_start.container()->offsetInCharacters()) |
| - return m_start.container(); |
| - if (Node* child = NodeTraversal::childAt(*m_start.container(), m_start.offset())) |
| - return child; |
| - if (!m_start.offset()) |
| - return m_start.container(); |
| - return NodeTraversal::nextSkippingChildren(*m_start.container()); |
| + return startPosition().toOffsetInAnchor().nodeAsRangeFirstNode(); |
|
sof
2015/05/05 08:23:23
Is this a meaning-preserving transformation - what
|
| } |
| ShadowRoot* Range::shadowRoot() const |
| @@ -1430,11 +1424,7 @@ ShadowRoot* Range::shadowRoot() const |
| Node* Range::pastLastNode() const |
| { |
| - if (m_end.container()->offsetInCharacters()) |
| - return NodeTraversal::nextSkippingChildren(*m_end.container()); |
| - if (Node* child = NodeTraversal::childAt(*m_end.container(), m_end.offset())) |
| - return child; |
| - return NodeTraversal::nextSkippingChildren(*m_end.container()); |
| + return endPosition().toOffsetInAnchor().nodeAsRangePastLastNode(); |
| } |
| IntRect Range::boundingBox() const |