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

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: 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') | no next file » | 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 c62fb7e13f968d93416ab829a008d2ebdcd67def..1c4e10cf67ccb4d16cce4cecf4b443f20f4f4dc1 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_emitsReplacementChar(behavior & TextIteratorEmitsReplacementChar)
{
if (range)
initialize(range->startPosition(), range->endPosition());
@@ -782,16 +783,21 @@ bool TextIterator::handleReplacedElement()
if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
return false;
- if (m_lastTextNodeEndedWithCollapsedSpace) {
- emitCharacter(' ', m_lastTextNode->parentNode(), m_lastTextNode, 1, 1);
- return false;
- }
-
if (m_entersTextControls && renderer->isTextControl()) {
// The shadow tree should be already visited.
return true;
}
+ if (m_emitsReplacementChar || true) {
aurimas (slooooooooow) 2014/05/22 21:43:40 "A || true" is true for any value for A, right?
guohui 2014/05/22 22:00:37 Absolutely right, i hardcoded to true for testing
+ emitCharacter(objectReplacementCharacter, m_node->parentNode(), m_node, 0, 1);
+ return true;
+ }
+
+ if (m_lastTextNodeEndedWithCollapsedSpace) {
+ emitCharacter(' ', m_lastTextNode->parentNode(), m_lastTextNode, 1, 1);
+ return false;
+ }
+
m_hasEmitted = true;
if (m_emitsCharactersBetweenAllVisiblePositions) {
« no previous file with comments | « Source/core/editing/TextIterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698