[LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jan 2019 15:29:28 +0000 (15:29 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jan 2019 15:29:28 +0000 (15:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193894

Reviewed by Antti Koivisto.

* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240580 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp

index 424128a..d1b7bc6 100644 (file)
@@ -1,3 +1,13 @@
+2019-01-28  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
+        https://bugs.webkit.org/show_bug.cgi?id=193894
+
+        Reviewed by Antti Koivisto.
+
+        * layout/blockformatting/BlockFormattingContextQuirks.cpp:
+        (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
+
 2019-01-28  Antoine Quint  <graouts@apple.com>
 
         Limit user-agent interactions based on the touch-action property on iOS
index cffe722..a125b64 100644 (file)
@@ -93,7 +93,8 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedInFlowHeight(const Layo
 
         auto nonCollapsedMargin = heightAndMargin.nonCollapsedMargin;
         auto collapsedMargin = MarginCollapse::collapsedVerticalValues(layoutState, layoutBox, nonCollapsedMargin);
-        totalVerticalMargin = collapsedMargin.before.valueOr(nonCollapsedMargin.before) + collapsedMargin.after.valueOr(nonCollapsedMargin.after);
+        totalVerticalMargin = collapsedMargin.before.valueOr(nonCollapsedMargin.before);
+        totalVerticalMargin += collapsedMargin.isCollapsedThrough ? nonCollapsedMargin.after : collapsedMargin.after.valueOr(nonCollapsedMargin.after);
     }
 
     // Stretch but never overstretch with the margins.