Title: [237580] trunk/Source/WebCore
Revision
237580
Author
za...@apple.com
Date
2018-10-29 21:00:17 -0700 (Mon, 29 Oct 2018)

Log Message

Missing from r237549

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginTop):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (237579 => 237580)


--- trunk/Source/WebCore/ChangeLog	2018-10-30 03:35:07 UTC (rev 237579)
+++ trunk/Source/WebCore/ChangeLog	2018-10-30 04:00:17 UTC (rev 237580)
@@ -1,3 +1,11 @@
+2018-10-29  Zalan Bujtas  <za...@apple.com>
+
+        Missing from r237549
+
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
+        (WebCore::Layout::hasPrecomputedMarginTop):
+
 2018-10-29  Ross Kirsling  <ross.kirsl...@sony.com>
 
         Unreviewed speculative build fix for AppleWin after r237559.

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (237579 => 237580)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2018-10-30 03:35:07 UTC (rev 237579)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2018-10-30 04:00:17 UTC (rev 237580)
@@ -198,8 +198,8 @@
 {
     ASSERT(layoutBox.establishesFormattingContext());
 
-    auto avoidsFloats = (layoutBox.establishesBlockFormattingContext() && !layoutBox.establishesInlineFormattingContext()) || layoutBox.hasFloatClear();
-    if (layoutBox.isFloatingPositioned() || avoidsFloats)
+    auto avoidsFloats = layoutBox.isFloatingPositioned() || layoutBox.establishesBlockFormattingContext() || layoutBox.hasFloatClear();
+    if (avoidsFloats)
         computeEstimatedMarginTopForAncestors(layoutContext, layoutBox);
 
     // If the inline formatting root is also the root for the floats (happens when the root box also establishes a block formatting context)
@@ -214,8 +214,12 @@
 #ifndef NDEBUG
 static bool hasPrecomputedMarginTop(const LayoutContext& layoutContext, const Box& layoutBox)
 {
-    for (auto* ancestor = layoutBox.containingBlock(); ancestor && !ancestor->establishesBlockFormattingContext(); ancestor = ancestor->containingBlock())
-        ASSERT(displayBox.layoutContext.displayBoxForLayoutBox(*ancestor).estimatedMarginTop());
+    for (auto* ancestor = layoutBox.containingBlock(); ancestor && !ancestor->establishesBlockFormattingContext(); ancestor = ancestor->containingBlock()) {
+        if (layoutContext.displayBoxForLayoutBox(*ancestor).estimatedMarginTop())
+            continue;
+        return false;
+    }
+    return true;
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to