⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278403 in webkit


Ignore:
Timestamp:
Jun 3, 2021, 6:02:37 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][TFC] Use the fixed table height value to resolve percent column height values
​https://bugs.webkit.org/show_bug.cgi?id=226566

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/table-with-percent-columns-simple.html

  • layout/formattingContexts/table/TableFormattingContext.cpp:

(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace):

  • layout/formattingContexts/table/TableFormattingContext.h:
  • layout/formattingContexts/table/TableFormattingGeometry.cpp:

(WebCore::Layout::TableFormattingGeometry::verticalSpaceForCellContent const):

  • layout/formattingContexts/table/TableFormattingGeometry.h:

LayoutTests:

  • fast/layoutformattingcontext/table-with-percent-columns-and-spacing-expected.html:
  • fast/layoutformattingcontext/table-with-percent-columns-and-spacing.html:
  • fast/layoutformattingcontext/table-with-percent-columns-simple-expected.html: Added.
  • fast/layoutformattingcontext/table-with-percent-columns-simple.html: Added.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278402 r278403  
     12021-06-03  Alan Bujtas  <zalan@apple.com>
     2
     3        [LFC][TFC] Use the fixed table height value to resolve percent column height values
     4        https://bugs.webkit.org/show_bug.cgi?id=226566
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/layoutformattingcontext/table-with-percent-columns-and-spacing-expected.html:
     9        * fast/layoutformattingcontext/table-with-percent-columns-and-spacing.html:
     10        * fast/layoutformattingcontext/table-with-percent-columns-simple-expected.html: Added.
     11        * fast/layoutformattingcontext/table-with-percent-columns-simple.html: Added.
     12
    1132021-06-03  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/LayoutTests/fast/layoutformattingcontext/table-with-percent-columns-and-spacing-expected.html

    r278239 r278403  
     1<!-- webkit-test-runner [ LayoutFormattingContextEnabled=true LayoutFormattingContextIntegrationEnabled=false ] -->
    12<style>
    23div {
  • trunk/LayoutTests/fast/layoutformattingcontext/table-with-percent-columns-and-spacing.html

    r278239 r278403  
     1<!-- webkit-test-runner [ LayoutFormattingContextEnabled=true LayoutFormattingContextIntegrationEnabled=false ] -->
    12<style>
    23td {
  • trunk/Source/WebCore/ChangeLog

    r278398 r278403  
     12021-06-03  Alan Bujtas  <zalan@apple.com>
     2
     3        [LFC][TFC] Use the fixed table height value to resolve percent column height values
     4        https://bugs.webkit.org/show_bug.cgi?id=226566
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Test: fast/layoutformattingcontext/table-with-percent-columns-simple.html
     9
     10        * layout/formattingContexts/table/TableFormattingContext.cpp:
     11        (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
     12        (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
     13        (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace):
     14        * layout/formattingContexts/table/TableFormattingContext.h:
     15        * layout/formattingContexts/table/TableFormattingGeometry.cpp:
     16        (WebCore::Layout::TableFormattingGeometry::verticalSpaceForCellContent const):
     17        * layout/formattingContexts/table/TableFormattingGeometry.h:
     18
    1192021-06-03  Julian Gonzalez  <julian_a_gonzalez@apple.com>
    220
  • trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp

    r278294 r278403  
    6262    computeAndDistributeExtraSpace(availableHorizontalSpace, availableVerticalSpace);
    6363    // 2. Finalize cells.
    64     setUsedGeometryForCells(availableHorizontalSpace);
     64    setUsedGeometryForCells(availableHorizontalSpace, availableVerticalSpace);
    6565    // 3. Finalize rows.
    6666    setUsedGeometryForRows(availableHorizontalSpace);
    … …  
    7777}
    7878
    79 void TableFormattingContext::setUsedGeometryForCells(LayoutUnit availableHorizontalSpace)
     79void TableFormattingContext::setUsedGeometryForCells(LayoutUnit availableHorizontalSpace, std::optional<LayoutUnit> availableVerticalSpace)
    8080{
    8181    auto& grid = formattingState().tableGrid();
    … …  
    112112            LayoutContext::createFormattingContext(cellBox, layoutState())->layoutInFlowContent(invalidationState, formattingGeometry.constraintsForInFlowContent(cellBox));
    113113        }
    114         cellBoxGeometry.setContentBoxHeight(formattingGeometry.verticalSpaceForCellContent(*cell));
     114        cellBoxGeometry.setContentBoxHeight(formattingGeometry.verticalSpaceForCellContent(*cell, availableVerticalSpace));
    115115
    116116        auto computeIntrinsicVerticalPaddingForCell = [&] {
    … …  
    445445                    LayoutContext::createFormattingContext(cellBox, layoutState())->layoutInFlowContent(invalidationState, formattingGeometry.constraintsForInFlowContent(cellBox));
    446446                }
    447                 cellBoxGeometry.setContentBoxHeight(formattingGeometry.verticalSpaceForCellContent(cell));
     447                cellBoxGeometry.setContentBoxHeight(formattingGeometry.verticalSpaceForCellContent(cell, availableVerticalSpace));
    448448            };
    449449            layoutCellContent(slot.cell());
  • trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.h

    r278294 r278403  
    7373
    7474    IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
    75     void setUsedGeometryForCells(LayoutUnit availableHorizontalSpace);
     75    void setUsedGeometryForCells(LayoutUnit availableHorizontalSpace, std::optional<LayoutUnit> availableVerticalSpace);
    7676    void setUsedGeometryForRows(LayoutUnit availableHorizontalSpace);
    7777    void setUsedGeometryForSections(const ConstraintsForInFlowContent&);
  • trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp

    r278294 r278403  
    181181}
    182182
    183 LayoutUnit TableFormattingGeometry::verticalSpaceForCellContent(const TableGrid::Cell& cell) const
     183LayoutUnit TableFormattingGeometry::verticalSpaceForCellContent(const TableGrid::Cell& cell, std::optional<LayoutUnit> availableVerticalSpace) const
    184184{
    185185    auto& cellBox = cell.box();
    186186    auto contentHeight = cellBoxContentHeight(cellBox);
    187     auto computedHeight = this->computedHeight(cellBox);
     187    auto computedHeight = this->computedHeight(cellBox, availableVerticalSpace);
    188188    if (!computedHeight)
    189189        return contentHeight;
  • trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.h

    r278294 r278403  
    4646    InlineLayoutUnit usedBaselineForCell(const ContainerBox& cellBox) const;
    4747    LayoutUnit horizontalSpaceForCellContent(const TableGrid::Cell&) const;
    48     LayoutUnit verticalSpaceForCellContent(const TableGrid::Cell&) const;
     48    LayoutUnit verticalSpaceForCellContent(const TableGrid::Cell&, std::optional<LayoutUnit> availableVerticalSpace) const;
    4949
    5050private:
Note: See TracChangeset for help on using the changeset viewer.