Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Range.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp |
| index deae19228de4b177d043485e624d0bb0a9d22e8b..e092d2aa29f24105f1e128f5a4b9615e522e3554 100644 |
| --- a/third_party/WebKit/Source/core/dom/Range.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Range.cpp |
| @@ -1433,21 +1433,11 @@ void Range::CheckExtractPrecondition(ExceptionState& exception_state) { |
| } |
| Node* Range::FirstNode() const { |
| - if (start_.Container().IsCharacterDataNode()) |
| - return &start_.Container(); |
| - if (Node* child = NodeTraversal::ChildAt(start_.Container(), start_.Offset())) |
| - return child; |
| - if (!start_.Offset()) |
| - return &start_.Container(); |
| - return NodeTraversal::NextSkippingChildren(start_.Container()); |
| + return StartPosition().ToOffsetInAnchor().NodeAsRangeFirstNode(); |
|
yosin_UTC9
2017/04/13 05:45:45
We don't need to use |ToOffsetInAnchor()| here. |P
yoichio
2017/04/13 06:04:39
Done.
|
| } |
| Node* Range::PastLastNode() const { |
| - if (end_.Container().IsCharacterDataNode()) |
| - return NodeTraversal::NextSkippingChildren(end_.Container()); |
| - if (Node* child = NodeTraversal::ChildAt(end_.Container(), end_.Offset())) |
| - return child; |
| - return NodeTraversal::NextSkippingChildren(end_.Container()); |
| + return EndPosition().ToOffsetInAnchor().NodeAsRangePastLastNode(); |
|
yosin_UTC9
2017/04/13 05:45:45
We don't need to use |ToOffsetInAnchor()| here. |P
yoichio
2017/04/13 06:04:39
Done.
|
| } |
| IntRect Range::BoundingBox() const { |