Index: third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
diff --git a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
index df17dbbf1cbd4e0a5979f2568a9d4cdd09b05939..aa19ada0f7a6e4c73ed49b2955879287e1f9dd92 100644 |
--- a/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
+++ b/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp |
@@ -211,6 +211,22 @@ TEST_F(FrameSelectionTest, ModifyExtendWithFlatTree) |
EXPECT_EQ(PositionInFlatTree(two, 3), visibleSelectionInFlatTree().end()); |
} |
+TEST_F(FrameSelectionTest, PreserveLeadingSpaceWhenCopySelection) |
+{ |
+ setBodyContent("<div id='sample' style='width: 2em;'><b><i>foo</i></b> bar</div>"); |
+ Element* sample = document().getElementById("sample"); |
+ VisibleSelection validSelection(Position(sample->firstChild()->firstChild()->firstChild(), 0), Position(sample->lastChild(), 4)); |
yosin_UTC9
2016/09/14 05:13:52
Please use |plainText()| instead of |FrameSelectio
joone
2016/09/14 07:09:13
Done.
|
+ setSelection(validSelection); |
+ EXPECT_EQ("<b style=\"color: rgb(0, 0, 0); font-family: ""; font-size: medium; font-style: normal; font-variant-ligatures: normal; " |
+ "font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: " |
+ "normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;\">" |
+ "<i>foo</i></b><span style=\"color: rgb(0, 0, 0); font-family: ""; font-size: medium; font-style: normal; font-variant-ligatures: " |
+ "normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; " |
+ "white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; " |
+ "display: inline !important; float: none;\"><span class=\"Apple-converted-space\">\xC2\xA0</span>bar</span>", WebString(selection().selectedHTMLForClipboard()).utf8()) |
+ << "The markup of the selection is different"; |
+} |
+ |
TEST_F(FrameSelectionTest, ModifyWithUserTriggered) |
{ |
setBodyContent("<div id=sample>abc</div>"); |