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

Unified Diff: Source/core/editing/PlainTextRange.cpp

Issue 1041463003: Remove methods of TextIterator that take Range objects (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add assertions Created 5 years, 9 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/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/TextCheckingHelper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/PlainTextRange.cpp
diff --git a/Source/core/editing/PlainTextRange.cpp b/Source/core/editing/PlainTextRange.cpp
index 6987a420722b52344e15ed635b83d30a1a8b8299..495966384aaccdd4a97fa043fd8caa5cf07a5704 100644
--- a/Source/core/editing/PlainTextRange.cpp
+++ b/Source/core/editing/PlainTextRange.cpp
@@ -82,7 +82,8 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode
TextIteratorBehaviorFlags behaviorFlags = TextIteratorEmitsObjectReplacementCharacter;
if (getRangeFor == ForSelection)
behaviorFlags |= TextIteratorEmitsCharactersBetweenAllVisiblePositions;
- TextIterator it(rangeOfContents(const_cast<ContainerNode*>(&scope)).get(), behaviorFlags);
+ auto range = rangeOfContents(const_cast<ContainerNode*>(&scope));
+ TextIterator it(range->startPosition(), range->endPosition(), behaviorFlags);
// FIXME: the atEnd() check shouldn't be necessary, workaround for <http://bugs.webkit.org/show_bug.cgi?id=6289>.
if (!start() && !length() && it.atEnd()) {
@@ -174,11 +175,11 @@ PlainTextRange PlainTextRange::create(const ContainerNode& scope, const Range& r
RefPtrWillBeRawPtr<Range> testRange = Range::create(scope.document(), const_cast<ContainerNode*>(&scope), 0, range.startContainer(), range.startOffset());
ASSERT(testRange->startContainer() == &scope);
- size_t start = TextIterator::rangeLength(testRange.get());
+ size_t start = TextIterator::rangeLength(testRange->startPosition(), testRange->endPosition());
testRange->setEnd(range.endContainer(), range.endOffset(), IGNORE_EXCEPTION);
ASSERT(testRange->startContainer() == &scope);
- size_t end = TextIterator::rangeLength(testRange.get());
+ size_t end = TextIterator::rangeLength(testRange->startPosition(), testRange->endPosition());
return PlainTextRange(start, end);
}
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/TextCheckingHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698