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

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

Issue 2818643003: Use NodeAsRangeFirstNode() as Range::FirstNode() again. (Closed)
Patch Set: update Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d30539bd95848065c192ed3f40ebd312057a3759 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().NodeAsRangeFirstNode();
}
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().NodeAsRangePastLastNode();
}
IntRect Range::BoundingBox() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698