https://bugs.webkit.org/show_bug.cgi?id=191018
Reviewed by Antti Koivisto.
Source/WebCore:
<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):
Tools:
* LayoutReloaded/misc/LFC-passing-tests.txt:
LayoutTests:
* fast/inline/simple-intruding-floats3-expected.txt: Added.
* fast/inline/simple-intruding-floats3.html: Added.
* platform/ios/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237552
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2018-10-29 Zalan Bujtas <zalan@apple.com>
+ [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 <zalan@apple.com>
+
[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
--- /dev/null
+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
--- /dev/null
+<style>
+img {
+ float: left;
+ width: 20px;
+}
+
+div {
+ width: 300px;
+}
+</style>
+
+very top of the content<img src="foobar.jpg" height="100">
+<div>thisis<img src="foobar.jpg" height="74">onerun, next to 2 floats. One intruding, one in this
+<span>inline formatting context</span>
+</div>
+<div><span><img src="foobar.jpg" 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>
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 ]
2018-10-29 Zalan Bujtas <zalan@apple.com>
+ [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 <zalan@apple.com>
+
[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
// 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
2018-10-29 Zalan Bujtas <zalan@apple.com>
+ [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 <zalan@apple.com>
+
[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
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