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

Unified Diff: third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker_test.cc

Issue 2879093002: [LayoutNG] Fix ShapingLineBreaker when the end of range is needed (Closed)
Patch Set: Rebase Created 3 years, 6 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/layout/ng/inline/ng_line_breaker_test.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker_test.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker_test.cc
index 9b117e1e7e6d3280170d0967249b694ae7d1c663..cd39ff4dff3d66a0ea0b526024a2e312d0c1426d 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker_test.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker_test.cc
@@ -187,6 +187,26 @@ TEST_F(NGLineBreakerTest, OverflowMargin) {
EXPECT_EQ("789", ToString(lines[2], node));
}
+// Tests when the last word in a node wraps, and another node continues.
+TEST_F(NGLineBreakerTest, WrapLastWord) {
+ LoadAhem();
+ NGInlineNode node = CreateInlineNode(R"HTML(
+ <!DOCTYPE html>
+ <style>
+ #container {
+ font: 10px/1 Ahem;
+ }
+ </style>
+ <div id=container>AAA AAA AAA <span>BB</span> CC</div>
+ )HTML");
+
+ Vector<NGInlineItemResults> lines;
+ lines = BreakLines(node, LayoutUnit(100));
+ EXPECT_EQ(2u, lines.size());
+ EXPECT_EQ("AAA AAA", ToString(lines[0], node));
+ EXPECT_EQ("AAA BB CC", ToString(lines[1], node));
+}
+
TEST_F(NGLineBreakerTest, BoundaryInWord) {
LoadAhem();
NGInlineNode node = CreateInlineNode(R"HTML(

Powered by Google App Engine
This is Rietveld 408576698