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

Unified Diff: Source/web/WebRange.cpp

Issue 1315543002: Introduce createRange(const EphemeralRange&) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-24T22:18:16 Created 5 years, 4 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/testing/Internals.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebRange.cpp
diff --git a/Source/web/WebRange.cpp b/Source/web/WebRange.cpp
index 1846be3ebd39ba3a2cbf8d278c6933176edb4cbd..dd9683906ebdc0a6dd2a289936cbf5e2b3ca1509 100644
--- a/Source/web/WebRange.cpp
+++ b/Source/web/WebRange.cpp
@@ -80,10 +80,7 @@ WebRange WebRange::fromDocumentRange(WebLocalFrame* frame, int start, int length
LocalFrame* webFrame = toWebLocalFrameImpl(frame)->frame();
Element* selectionRoot = webFrame->selection().rootEditableElement();
ContainerNode* scope = selectionRoot ? selectionRoot : webFrame->document()->documentElement();
- const EphemeralRange range = PlainTextRange(start, start + length).createRange(*scope);
- if (range.isNull())
- return WebRange();
- return Range::create(range.document(), range.startPosition(), range.endPosition());
+ return createRange(PlainTextRange(start, start + length).createRange(*scope));
}
WebRange::WebRange(const PassRefPtrWillBeRawPtr<Range>& range)
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698