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

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

Issue 297003003: Emit object replacement char to IME (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: yuta's comments addressed Created 6 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 | « Source/core/editing/PlainTextRange.h ('k') | Source/core/editing/TextIterator.h » ('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 e67ddd7d6a842c9e8b6d7e7e3f046f1e6adcb9b4..1ebc8f4716fb1799a702f0b3bebb88d5e8f3b1a4 100644
--- a/Source/core/editing/PlainTextRange.cpp
+++ b/Source/core/editing/PlainTextRange.cpp
@@ -67,6 +67,11 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeForSelection(const Cont
return createRangeFor(scope, ForSelection);
}
+PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeForInputMethod(const ContainerNode& scope) const
+{
+ return createRangeFor(scope, ForInputMethod);
+}
+
PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode& scope, GetRangeFor getRangeFor) const
{
ASSERT(isNotNull());
@@ -78,7 +83,12 @@ PassRefPtrWillBeRawPtr<Range> PlainTextRange::createRangeFor(const ContainerNode
RefPtrWillBeRawPtr<Range> textRunRange = nullptr;
- TextIterator it(rangeOfContents(const_cast<ContainerNode*>(&scope)).get(), getRangeFor == ForSelection ? TextIteratorEmitsCharactersBetweenAllVisiblePositions : TextIteratorDefaultBehavior);
+ TextIteratorBehavior behaviorFlags = TextIteratorDefaultBehavior;
+ if (getRangeFor == ForSelection)
+ behaviorFlags = TextIteratorEmitsCharactersBetweenAllVisiblePositions;
+ else if (getRangeFor == ForInputMethod)
+ behaviorFlags = TextIteratorEmitsObjectReplacementCharacter;
+ TextIterator it(rangeOfContents(const_cast<ContainerNode*>(&scope)).get(), 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()) {
« no previous file with comments | « Source/core/editing/PlainTextRange.h ('k') | Source/core/editing/TextIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698