Log Message
[LFC][IFC] Horizontal margins should be considered as non-breakable space https://bugs.webkit.org/show_bug.cgi?id=191894
Reviewed by Antti Koivisto. Source/WebCore: Like padding and border, horizontal margins also force run breaks and offset them. Test: fast/inline/inline-content-with-margin-left-right.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): Tools: * LayoutReloaded/misc/LFC-passing-tests.txt: LayoutTests: * fast/inline/inline-content-with-margin-left-right-expected.txt: Added. * fast/inline/inline-content-with-margin-left-right.html: Added.
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
- trunk/Tools/ChangeLog
- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (238429 => 238430)
--- trunk/LayoutTests/ChangeLog 2018-11-21 21:33:48 UTC (rev 238429)
+++ trunk/LayoutTests/ChangeLog 2018-11-21 23:13:22 UTC (rev 238430)
@@ -1,3 +1,13 @@
+2018-11-21 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] Horizontal margins should be considered as non-breakable space
+ https://bugs.webkit.org/show_bug.cgi?id=191894
+
+ Reviewed by Antti Koivisto.
+
+ * fast/inline/inline-content-with-margin-left-right-expected.txt: Added.
+ * fast/inline/inline-content-with-margin-left-right.html: Added.
+
2018-11-21 Ryosuke Niwa <[email protected]>
Mutation observers doesn't get notified of character data mutation made by the parser
Added: trunk/LayoutTests/fast/inline/inline-content-with-margin-left-right-expected.txt (0 => 238430)
--- trunk/LayoutTests/fast/inline/inline-content-with-margin-left-right-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-content-with-margin-left-right-expected.txt 2018-11-21 23:13:22 UTC (rev 238430)
@@ -0,0 +1,225 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+layer at (8,8) size 402x22 clip at (9,9) size 400x20
+ RenderBlock {DIV} at (0,0) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderText {#text} at (33,1) size 6x14
+ text run at (33,1) width 6: "3"
+layer at (8,30) size 402x22 clip at (9,31) size 400x20
+ RenderBlock {DIV} at (0,22) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderText {#text} at (23,1) size 6x14
+ text run at (23,1) width 6: "3"
+layer at (8,52) size 402x22 clip at (9,53) size 400x20
+ RenderBlock {DIV} at (0,44) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (7,1) size 6x14
+ text run at (7,1) width 6: "2"
+ RenderText {#text} at (23,1) size 6x14
+ text run at (23,1) width 6: "3"
+layer at (8,74) size 402x22 clip at (9,75) size 400x20
+ RenderBlock {DIV} at (0,66) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (11,1) size 6x14
+ text run at (11,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (27,1) size 6x14
+ text run at (27,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (43,1) size 6x14
+ text run at (43,1) width 6: "3"
+layer at (8,96) size 402x22 clip at (9,97) size 400x20
+ RenderBlock {DIV} at (0,88) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 36x14
+ RenderInline {SPAN} at (0,0) size 26x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (21,1) size 6x14
+ text run at (21,1) width 6: "1"
+layer at (8,118) size 402x22 clip at (9,119) size 400x20
+ RenderBlock {DIV} at (0,110) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 36x14
+ RenderInline {SPAN} at (0,0) size 26x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (21,1) size 6x14
+ text run at (21,1) width 6: "1"
+layer at (8,140) size 402x22 clip at (9,141) size 400x20
+ RenderBlock {DIV} at (0,132) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (11,1) size 6x14
+ text run at (11,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (27,1) size 6x14
+ text run at (27,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (43,1) size 6x14
+ text run at (43,1) width 6: "3"
+layer at (8,162) size 402x22 clip at (9,163) size 400x20
+ RenderBlock {DIV} at (0,154) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (33,1) size 6x14
+ text run at (33,1) width 6: "3"
+layer at (8,184) size 402x22 clip at (9,185) size 400x20
+ RenderBlock {DIV} at (0,176) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (11,1) size 6x14
+ text run at (11,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (37,1) size 6x14
+ text run at (37,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (63,1) size 6x14
+ text run at (63,1) width 6: "3"
+layer at (8,206) size 402x22 clip at (9,207) size 400x20
+ RenderBlock {DIV} at (0,198) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 38x14
+ RenderInline {SPAN} at (0,0) size 22x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (31,1) size 6x14
+ text run at (31,1) width 6: "1"
+ RenderText {#text} at (37,1) size 6x14
+ text run at (37,1) width 6: "2"
+ RenderText {#text} at (43,1) size 6x14
+ text run at (43,1) width 6: "3"
+layer at (8,228) size 402x22 clip at (9,229) size 400x20
+ RenderBlock {DIV} at (0,220) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 38x14
+ RenderInline {SPAN} at (0,0) size 22x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderText {#text} at (33,1) size 6x14
+ text run at (33,1) width 6: "3"
+layer at (8,250) size 402x22 clip at (9,251) size 400x20
+ RenderBlock {DIV} at (0,242) size 402x22 [border: (1px solid #008000)]
+ RenderInline {SPAN} at (0,0) size 58x14
+ RenderInline {SPAN} at (0,0) size 32x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (31,1) size 6x14
+ text run at (31,1) width 6: "1"
+ RenderText {#text} at (47,1) size 6x14
+ text run at (47,1) width 6: "2"
+ RenderText {#text} at (63,1) size 6x14
+ text run at (63,1) width 6: "3"
+layer at (8,272) size 402x22 clip at (9,273) size 400x20
+ RenderBlock {DIV} at (0,264) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 44x14
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 22x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (43,1) size 6x14
+ text run at (43,1) width 6: "3"
+ RenderText {#text} at (49,1) size 6x14
+ text run at (49,1) width 6: "4"
+ RenderText {#text} at (55,1) size 6x14
+ text run at (55,1) width 6: "5"
+ RenderText {#text} at (61,1) size 6x14
+ text run at (61,1) width 6: "6"
+layer at (8,294) size 402x22 clip at (9,295) size 400x20
+ RenderBlock {DIV} at (0,286) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 44x14
+ RenderText {#text} at (7,1) size 6x14
+ text run at (7,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 22x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (13,1) size 6x14
+ text run at (13,1) width 6: "3"
+ RenderText {#text} at (29,1) size 6x14
+ text run at (29,1) width 6: "4"
+ RenderText {#text} at (45,1) size 6x14
+ text run at (45,1) width 6: "5"
+ RenderText {#text} at (61,1) size 6x14
+ text run at (61,1) width 6: "6"
+layer at (8,316) size 402x22 clip at (9,317) size 400x20
+ RenderBlock {DIV} at (0,308) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 64x14
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 32x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (43,1) size 6x14
+ text run at (43,1) width 6: "3"
+ RenderText {#text} at (59,1) size 6x14
+ text run at (59,1) width 6: "4"
+ RenderText {#text} at (75,1) size 6x14
+ text run at (75,1) width 6: "5"
+ RenderText {#text} at (91,1) size 6x14
+ text run at (91,1) width 6: "6"
+layer at (8,338) size 402x22 clip at (9,339) size 400x20
+ RenderBlock {DIV} at (0,330) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 54x14
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 22x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (33,1) size 6x14
+ text run at (33,1) width 6: "3"
+ RenderText {#text} at (49,1) size 6x14
+ text run at (49,1) width 6: "4"
+ RenderText {#text} at (65,1) size 6x14
+ text run at (65,1) width 6: "5"
+ RenderText {#text} at (71,1) size 6x14
+ text run at (71,1) width 6: "6"
+layer at (8,360) size 402x22 clip at (9,361) size 400x20
+ RenderBlock {DIV} at (0,352) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 54x14
+ RenderText {#text} at (7,1) size 6x14
+ text run at (7,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 22x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (33,1) size 6x14
+ text run at (33,1) width 6: "3"
+ RenderText {#text} at (39,1) size 6x14
+ text run at (39,1) width 6: "4"
+ RenderText {#text} at (55,1) size 6x14
+ text run at (55,1) width 6: "5"
+ RenderText {#text} at (71,1) size 6x14
+ text run at (71,1) width 6: "6"
+layer at (8,382) size 402x22 clip at (9,383) size 400x20
+ RenderBlock {DIV} at (0,374) size 402x22 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 6x14
+ text run at (1,1) width 6: "1"
+ RenderInline {SPAN} at (0,0) size 44x14
+ RenderText {#text} at (17,1) size 6x14
+ text run at (17,1) width 6: "2"
+ RenderInline {SPAN} at (0,0) size 22x14
+ RenderInline {SPAN} at (0,0) size 6x14
+ RenderText {#text} at (33,1) size 6x14
+ text run at (33,1) width 6: "3"
+ RenderText {#text} at (39,1) size 6x14
+ text run at (39,1) width 6: "4"
+ RenderText {#text} at (55,1) size 6x14
+ text run at (55,1) width 6: "5"
+ RenderText {#text} at (71,1) size 6x14
+ text run at (71,1) width 6: "6"
Added: trunk/LayoutTests/fast/inline/inline-content-with-margin-left-right.html (0 => 238430)
--- trunk/LayoutTests/fast/inline/inline-content-with-margin-left-right.html (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-content-with-margin-left-right.html 2018-11-21 23:13:22 UTC (rev 238430)
@@ -0,0 +1,40 @@
+<style>
+.inlineRoot {
+ border: 1px solid green;
+ width: 400px;
+ height: 20px;
+ overflow: hidden;
+ font-size: 12px;
+}
+
+.breakStart {
+ margin-left: 10px;
+}
+
+.breakEnd {
+ margin-right: 10px;
+}
+
+.breakBoth {
+ margin: 10px;
+}
+</style>
+
+<div class=inlineRoot>1<span class=breakBoth>2</span>3</div>
+<div class=inlineRoot>1<span class=breakStart>2</span>3</div>
+<div class=inlineRoot>1<span class=breakEnd>2</span>3</div>
+<div class=inlineRoot><span class=breakStart>1</span><span class=breakBoth>2</span><span class=breakEnd>3</span></div>
+<div class=inlineRoot><span class=breakStart><span class=breakEnd><span class=breakBoth>1</span></span></span></div>
+<div class=inlineRoot><span class=breakEnd><span class=breakStart><span class=breakBoth>1</span></span></span></div>
+<div class=inlineRoot><span class=breakStart>1</span><span class=breakStart>2</span><span class=breakStart>3</span></div>
+<div class=inlineRoot><span class=breakEnd>1</span><span class=breakEnd>2</span><span class=breakEnd>3</span></div>
+<div class=inlineRoot><span class=breakBoth>1</span><span class=breakBoth>2</span><span class=breakBoth>3</span></div>
+<div class=inlineRoot><span class=breakStart><span class=breakStart><span class=breakStart>1</span>2</span>3</span></div>
+<div class=inlineRoot><span class=breakEnd><span class=breakEnd><span class=breakEnd>1</span>2</span>3</span></div>
+<div class=inlineRoot><span class=breakBoth><span class=breakBoth><span class=breakBoth>1</span>2</span>3</span></div>
+<div class=inlineRoot>1<span class=breakStart>2<span class=breakStart><span class=breakStart>3</span>4</span>5</span>6</div>
+<div class=inlineRoot>1<span class=breakEnd>2<span class=breakEnd><span class=breakEnd>3</span>4</span>5</span>6</div>
+<div class=inlineRoot>1<span class=breakBoth>2<span class=breakBoth><span class=breakBoth>3</span>4</span>5</span>6</div>
+<div class=inlineRoot>1<span class=breakStart>2<span class=breakBoth><span class=breakEnd>3</span>4</span>5</span>6</div>
+<div class=inlineRoot>1<span class=breakEnd>2<span class=breakBoth><span class=breakStart>3</span>4</span>5</span>6</div>
+<div class=inlineRoot>1<span class=breakBoth>2<span class=breakEnd><span class=breakStart>3</span>4</span>5</span>6</div>
Modified: trunk/Source/WebCore/ChangeLog (238429 => 238430)
--- trunk/Source/WebCore/ChangeLog 2018-11-21 21:33:48 UTC (rev 238429)
+++ trunk/Source/WebCore/ChangeLog 2018-11-21 23:13:22 UTC (rev 238430)
@@ -1,3 +1,17 @@
+2018-11-21 Zalan Bujtas <[email protected]>
+
+ [LFC][IFC] Horizontal margins should be considered as non-breakable space
+ https://bugs.webkit.org/show_bug.cgi?id=191894
+
+ Reviewed by Antti Koivisto.
+
+ Like padding and border, horizontal margins also force run breaks and offset them.
+
+ Test: fast/inline/inline-content-with-margin-left-right.html
+
+ * layout/inlineformatting/InlineFormattingContext.cpp:
+ (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
+
2018-11-20 Ryosuke Niwa <[email protected]>
Mutation observers doesn't get notified of character data mutation made by the parser
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (238429 => 238430)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp 2018-11-21 21:33:48 UTC (rev 238429)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp 2018-11-21 23:13:22 UTC (rev 238430)
@@ -463,6 +463,7 @@
// FIXME: Revisit this when we figured out how inline boxes fit the display tree.
auto padding = Geometry::computedPadding(layoutState(), root);
auto border = Geometry::computedBorder(layoutState(), root);
+ auto horizontalMargins = Geometry::computedNonCollapsedHorizontalMarginValue(layoutState(), root);
// Setup breaking boundaries for this subtree.
auto* lastDescendantInlineBox = inlineFormattingState.lastInlineItem();
// Empty container?
@@ -472,13 +473,13 @@
auto rootBreaksAtStart = [&] {
if (&root == &(this->root()))
return false;
- return (padding && padding->horizontal.left) || border.horizontal.left || root.isPositioned();
+ return (padding && padding->horizontal.left) || border.horizontal.left || horizontalMargins.left || root.isPositioned();
};
auto rootBreaksAtEnd = [&] {
if (&root == &(this->root()))
return false;
- return (padding && padding->horizontal.right) || border.horizontal.right || root.isPositioned();
+ return (padding && padding->horizontal.right) || border.horizontal.right || horizontalMargins.right || root.isPositioned();
};
if (rootBreaksAtStart()) {
@@ -496,6 +497,7 @@
if (padding)
firstDescendantInlineBox->addNonBreakableStart(padding->horizontal.left);
firstDescendantInlineBox->addNonBreakableStart(border.horizontal.left);
+ firstDescendantInlineBox->addNonBreakableStart(horizontalMargins.left);
}
if (rootBreaksAtEnd()) {
@@ -503,6 +505,7 @@
if (padding)
lastDescendantInlineBox->addNonBreakableEnd(padding->horizontal.right);
lastDescendantInlineBox->addNonBreakableEnd(border.horizontal.right);
+ lastDescendantInlineBox->addNonBreakableEnd(horizontalMargins.right);
}
}
Modified: trunk/Tools/ChangeLog (238429 => 238430)
--- trunk/Tools/ChangeLog 2018-11-21 21:33:48 UTC (rev 238429)
+++ trunk/Tools/ChangeLog 2018-11-21 23:13:22 UTC (rev 238430)
@@ -1,5 +1,14 @@
2018-11-21 Zalan Bujtas <[email protected]>
+ [LFC][IFC] Horizontal margins should be considered as non-breakable space
+ https://bugs.webkit.org/show_bug.cgi?id=191894
+
+ Reviewed by Antti Koivisto.
+
+ * LayoutReloaded/misc/LFC-passing-tests.txt:
+
+2018-11-21 Zalan Bujtas <[email protected]>
+
[LFC][IFC] Border should be considered as non-breakable space
https://bugs.webkit.org/show_bug.cgi?id=191891
Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (238429 => 238430)
--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2018-11-21 21:33:48 UTC (rev 238429)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2018-11-21 23:13:22 UTC (rev 238430)
@@ -74,6 +74,7 @@
fast/inline/simple-inline-with-out-of-flow-descendant2.html
fast/inline/inline-content-with-padding-left-right.html
fast/inline/inline-content-with-border-left-right.html
+fast/inline/inline-content-with-margin-left-right.html
fast/block/basic/height-percentage-simple.html
fast/block/basic/child-block-level-box-with-height-percent.html
fast/block/basic/quirk-mode-percent-height.html
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
