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

Unified Diff: Source/core/editing/TextIterator.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/TextIterator.h ('k') | Source/core/editing/TextIteratorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/TextIterator.cpp
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp
index 60dc3cb6d24ddcf2b0778fa03d1f8b8ab3e65d53..c28aa909829d2264b0bd689ca5b76781ba415c5b 100644
--- a/Source/core/editing/TextIterator.cpp
+++ b/Source/core/editing/TextIterator.cpp
@@ -265,6 +265,7 @@ TextIterator::TextIterator(const Range* range, TextIteratorBehaviorFlags behavio
, m_shouldStop(false)
, m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText)
, m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots)
+ , m_emitsObjectReplacementCharacter(behavior & TextIteratorEmitsObjectReplacementCharacter)
{
if (range)
initialize(range->startPosition(), range->endPosition());
@@ -295,6 +296,7 @@ TextIterator::TextIterator(const Position& start, const Position& end, TextItera
, m_shouldStop(false)
, m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText)
, m_entersAuthorShadowRoots(behavior & TextIteratorEntersAuthorShadowRoots)
+ , m_emitsObjectReplacementCharacter(behavior & TextIteratorEmitsObjectReplacementCharacter)
{
initialize(start, end);
}
@@ -782,6 +784,11 @@ bool TextIterator::handleReplacedElement()
if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
+ if (m_emitsObjectReplacementCharacter) {
+ emitCharacter(objectReplacementCharacter, m_node->parentNode(), m_node, 0, 1);
+ return true;
+ }
+
if (m_lastTextNodeEndedWithCollapsedSpace) {
emitCharacter(' ', m_lastTextNode->parentNode(), m_lastTextNode, 1, 1);
return false;
« no previous file with comments | « Source/core/editing/TextIterator.h ('k') | Source/core/editing/TextIteratorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698