Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a8c7730a75ef911ed99272f87838f12bd99c8c0e
      
https://github.com/WebKit/WebKit/commit/a8c7730a75ef911ed99272f87838f12bd99c8c0e
  Author: Sammy Gill <[email protected]>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-column-container-with-scrollable-descendant-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-column-container-with-scrollable-descendant-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-column-container-with-scrollable-descendant.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-container-multiple-items-with-scrollable-descendant-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-container-multiple-items-with-scrollable-descendant-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-container-multiple-items-with-scrollable-descendant.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-container-with-scrollable-descendant-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-container-with-scrollable-descendant-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-container-with-scrollable-descendant.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-nested-container-with-scrollable-descendant-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-nested-container-with-scrollable-descendant-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/flex-nested-container-with-scrollable-descendant.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/grid-container-with-scrollable-descendant-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/grid-container-with-scrollable-descendant-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/grid-container-with-scrollable-descendant.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/grid-nested-container-with-scrollable-descendant-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/grid-nested-container-with-scrollable-descendant-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/grid-nested-container-with-scrollable-descendant.html
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/SubtreeScrollbarChangesState.cpp

  Log Message:
  -----------
  GitHub.com: emoji reaction touches code box in comment.
https://bugs.webkit.org/show_bug.cgi?id=312152
rdar://174652842

Reviewed by Alan Baradlay.

The automatic block size of a block-level flex container is its
max-content size. Similarly, the grid spec states that in both inline
and block formatting contexts, the grid container's auto block size is
its max-content size. When a descendant within an item gains a scrollbar
that consumes block-axis space (e.g. a horizontal scrollbar), the
container's block-size must grow to accommodate the taller content.
Without tracking this, the container's block-size goes stale and
following siblings can overlap the scrollbar.

Consider:

  <div style="display: flex"> <!-- subtree root -->
    <div class="flex-item">
      <div style="overflow: auto">
        ...content that overflows horizontally...
      </div>
    </div>
  </div>
  <div class="sibling"></div>

When the overflow div gains a horizontal scrollbar, the flex container
must grow. The subtree root handler calls
subtreeRoot->layoutBlock(RelayoutChildren::Yes), but RelayoutChildren
only forces direct children to lay out. The scrollbar-gaining renderer
is a grandchild, so it remains clean and never reserves space for the
new scrollbar. We must explicitly call setNeedsLayout() on it so that
the dirty bit propagates up the containing block chain to the subtree
root. When layoutBlock then walks down looking for dirty descendants, it
reaches and relays out the renderer with its new scrollbar geometry.

* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::sizesAffectedByScrollbarsForSubtreeRoot):
Track LogicalBoxAxis::Block for block-level flex containers and grid
containers with auto or intrinsic logical height.

* Source/WebCore/rendering/SubtreeScrollbarChangesState.cpp:
(WebCore::SubtreeScrollbarChangesHandler::~SubtreeScrollbarChangesHandler):
For block-axis changes, call setNeedsLayout() on the descendant. For
inline-axis changes, invalidateContentLogicalWidths(). A renderer with
both gets both.

Tests:
- flex-container-with-scrollable-descendant: row flex, grandchild scroller.
- flex-column-container-with-scrollable-descendant: column flex.
- flex-container-multiple-items-with-scrollable-descendant: multiple items, one 
with scroller.
- flex-nested-container-with-scrollable-descendant: nested flex containers.
- grid-container-with-scrollable-descendant: grid, grandchild scroller.
- grid-nested-container-with-scrollable-descendant: nested grid containers.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to