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

Unified Diff: third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp

Issue 2649923012: Avoid reporting space as NBSP in TextInputState. (Closed)
Patch Set: Code review comments Created 3 years, 11 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
Index: third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
index 106b8accaecba1c089f187bc5c12753109d12a26..45f71d19a0b230c212348964ef99cf09a4002d6f 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -1169,6 +1169,20 @@ TEST_F(InputMethodControllerTest, FinishCompositionRemovedRange) {
EXPECT_EQ(WebTextInputTypeTelephone, controller().textInputType());
}
+TEST_F(InputMethodControllerTest, ReflectsSpaceWithoutNbspMangling) {
+ insertHTMLElement("<div id='sample' contenteditable></div>", "sample");
+
+ Vector<CompositionUnderline> underlines;
+ controller().commitText(String(" "), underlines, 0);
+
+ // In a contenteditable, multiple spaces or a space at the edge needs to be
aelias_OOO_until_Jul13 2017/01/25 04:34:09 Done.
+ // nbsp to affect layout properly, but it confuses some IMEs (particularly
+ // Vietnamese, see crbug.com/663880) to have their spaces reflected back to
+ // them as nbsp.
+ EXPECT_EQ(' ', controller().textInputInfo().value.ascii()[0]);
+ EXPECT_EQ(' ', controller().textInputInfo().value.ascii()[1]);
+}
+
TEST_F(InputMethodControllerTest, SetCompositionPlainTextWithUnderline) {
insertHTMLElement("<div id='sample' contenteditable></div>", "sample");

Powered by Google App Engine
This is Rietveld 408576698