Changeset 261223 in webkit


Ignore:
Timestamp:
May 6, 2020 7:04:11 AM (4 years ago)
Author:
Alan Bujtas
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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r261220 r261223  
     12020-05-06  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][BFC] FormattingContext::ConstraintsForInFlowContent should include the computed value of height
     4        https://bugs.webkit.org/show_bug.cgi?id=211487
     5
     6        Reviewed by Antti Koivisto.
     7
     8        When the formatting context root has fixed height, the computed value should be passed in to the formatting context layout
     9        as the available vertical space.
     10
     11        * layout/FormattingContextGeometry.cpp:
     12        (WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent):
     13        * layout/tableformatting/TableFormattingContext.cpp:
     14        (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
     15
    1162020-04-29  Sergio Villar Senin  <svillar@igalia.com>
    217
  • trunk/Source/WebCore/layout/FormattingContextGeometry.cpp

    r261164 r261223  
    11081108{
    11091109    auto& boxGeometry = formattingContext().geometryForBox(containerBox, escapeReason);
    1110     return { { boxGeometry.contentBoxLeft(), boxGeometry.contentBoxWidth() }, { boxGeometry.contentBoxTop(), { } } };
     1110    // FIXME: Find out if min/max-height properties should also be taken into account here.
     1111    return { { boxGeometry.contentBoxLeft(), boxGeometry.contentBoxWidth() }, { boxGeometry.contentBoxTop(), computedHeight(containerBox) } };
    11111112}
    11121113
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp

    r261164 r261223  
    531531}
    532532
    533 void TableFormattingContext::computeAndDistributeExtraVerticalSpace(LayoutUnit availableHorizontalSpace, Optional<LayoutUnit> verticalConstraint)
     533void TableFormattingContext::computeAndDistributeExtraVerticalSpace(LayoutUnit availableHorizontalSpace, Optional<LayoutUnit> availableVerticalSpace)
    534534{
    535535    auto& grid = formattingState().tableGrid();
     
    572572
    573573    // Distribute extra space if the table is supposed to be taller than the sum of the row heights.
    574     auto minimumTableHeight = verticalConstraint;
    575     if (!minimumTableHeight)
    576         minimumTableHeight = geometry().fixedValue(root().style().logicalHeight());
    577574    float spaceToDistribute = 0;
    578     if (minimumTableHeight)
    579         spaceToDistribute = std::max(0.0f, *minimumTableHeight - ((rows.size() + 1) * grid.verticalSpacing()) - tableUsedHeight);
     575    if (availableVerticalSpace)
     576        spaceToDistribute = std::max(0.0f, *availableVerticalSpace - ((rows.size() + 1) * grid.verticalSpacing()) - tableUsedHeight);
    580577    auto distributedSpaces = distributeAvailableSpace<RowSpan>(grid, spaceToDistribute, [&] (const TableGrid::Slot& slot, size_t rowIndex) {
    581578        if (slot.hasRowSpan())
Note: See TracChangeset for help on using the changeset viewer.