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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2260283002: Adapt WebRange to only deal with EphemeralRanges. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added back the isNull case, sorry. Created 4 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 | « no previous file | third_party/WebKit/Source/web/WebRange.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index a2a1ce0a3a8a5648f6090052e0c8cbc42a8cb1f8..bfacc4a75516c3e1011567a31fdfae424b1c80bc 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -982,7 +982,7 @@ bool WebLocalFrameImpl::hasMarkedText() const
WebRange WebLocalFrameImpl::markedRange() const
{
- return frame()->inputMethodController().compositionRange();
+ return frame()->inputMethodController().compositionEphemeralRange();
}
bool WebLocalFrameImpl::firstRectForCharacterRange(unsigned location, unsigned length, WebRect& rectInViewport) const
@@ -1109,7 +1109,7 @@ bool WebLocalFrameImpl::hasSelection() const
WebRange WebLocalFrameImpl::selectionRange() const
{
- return createRange(frame()->selection().selection().toNormalizedEphemeralRange());
+ return frame()->selection().selection().toNormalizedEphemeralRange();
}
WebString WebLocalFrameImpl::selectionAsText() const
@@ -1165,10 +1165,7 @@ void WebLocalFrameImpl::selectRange(const WebRange& webRange)
DocumentLifecycle::DisallowTransitionScope(frame()->document()->lifecycle());
- // TODO(dglazkov): Use EphemeralRange here.
- // See http://crbug.com/636216 for more details.
- if (Range* range = webRange.createRange(frame()))
- frame()->selection().setSelectedRange(range, VP_DEFAULT_AFFINITY, SelectionDirectionalMode::NonDirectional, NotUserTriggered);
+ frame()->selection().setSelectedRange(webRange.createEphemeralRange(frame()), VP_DEFAULT_AFFINITY, SelectionDirectionalMode::NonDirectional, NotUserTriggered);
}
WebString WebLocalFrameImpl::rangeAsText(const WebRange& webRange)
@@ -1179,12 +1176,7 @@ WebString WebLocalFrameImpl::rangeAsText(const WebRange& webRange)
DocumentLifecycle::DisallowTransitionScope(frame()->document()->lifecycle());
- // TODO(dglazkov): Use EphemeralRange here.
- // See http://crbug.com/636216 for more details.
- if (Range* range = webRange.createRange(frame()))
- return range->text();
-
- return WebString();
+ return plainText(webRange.createEphemeralRange(frame()), TextIteratorEmitsObjectReplacementCharacter);
}
void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point)
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698