Ignore:
Timestamp:
Jun 17, 2022, 6:35:02 AM (3 years ago)
Author:
Alan Bujtas
Message:

Remove redundant logical right computation for grid items in RenderBlock::computeOverflow
https://bugs.webkit.org/show_bug.cgi?id=241689

Reviewed by Simon Fraser.

If the grid content produces layout overflow, we should not need to re-compute it again by looping through the grid items.

  1. Decouple "include padding end" and "include child's margin end" logic
  2. Decouple "include padding after" and "include padding end" logic.
  3. Restore RenderFlexibleBox and RenderGrid computeOverflow calls to pre-r282463 (when clientLogicalRightAndBottomAfterRepositioning was introduced)
  • LayoutTests/fast/overflow/grid-horizontal-overflow-with-padding-end-expected.html: Added.
  • LayoutTests/fast/overflow/grid-horizontal-overflow-with-padding-end.html: Added.
  • Source/WebCore/rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeOverflow):
(WebCore::RenderBlock::layoutOverflowLogicalBottom):
(WebCore::RenderBlock::clientLogicalRightAndBottomAfterRepositioning const): Deleted.

  • Source/WebCore/rendering/RenderBlock.h:
  • Source/WebCore/rendering/RenderBox.cpp:

(WebCore::RenderBox::layoutOverflowRectForPropagation const):

  • Source/WebCore/rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutBlock):

  • Source/WebCore/rendering/RenderGrid.cpp:

(WebCore::RenderGrid::layoutBlock):

Canonical link: https://commits.webkit.org/251638@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r295124 r295633  
    52345234{
    52355235    // Only propagate interior layout overflow if we don't completely clip it.
    5236     LayoutRect rect = borderBoxRect();
     5236    auto rect = borderBoxRect();
     5237    if (isGridItem()) {
     5238        // As per https://github.com/w3c/csswg-drafts/issues/3653, child's margins should contribute to the scrollable overflow area.
     5239        // FIXME: Expand it to non-grid cases when applicable.
     5240        rect.setWidth(rect.width() + std::max(0_lu, marginEnd()));
     5241    }
    52375242    if (!shouldApplyLayoutContainment()) {
    52385243        if (style().overflowX() == Overflow::Clip && style().overflowY() == Overflow::Visible) {
Note: See TracChangeset for help on using the changeset viewer.