Title: [238493] trunk
Revision
238493
Author
[email protected]
Date
2018-11-26 07:23:44 -0800 (Mon, 26 Nov 2018)

Log Message

[LFC][IFC] Use float box's margin box to adjust the line constraints.
https://bugs.webkit.org/show_bug.cgi?id=191961

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/inline/inline-content-with-float-and-margin.html

(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/inline/inline-content-with-float-and-margin-expected.txt: Added.
* fast/inline/inline-content-with-float-and-margin.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (238492 => 238493)


--- trunk/LayoutTests/ChangeLog	2018-11-26 14:18:37 UTC (rev 238492)
+++ trunk/LayoutTests/ChangeLog	2018-11-26 15:23:44 UTC (rev 238493)
@@ -1,3 +1,13 @@
+2018-11-25  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Use float box's margin box to adjust the line constraints.
+        https://bugs.webkit.org/show_bug.cgi?id=191961
+
+        Reviewed by Antti Koivisto.
+
+        * fast/inline/inline-content-with-float-and-margin-expected.txt: Added.
+        * fast/inline/inline-content-with-float-and-margin.html: Added.
+
 2018-11-26  Manuel Rego Casasnovas  <[email protected]>
 
         [css-grid] Fix grid container sizing under min-content height

Added: trunk/LayoutTests/fast/inline/inline-content-with-float-and-margin-expected.txt (0 => 238493)


--- trunk/LayoutTests/fast/inline/inline-content-with-float-and-margin-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-content-with-float-and-margin-expected.txt	2018-11-26 15:23:44 UTC (rev 238493)
@@ -0,0 +1,59 @@
+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 102x52 clip at (9,9) size 100x50
+  RenderBlock {DIV} at (0,0) size 102x52 [border: (1px solid #008000)]
+    RenderText {#text} at (29,1) size 66x14
+      text run at (29,1) width 66: "foobar foobar"
+    RenderBlock (floating) {SPAN} at (11,11) size 8x22 [border: (1px solid #0000FF)]
+      RenderText {#text} at (1,1) size 6x14
+        text run at (1,1) width 6: "2"
+    RenderText {#text} at (29,15) size 66x14
+      text run at (29,15) width 66: "foobar foobar"
+layer at (8,60) size 102x52 clip at (9,61) size 100x50
+  RenderBlock {DIV} at (0,52) size 102x52 [border: (1px solid #008000)]
+    RenderText {#text} at (19,1) size 66x14
+      text run at (19,1) width 66: "foobar foobar"
+    RenderBlock (floating) {SPAN} at (11,1) size 8x22 [border: (1px solid #0000FF)]
+      RenderText {#text} at (1,1) size 6x14
+        text run at (1,1) width 6: "2"
+    RenderText {#text} at (19,15) size 66x14
+      text run at (19,15) width 66: "foobar foobar"
+layer at (8,112) size 102x52 clip at (9,113) size 100x50
+  RenderBlock {DIV} at (0,104) size 102x52 [border: (1px solid #008000)]
+    RenderText {#text} at (19,1) size 66x14
+      text run at (19,1) width 66: "foobar foobar"
+    RenderBlock (floating) {SPAN} at (1,1) size 8x22 [border: (1px solid #0000FF)]
+      RenderText {#text} at (1,1) size 6x14
+        text run at (1,1) width 6: "2"
+    RenderText {#text} at (19,15) size 66x14
+      text run at (19,15) width 66: "foobar foobar"
+layer at (8,164) size 102x52 clip at (9,165) size 100x50
+  RenderBlock {DIV} at (0,156) size 102x52 [border: (1px solid #008000)]
+    RenderText {#text} at (1,1) size 66x14
+      text run at (1,1) width 66: "foobar foobar"
+    RenderBlock (floating) {SPAN} at (83,11) size 8x22 [border: (1px solid #0000FF)]
+      RenderText {#text} at (1,1) size 6x14
+        text run at (1,1) width 6: "2"
+    RenderText {#text} at (1,15) size 66x14
+      text run at (1,15) width 66: "foobar foobar"
+layer at (8,216) size 102x52 clip at (9,217) size 100x50
+  RenderBlock {DIV} at (0,208) size 102x52 [border: (1px solid #008000)]
+    RenderText {#text} at (1,1) size 66x14
+      text run at (1,1) width 66: "foobar foobar"
+    RenderBlock (floating) {SPAN} at (93,1) size 8x22 [border: (1px solid #0000FF)]
+      RenderText {#text} at (1,1) size 6x14
+        text run at (1,1) width 6: "2"
+    RenderText {#text} at (1,15) size 66x14
+      text run at (1,15) width 66: "foobar foobar"
+layer at (8,268) size 102x52 clip at (9,269) size 100x50
+  RenderBlock {DIV} at (0,260) size 102x52 [border: (1px solid #008000)]
+    RenderText {#text} at (1,1) size 66x14
+      text run at (1,1) width 66: "foobar foobar"
+    RenderBlock (floating) {SPAN} at (83,1) size 8x22 [border: (1px solid #0000FF)]
+      RenderText {#text} at (1,1) size 6x14
+        text run at (1,1) width 6: "2"
+    RenderText {#text} at (1,15) size 66x14
+      text run at (1,15) width 66: "foobar foobar"

Added: trunk/LayoutTests/fast/inline/inline-content-with-float-and-margin.html (0 => 238493)


--- trunk/LayoutTests/fast/inline/inline-content-with-float-and-margin.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/inline-content-with-float-and-margin.html	2018-11-26 15:23:44 UTC (rev 238493)
@@ -0,0 +1,22 @@
+<style>
+.inlineRoot {
+	border: 1px solid green;
+	width: 100px;
+	height: 50px;
+	overflow: hidden;
+	font-size: 12px;
+}
+
+span {
+	height: 20px;
+	border: 1px solid blue;
+}
+</style>
+
+<div class=inlineRoot>foobar foobar <span style="float: left; margin: 10px;">2</span>foobar foobar</div>
+<div class=inlineRoot>foobar foobar <span style="float: left; margin-left: 10px;">2</span>foobar foobar</div>
+<div class=inlineRoot>foobar foobar <span style="float: left; margin-right: 10px;">2</span>foobar foobar</div>
+
+<div class=inlineRoot>foobar foobar <span style="float: right; margin: 10px;">2</span>foobar foobar </div>
+<div class=inlineRoot>foobar foobar <span style="float: right; margin-left: 10px;">2</span>foobar foobar</div>
+<div class=inlineRoot>foobar foobar <span style="float: right; margin-right: 10px;">2</span>foobar foobar</div>

Modified: trunk/Source/WebCore/ChangeLog (238492 => 238493)


--- trunk/Source/WebCore/ChangeLog	2018-11-26 14:18:37 UTC (rev 238492)
+++ trunk/Source/WebCore/ChangeLog	2018-11-26 15:23:44 UTC (rev 238493)
@@ -1,3 +1,17 @@
+2018-11-25  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Use float box's margin box to adjust the line constraints.
+        https://bugs.webkit.org/show_bug.cgi?id=191961
+
+        Reviewed by Antti Koivisto.
+
+        Test: fast/inline/inline-content-with-float-and-margin.html
+
+        (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
+        (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
+
 2018-11-26  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*)

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (238492 => 238493)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2018-11-26 14:18:37 UTC (rev 238492)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2018-11-26 15:23:44 UTC (rev 238493)
@@ -287,7 +287,7 @@
             computeFloatPosition(floatingContext, line, floatBox);
             inlineFormattingState.floatingState().append(floatBox);
 
-            auto floatBoxWidth = layoutState.displayBoxForLayoutBox(floatBox).width();
+            auto floatBoxWidth = layoutState.displayBoxForLayoutBox(floatBox).marginBox().width();
             // Shrink availble space for current line and move existing inline runs.
             floatBox.isLeftFloatingPositioned() ? line.adjustLogicalLeft(floatBoxWidth) : line.adjustLogicalRight(floatBoxWidth);
 

Modified: trunk/Tools/ChangeLog (238492 => 238493)


--- trunk/Tools/ChangeLog	2018-11-26 14:18:37 UTC (rev 238492)
+++ trunk/Tools/ChangeLog	2018-11-26 15:23:44 UTC (rev 238493)
@@ -1,5 +1,14 @@
 2018-11-25  Zalan Bujtas  <[email protected]>
 
+        [LFC][IFC] Use float box's margin box to adjust the line constraints.
+        https://bugs.webkit.org/show_bug.cgi?id=191961
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
+2018-11-25  Zalan Bujtas  <[email protected]>
+
         Unreviewed test fix after r238467.
 
         * TestWebKitAPI/Tests/WTF/ListHashSet.cpp:

Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (238492 => 238493)


--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2018-11-26 14:18:37 UTC (rev 238492)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2018-11-26 15:23:44 UTC (rev 238493)
@@ -77,6 +77,7 @@
 fast/inline/inline-content-with-margin-left-right.html
 fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html
 fast/inline/inline-content-with-image-simple.html
+fast/inline/inline-content-with-float-and-margin.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

Reply via email to