https://bugs.webkit.org/show_bug.cgi?id=188487
Reviewed by Antti Koivisto.
Source/WebCore:
Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
Tools:
* LayoutReloaded/misc/LFC-passing-tests.txt:
LayoutTests:
* fast/block/block-only/floating-and-next-previous-inflow-with-margin-expected.txt: Added.
* fast/block/block-only/floating-and-next-previous-inflow-with-margin.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234786
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-08-12 Zalan Bujtas <zalan@apple.com>
+
+ [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent.
+ https://bugs.webkit.org/show_bug.cgi?id=188487
+
+ Reviewed by Antti Koivisto.
+
+ * fast/block/block-only/floating-and-next-previous-inflow-with-margin-expected.txt: Added.
+ * fast/block/block-only/floating-and-next-previous-inflow-with-margin.html: Added.
+
2018-08-10 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: console.log fires getters for deep properties
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x118
+ RenderBlock {HTML} at (0,0) size 800x118
+ RenderBody {BODY} at (8,8) size 784x102
+ RenderBlock {DIV} at (0,0) size 102x102 [border: (1px solid #000000)]
+ RenderBlock (floating) {DIV} at (1,1) size 12x12 [border: (1px solid #000000)]
+ RenderBlock {DIV} at (1,21) size 12x12 [border: (1px solid #000000)]
+ RenderBlock {DIV} at (1,33) size 12x12 [border: (1px solid #000000)]
+ RenderBlock (floating) {DIV} at (1,65) size 12x12 [border: (1px solid #000000)]
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+ border: 1px solid black;
+ width: 10px;
+ height: 10px;
+}
+</style>
+</head>
+<body>
+<div style="width: 100px; height: 100px;">
+ <div style="float: left;"></div>
+ <div style="margin-top: 20px;"></div>
+ <div style="margin-bottom: 20px;"></div>
+ <div style="float: left;"></div>
+</div>
+</body>
+</html>
+2018-08-12 Zalan Bujtas <zalan@apple.com>
+
+ [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent.
+ https://bugs.webkit.org/show_bug.cgi?id=188487
+
+ Reviewed by Antti Koivisto.
+
+ Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html
+
+ * layout/blockformatting/BlockMarginCollapse.cpp:
+ (WebCore::Layout::isMarginTopCollapsedWithParent):
+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
+
2018-08-10 Antti Koivisto <antti@apple.com>
Use OptionSet for various RenderLayer flags
// We never margin collapse the initial containing block.
ASSERT(layoutBox.parent());
auto& parent = *layoutBox.parent();
- // Is this box the first inlflow child?
- if (parent.firstInFlowChild() != &layoutBox)
+ // Only the first inlflow child collapses with parent (floating sibling also prevents collapsing).
+ if (layoutBox.previousInFlowOrFloatingSibling())
return false;
if (parent.establishesBlockFormattingContext())
// We never margin collapse the initial containing block.
ASSERT(layoutBox.parent());
auto& parent = *layoutBox.parent();
- // Is this the last inlflow child?
- if (parent.lastInFlowChild() != &layoutBox)
+ // Only the last inlflow child collapses with parent (floating sibling also prevents collapsing).
+ if (layoutBox.nextInFlowOrFloatingSibling())
return false;
if (parent.establishesBlockFormattingContext())
+2018-08-12 Zalan Bujtas <zalan@apple.com>
+
+ [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent.
+ https://bugs.webkit.org/show_bug.cgi?id=188487
+
+ Reviewed by Antti Koivisto.
+
+ * LayoutReloaded/misc/LFC-passing-tests.txt:
+
2018-08-11 Aakash Jain <aakash_jain@apple.com>
[ews-build] Separate queues for Builders and Testers - iOS
fast/block/block-only/floating-multiple-lefts-in-body.html
fast/block/block-only/floating-multiple-lefts-multiple-lines.html
fast/block/block-only/floating-multiple-lefts.html
+fast/block/block-only/floating-and-next-previous-inflow-with-margin.html