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

Changeset 278303 in webkit


Ignore:
Timestamp:
Jun 1, 2021, 6:43:06 AM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][TFC][Quirks] heightValueOfNearestContainingBlockWithFixedHeight should not need to cross formatting context boundary
https://bugs.webkit.org/show_bug.cgi?id=226470

Reviewed by Antti Koivisto.

Now that the incoming vertical constraint is applied properly for the cell layout, we don't need to cross
the formatting context boundary in heightValueOfNearestContainingBlockWithFixedHeight to check if the table
box has fixed height value.

  • layout/formattingContexts/table/TableFormattingQuirks.cpp:

(WebCore::Layout::TableFormattingQuirks::heightValueOfNearestContainingBlockWithFixedHeight const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r278300 r278303  
     12021-06-01  Alan Bujtas  <zalan@apple.com>
     2
     3        [LFC][TFC][Quirks] heightValueOfNearestContainingBlockWithFixedHeight should not need to cross formatting context boundary
     4        https://bugs.webkit.org/show_bug.cgi?id=226470
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Now that the incoming vertical constraint is applied properly for the cell layout, we don't need to cross
     9        the formatting context boundary in heightValueOfNearestContainingBlockWithFixedHeight to check if the table
     10        box has fixed height value.
     11
     12        * layout/formattingContexts/table/TableFormattingQuirks.cpp:
     13        (WebCore::Layout::TableFormattingQuirks::heightValueOfNearestContainingBlockWithFixedHeight const):
     14
    1152021-05-27  Sergio Villar Senin  <svillar@igalia.com>
    216
  • trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingQuirks.cpp

    r278253 r278303  
    6363    // context. If we can't resolve it within the table subtree, we default it to 0.
    6464    // e.g <div style="height: 100px"><table><tr><td style="height: 100%"></td></tr></table></div> is resolved to 0px.
    65     auto& tableBox = formattingContext().root();
    66     auto fixedLogicalHeight = [&](const auto& ancestorBox) -> std::optional<LayoutUnit> {
    67         auto height = ancestorBox.style().logicalHeight();
    68         if (!height.isFixed())
    69             return { };
    70         if (&ancestorBox != &tableBox)
     65    for (auto& ancestor : containingBlockChainWithinFormattingContext(layoutBox)) {
     66        auto height = ancestor.style().logicalHeight();
     67        if (height.isFixed())
    7168            return LayoutUnit { height.value() };
    72         auto& grid = formattingContext().formattingState().tableGrid();
    73         auto verticalSpacing = grid.verticalSpacing();
    74         return LayoutUnit { height.value() - ((grid.rows().size() + 1) * verticalSpacing) };
    75     };
    76 
    77     for (auto& ancestor : containingBlockChain(layoutBox, tableBox.containingBlock())) {
    78         if (auto fixedHeight = fixedLogicalHeight(ancestor))
    79             return *fixedHeight;
    8069    }
    8170    return { };
Note: See TracChangeset for help on using the changeset viewer.