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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp

Issue 2912053002: Make TextIterator constructor to take only proper range (Closed)
Patch Set: 2017-05-31T12:36:26 Created 3 years, 7 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/editing/iterators/TextIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
index 2368499c400e69dd5e1be50b64b2d69bc7656057..28e9ffe76f23ff2fe7e28ffe87a9972c74081b0c 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -170,13 +170,9 @@ TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm(
DCHECK(!start.GetDocument()->View() ||
!start.GetDocument()->View()->NeedsLayout());
DCHECK(!start.GetDocument()->NeedsLayoutTreeUpdate());
-
- if (start.CompareTo(end) > 0) {
- Initialize(end.ComputeContainerNode(), end.ComputeOffsetInContainerNode(),
- start.ComputeContainerNode(),
- start.ComputeOffsetInContainerNode());
- return;
- }
+ // To avoid renderer hang, we use |CHECK_LE()| to catch the bad callers
+ // in release build.
+ CHECK_LE(start, end);
Initialize(start.ComputeContainerNode(), start.ComputeOffsetInContainerNode(),
end.ComputeContainerNode(), end.ComputeOffsetInContainerNode());
}
« 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