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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp

Issue 2336043006: Restore only the collapsed leading space when copy text (Closed)
Patch Set: 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 | « third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
index 46b11e94f93c1601fa2d3adda753f0a7a85d10c7..1745c5855a0247003cde6198d783feb3582bcd1d 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
@@ -533,4 +533,13 @@ TEST_F(TextIteratorTest, PreserveLeadingSpace)
EXPECT_EQ("foo bar", plainText(EphemeralRange(start, end), TextIteratorEmitsImageAltText));
}
+TEST_F(TextIteratorTest, PreserveOnlyLeadingSpace)
+{
+ setBodyContent("<div style='width: 2em;'><b><i>foo </i></b> bar</div>");
+ Element* div = document().querySelector("div");
+ Position start(div->firstChild()->firstChild()->firstChild(), 0);
yosin_UTC9 2016/09/15 01:41:12 Could you use "id" attribute and |getElementById()
+ Position end(div->lastChild(), 4);
+ EXPECT_EQ("foo bar", plainText(EphemeralRange(start, end), TextIteratorEmitsImageAltText));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698