Diff
Modified: trunk/LayoutTests/ChangeLog (240035 => 240036)
--- trunk/LayoutTests/ChangeLog 2019-01-16 14:52:55 UTC (rev 240035)
+++ trunk/LayoutTests/ChangeLog 2019-01-16 15:23:24 UTC (rev 240036)
@@ -1,5 +1,15 @@
2019-01-16 Zalan Bujtas <za...@apple.com>
+ [LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
+ https://bugs.webkit.org/show_bug.cgi?id=193470
+
+ Reviewed by Antti Koivisto.
+
+ * fast/block/block-only/non-auto-top-bottom-height-with-margins-expected.txt: Added.
+ * fast/block/block-only/non-auto-top-bottom-height-with-margins.html: Added.
+
+2019-01-16 Zalan Bujtas <za...@apple.com>
+
[LFC] Adjust margin box verification.
https://bugs.webkit.org/show_bug.cgi?id=193482
Added: trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-margins-expected.txt (0 => 240036)
--- trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-margins-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-margins-expected.txt 2019-01-16 15:23:24 UTC (rev 240036)
@@ -0,0 +1,17 @@
+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 110x110
+ RenderBlock (relative positioned) {DIV} at (0,0) size 110x110 [border: (5px solid #008000)]
+layer at (13,33) size 50x50
+ RenderBlock (positioned) {DIV} at (5,25) size 50x50 [bgcolor=#0000FF]
+layer at (8,118) size 110x110
+ RenderBlock (relative positioned) {DIV} at (0,110) size 110x110 [border: (5px solid #008000)]
+layer at (13,133) size 50x50
+ RenderBlock (positioned) {DIV} at (5,15) size 50x50 [bgcolor=#0000FF]
+layer at (8,228) size 110x110
+ RenderBlock (relative positioned) {DIV} at (0,220) size 110x110 [border: (5px solid #008000)]
+layer at (13,253) size 50x50
+ RenderBlock (positioned) {DIV} at (5,25) size 50x50 [bgcolor=#0000FF]
Added: trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-margins.html (0 => 240036)
--- trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-margins.html (rev 0)
+++ trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-margins.html 2019-01-16 15:23:24 UTC (rev 240036)
@@ -0,0 +1,22 @@
+<style>
+.container {
+ border: 5px solid green;
+ height: 100px;
+ width: 100px;
+ position: relative;
+}
+
+div div {
+ background: blue;
+ position: absolute;
+
+ height: 50px;
+ width: 50px;
+
+ top: 10px;
+ bottom: 10px;
+}
+</style>
+<div class=container><div style="margin-top: 10px;"></div></div>
+<div class=container><div style="margin-bottom: 10px;"></div></div>
+<div class=container><div style="margin-top: 10px; margin-bottom: 10px;"></div></div>
Modified: trunk/Source/WebCore/ChangeLog (240035 => 240036)
--- trunk/Source/WebCore/ChangeLog 2019-01-16 14:52:55 UTC (rev 240035)
+++ trunk/Source/WebCore/ChangeLog 2019-01-16 15:23:24 UTC (rev 240036)
@@ -1,3 +1,17 @@
+2019-01-16 Zalan Bujtas <za...@apple.com>
+
+ [LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
+ https://bugs.webkit.org/show_bug.cgi?id=193470
+
+ Reviewed by Antti Koivisto.
+
+ Non-auto vertical margin values (which is mostly the case) should be set as used values.
+
+ Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html
+
+ * layout/FormattingContextGeometry.cpp:
+ (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
+
2019-01-16 Alan Kinsley <za...@apple.com>
[LFC] Adjust margin box verification.
Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (240035 => 240036)
--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp 2019-01-16 14:52:55 UTC (rev 240035)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp 2019-01-16 15:23:24 UTC (rev 240036)
@@ -304,7 +304,8 @@
} else if (!computedVerticalMargin.after) {
usedVerticalMargin.before = *computedVerticalMargin.before;
usedVerticalMargin.after = containingBlockHeight - (*top + usedVerticalMargin.before + borderTop + paddingTop + contentHeight() + paddingBottom + borderBottom + *bottom);
- }
+ } else
+ usedVerticalMargin = { *computedVerticalMargin.before, *computedVerticalMargin.after };
// Over-constrained?
auto boxHeight = *top + usedVerticalMargin.before + borderTop + paddingTop + contentHeight() + paddingBottom + borderBottom + usedVerticalMargin.after + *bottom;
if (boxHeight != containingBlockHeight)
Modified: trunk/Tools/ChangeLog (240035 => 240036)
--- trunk/Tools/ChangeLog 2019-01-16 14:52:55 UTC (rev 240035)
+++ trunk/Tools/ChangeLog 2019-01-16 15:23:24 UTC (rev 240036)
@@ -1,5 +1,14 @@
2019-01-16 Zalan Bujtas <za...@apple.com>
+ [LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
+ https://bugs.webkit.org/show_bug.cgi?id=193470
+
+ Reviewed by Antti Koivisto.
+
+ * LayoutReloaded/misc/LFC-passing-tests.txt:
+
+2019-01-16 Zalan Bujtas <za...@apple.com>
+
[LFC] Adjust margin box verification.
https://bugs.webkit.org/show_bug.cgi?id=193482
Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (240035 => 240036)
--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2019-01-16 14:52:55 UTC (rev 240035)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt 2019-01-16 15:23:24 UTC (rev 240036)
@@ -79,6 +79,7 @@
fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html
fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html
+fast/block/block-only/non-auto-top-bottom-height-with-margins.html
fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
fast/block/basic/002.html
fast/block/basic/003.html