Chromium Code Reviews| 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..bfe3c029986e578f541348a606be30d20e6c3403 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 spaces at the edge need to be nbsp |
|
yosin_UTC9
2017/01/25 03:41:23
In a contenteditable, multiple spaces or spaces at
|
| + // 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"); |