Title: [261223] trunk/Source/WebCore
Revision
261223
Author
za...@apple.com
Date
2020-05-06 07:04:11 -0700 (Wed, 06 May 2020)

Log Message

[LFC][BFC] FormattingContext::ConstraintsForInFlowContent should include the computed value of height
https://bugs.webkit.org/show_bug.cgi?id=211487

Reviewed by Antti Koivisto.

When the formatting context root has fixed height, the computed value should be passed in to the formatting context layout
as the available vertical space.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261222 => 261223)


--- trunk/Source/WebCore/ChangeLog	2020-05-06 13:33:08 UTC (rev 261222)
+++ trunk/Source/WebCore/ChangeLog	2020-05-06 14:04:11 UTC (rev 261223)
@@ -1,3 +1,18 @@
+2020-05-06  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][BFC] FormattingContext::ConstraintsForInFlowContent should include the computed value of height
+        https://bugs.webkit.org/show_bug.cgi?id=211487
+
+        Reviewed by Antti Koivisto.
+
+        When the formatting context root has fixed height, the computed value should be passed in to the formatting context layout
+        as the available vertical space.
+
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent):
+        * layout/tableformatting/TableFormattingContext.cpp:
+        (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
+
 2020-04-29  Sergio Villar Senin  <svil...@igalia.com>
 
         [WebXR] Implement isSessionSupported()

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (261222 => 261223)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-05-06 13:33:08 UTC (rev 261222)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2020-05-06 14:04:11 UTC (rev 261223)
@@ -1107,7 +1107,8 @@
 FormattingContext::ConstraintsForInFlowContent FormattingContext::Geometry::constraintsForInFlowContent(const ContainerBox& containerBox, Optional<EscapeReason> escapeReason)
 {
     auto& boxGeometry = formattingContext().geometryForBox(containerBox, escapeReason);
-    return { { boxGeometry.contentBoxLeft(), boxGeometry.contentBoxWidth() }, { boxGeometry.contentBoxTop(), { } } };
+    // FIXME: Find out if min/max-height properties should also be taken into account here.
+    return { { boxGeometry.contentBoxLeft(), boxGeometry.contentBoxWidth() }, { boxGeometry.contentBoxTop(), computedHeight(containerBox) } };
 }
 
 }

Modified: trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp (261222 => 261223)


--- trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-05-06 13:33:08 UTC (rev 261222)
+++ trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp	2020-05-06 14:04:11 UTC (rev 261223)
@@ -530,7 +530,7 @@
     computeColumnWidths(ColumnWidthBalancingBase::MinimumWidth, horizontalSpaceToDistribute);
 }
 
-void TableFormattingContext::computeAndDistributeExtraVerticalSpace(LayoutUnit availableHorizontalSpace, Optional<LayoutUnit> verticalConstraint)
+void TableFormattingContext::computeAndDistributeExtraVerticalSpace(LayoutUnit availableHorizontalSpace, Optional<LayoutUnit> availableVerticalSpace)
 {
     auto& grid = formattingState().tableGrid();
     auto& columns = grid.columns().list();
@@ -571,12 +571,9 @@
     // FIXME: Collect spanning row maximum heights.
 
     // Distribute extra space if the table is supposed to be taller than the sum of the row heights.
-    auto minimumTableHeight = verticalConstraint;
-    if (!minimumTableHeight)
-        minimumTableHeight = geometry().fixedValue(root().style().logicalHeight());
     float spaceToDistribute = 0;
-    if (minimumTableHeight)
-        spaceToDistribute = std::max(0.0f, *minimumTableHeight - ((rows.size() + 1) * grid.verticalSpacing()) - tableUsedHeight);
+    if (availableVerticalSpace)
+        spaceToDistribute = std::max(0.0f, *availableVerticalSpace - ((rows.size() + 1) * grid.verticalSpacing()) - tableUsedHeight);
     auto distributedSpaces = distributeAvailableSpace<RowSpan>(grid, spaceToDistribute, [&] (const TableGrid::Slot& slot, size_t rowIndex) {
         if (slot.hasRowSpan())
             return geometryForBox(slot.cell().box()).height();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to