Title: [249292] trunk/Source/WebCore
Revision
249292
Author
[email protected]
Date
2019-08-29 14:26:23 -0700 (Thu, 29 Aug 2019)

Log Message

[LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only be called on float avoiders.
https://bugs.webkit.org/show_bug.cgi?id=201238
<rdar://problem/54807663>

Reviewed by Antti Koivisto.

Make the horizontal available space logic for float avoiders more explicit/readable.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (249291 => 249292)


--- trunk/Source/WebCore/ChangeLog	2019-08-29 20:50:24 UTC (rev 249291)
+++ trunk/Source/WebCore/ChangeLog	2019-08-29 21:26:23 UTC (rev 249292)
@@ -1,5 +1,19 @@
 2019-08-29  Zalan Bujtas  <[email protected]>
 
+        [LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only be called on float avoiders.
+        https://bugs.webkit.org/show_bug.cgi?id=201238
+        <rdar://problem/54807663>
+
+        Reviewed by Antti Koivisto.
+
+        Make the horizontal available space logic for float avoiders more explicit/readable. 
+
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
+        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
+
+2019-08-29  Zalan Bujtas  <[email protected]>
+
         [LFC] Inline content logging should have some extra space for better readability
         https://bugs.webkit.org/show_bug.cgi?id=201236
         <rdar://problem/54807336>

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (249291 => 249292)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2019-08-29 20:50:24 UTC (rev 249291)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2019-08-29 21:26:23 UTC (rev 249292)
@@ -122,8 +122,7 @@
 {
     // Normally the available width for an in-flow block level box is the width of the containing block's content box.
     // However (and can't find it anywhere in the spec) non-floating positioned float avoider block level boxes are constrained by existing floats.
-    if (!layoutBox.isFloatAvoider() || layoutBox.isFloatingPositioned())
-        return { };
+    ASSERT(layoutBox.isFloatAvoider());
     auto& floatingState = floatingContext.floatingState();
     if (floatingState.isEmpty())
         return { };
@@ -163,7 +162,11 @@
     computeBorderAndPadding(layoutBox);
     computeStaticVerticalPosition(floatingContext, layoutBox);
 
-    computeWidthAndMargin(layoutBox, usedAvailableWidthForFloatAvoider(floatingContext, layoutBox));
+    Optional<LayoutUnit> usedAvailableWidthForFloatAvoider;
+    auto horizontalAvailableSpaceIsConstrainedByExistingFloats = layoutBox.isFloatAvoider() && !layoutBox.isFloatingPositioned();
+    if (horizontalAvailableSpaceIsConstrainedByExistingFloats)
+        usedAvailableWidthForFloatAvoider = this->usedAvailableWidthForFloatAvoider(floatingContext, layoutBox);
+    computeWidthAndMargin(layoutBox, usedAvailableWidthForFloatAvoider);
     computeStaticHorizontalPosition(layoutBox);
     // Swich over to the new formatting context (the one that the root creates).
     auto formattingContext = layoutState().createFormattingContext(layoutBox);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to