Title: [246461] trunk/Source/WebCore
Revision
246461
Author
[email protected]
Date
2019-06-15 07:11:37 -0700 (Sat, 15 Jun 2019)

Log Message

[LFC][MarginCollapsing] Add check for computed height value in MarginCollapse::marginsCollapseThrough
https://bugs.webkit.org/show_bug.cgi?id=198883
<rdar://problem/51773395>

Reviewed by Antti Koivisto.

"A box's own margins collapse if... ...and it has a 'height' of either 0 or 'auto"
https://www.w3.org/TR/CSS22/box.html#collapsing-margins

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (246460 => 246461)


--- trunk/Source/WebCore/ChangeLog	2019-06-15 14:09:16 UTC (rev 246460)
+++ trunk/Source/WebCore/ChangeLog	2019-06-15 14:11:37 UTC (rev 246461)
@@ -1,5 +1,19 @@
 2019-06-15  Zalan Bujtas  <[email protected]>
 
+        [LFC][MarginCollapsing] Add check for computed height value in MarginCollapse::marginsCollapseThrough
+        https://bugs.webkit.org/show_bug.cgi?id=198883
+        <rdar://problem/51773395>
+
+        Reviewed by Antti Koivisto.
+
+        "A box's own margins collapse if... ...and it has a 'height' of either 0 or 'auto"
+        https://www.w3.org/TR/CSS22/box.html#collapsing-margins
+
+        * layout/blockformatting/BlockMarginCollapse.cpp:
+        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
+
+2019-06-15  Zalan Bujtas  <[email protected]>
+
         [LFC] Fix available width for shrink-to-fit (for out-of-flow non-replaced box)
         https://bugs.webkit.org/show_bug.cgi?id=198880
         <rdar://problem/51773118>

Modified: trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp (246460 => 246461)


--- trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp	2019-06-15 14:09:16 UTC (rev 246460)
+++ trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp	2019-06-15 14:11:37 UTC (rev 246461)
@@ -384,12 +384,13 @@
     if (hasPaddingBefore(layoutBox) || hasPaddingAfter(layoutBox))
         return false;
 
-    // FIXME: Check for computed 0 height.
-    if (!layoutBox.style().height().isAuto())
+    auto& style = layoutBox.style();
+    auto computedHeightValueIsZero = style.height().isFixed() && !style.height().value();
+    if (!(style.height().isAuto() || computedHeightValueIsZero))
         return false;
 
     // FIXME: Check for computed 0 height.
-    if (!layoutBox.style().minHeight().isAuto())
+    if (!style.minHeight().isAuto())
         return false;
 
     // FIXME: Block replaced boxes clearly don't collapse through their margins, but I couldn't find it in the spec yet (and no, it's not a quirk).
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to