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

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

Issue 2325553002: Restore a collapsed leading space of text used for line break (Closed)
Patch Set: Add gtests Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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: &quot;&quot;; 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: &quot;&quot;; 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>");
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698