Diff
Modified: trunk/LayoutTests/ChangeLog (237551 => 237552)
--- trunk/LayoutTests/ChangeLog 2018-10-29 14:48:11 UTC (rev 237551)
+++ trunk/LayoutTests/ChangeLog 2018-10-29 14:53:14 UTC (rev 237552)
@@ -1,5 +1,16 @@
2018-10-29 Zalan Bujtas <[email protected]>
+ [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
+ https://bugs.webkit.org/show_bug.cgi?id=191018
+
+ Reviewed by Antti Koivisto.
+
+ * fast/inline/simple-intruding-floats3-expected.txt: Added.
+ * fast/inline/simple-intruding-floats3.html: Added.
+ * platform/ios/TestExpectations:
+
+2018-10-29 Zalan Bujtas <[email protected]>
+
[LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
https://bugs.webkit.org/show_bug.cgi?id=191011
Added: trunk/LayoutTests/fast/inline/simple-intruding-floats3-expected.txt (0 => 237552)
--- trunk/LayoutTests/fast/inline/simple-intruding-floats3-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/inline/simple-intruding-floats3-expected.txt 2018-10-29 14:53:14 UTC (rev 237552)
@@ -0,0 +1,34 @@
+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
+ RenderBlock (anonymous) at (0,0) size 784x18
+ RenderText {#text} at (20,0) size 145x18
+ text run at (20,0) width 145: "very top of the content"
+ RenderImage {IMG} at (0,0) size 20x100
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {DIV} at (0,18) size 300x54
+ RenderText {#text} at (40,0) size 34x18
+ text run at (40,0) width 34: "thisis"
+ RenderImage {IMG} at (20,0) size 20x74
+ RenderText {#text} at (73,0) size 216x36
+ text run at (73,0) width 183: "onerun, next to 2 floats. One"
+ text run at (40,18) width 138: "intruding, one in this "
+ RenderInline {SPAN} at (0,0) size 246x36
+ RenderText {#text} at (177,18) size 246x36
+ text run at (177,18) width 109: "inline formatting"
+ text run at (40,36) width 48: "context"
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {DIV} at (0,72) size 300x54
+ RenderInline {SPAN} at (0,0) size 278x54
+ RenderImage {IMG} at (40,0) size 20x15
+ RenderText {#text} at (60,0) size 278x54
+ text run at (60,0) width 218: "this next inline formatting context"
+ text run at (40,18) width 204: "has 3 floats. 2 out of those 3 are"
+ text run at (0,36) width 59: "intruding"
+ RenderBlock (anonymous) at (0,126) size 784x18
+ RenderInline {SPAN} at (0,0) size 430x18
+ RenderText {#text} at (0,0) size 430x18
+ text run at (0,0) width 430: "and now we are back to the left edge. no intrudings at this position."
+ RenderText {#text} at (0,0) size 0x0
Added: trunk/LayoutTests/fast/inline/simple-intruding-floats3.html (0 => 237552)
--- trunk/LayoutTests/fast/inline/simple-intruding-floats3.html (rev 0)
+++ trunk/LayoutTests/fast/inline/simple-intruding-floats3.html 2018-10-29 14:53:14 UTC (rev 237552)
@@ -0,0 +1,17 @@
+<style>
+img {
+ float: left;
+ width: 20px;
+}
+
+div {
+ width: 300px;
+}
+</style>
+
+very top of the content<img src="" height="100">
+<div>thisis<img src="" height="74">onerun, next to 2 floats. One intruding, one in this
+<span>inline formatting context</span>
+</div>
+<div><span><img src="" height="15" width="20">this next inline formatting context has 3 floats. 2 out of those 3 are intruding </span></div>
+<span>and now we are back to the left edge. no intrudings at this position.</span>
Modified: trunk/LayoutTests/platform/ios/TestExpectations (237551 => 237552)
--- trunk/LayoutTests/platform/ios/TestExpectations 2018-10-29 14:48:11 UTC (rev 237551)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2018-10-29 14:53:14 UTC (rev 237552)
@@ -3111,6 +3111,7 @@
fast/block/basic/inline-content-with-floating-images2.html [ Failure ]
fast/inline/simple-intruding-float1.html [ Failure ]
fast/inline/simple-intruding-floats2.html [ Failure ]
+fast/inline/simple-intruding-floats3.html [ Failure ]
# Datalist
webkit.org/b/186714 fast/forms/datalist/datalist-textinput-keydown.html [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (237551 => 237552)
--- trunk/Source/WebCore/ChangeLog 2018-10-29 14:48:11 UTC (rev 237551)
+++ trunk/Source/WebCore/ChangeLog 2018-10-29 14:53:14 UTC (rev 237552)
@@ -1,5 +1,22 @@
2018-10-29 Zalan Bujtas <[email protected]>
+ [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
+ https://bugs.webkit.org/show_bug.cgi?id=191018
+
+ Reviewed by Antti Koivisto.
+
+ <div><img style="float: left"></div>
+ This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
+ Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
+ need to precompute the ancestor's margin top (stop at the block formatting root boundary).
+
+ Test: fast/inline/simple-intruding-floats3.html
+
+ * layout/blockformatting/BlockFormattingContext.cpp:
+ (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
+
+2018-10-29 Zalan Bujtas <[email protected]>
+
[LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
https://bugs.webkit.org/show_bug.cgi?id=191011
Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (237551 => 237552)
--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp 2018-10-29 14:48:11 UTC (rev 237551)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp 2018-10-29 14:53:14 UTC (rev 237552)
@@ -205,8 +205,10 @@
// If the inline formatting root is also the root for the floats (happens when the root box also establishes a block formatting context)
// the floats are in the coordinate system of this root. No need to find the final vertical position.
auto inlineContextInheritsFloats = layoutBox.establishesInlineFormattingContext() && !layoutBox.establishesBlockFormattingContext();
- if (inlineContextInheritsFloats)
+ if (inlineContextInheritsFloats) {
computeEstimatedMarginTop(layoutContext, layoutBox);
+ computeEstimatedMarginTopForAncestors(layoutContext, layoutBox);
+ }
}
#ifndef NDEBUG
Modified: trunk/Tools/ChangeLog (237551 => 237552)
--- trunk/Tools/ChangeLog 2018-10-29 14:48:11 UTC (rev 237551)
+++ trunk/Tools/ChangeLog 2018-10-29 14:53:14 UTC (rev 237552)
@@ -1,5 +1,14 @@
2018-10-29 Zalan Bujtas <[email protected]>
+ [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
+ https://bugs.webkit.org/show_bug.cgi?id=191018
+
+ Reviewed by Antti Koivisto.
+
+ * LayoutReloaded/misc/LFC-passing-tests.txt:
+
+2018-10-29 Zalan Bujtas <[email protected]>
+
[LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
https://bugs.webkit.org/show_bug.cgi?id=191011
Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (237551 => 237552)
--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2018-10-29 14:48:11 UTC (rev 237551)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2018-10-29 14:53:14 UTC (rev 237552)
@@ -66,3 +66,4 @@
fast/block/basic/inline-content-with-floating-images2.html
fast/inline/simple-intruding-float1.html
fast/inline/simple-intruding-floats2.html
+fast/inline/simple-intruding-floats3.html