Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5be8ddb4cbbb5ec1372e8872923127910e9c8b15
      
https://github.com/WebKit/WebKit/commit/5be8ddb4cbbb5ec1372e8872923127910e9c8b15
  Author: Sammy Gill <[email protected]>
  Date:   2026-10-02 (Fri, 02 Oct 2026)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.h
    M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.cpp
    M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.h

  Log Message:
  -----------
  [GFC] Populate GridLayoutResult with the grid's used block size.
https://bugs.webkit.org/show_bug.cgi?id=325996
rdar://problem/188943220

Reviewed by Vitor Roriz.

Currently inside of the integration code we work through and determine
what the grid's block size should be so that we can set that value back
on RenderGrid. This is done by summing up the sizes of the rows and
gaps. However, in the future we are going to need to potentially run
GridSizer two times which may result in different row sizes from the
first one. Only the row sizes from the first run should be used for the
grid's block size.

Instead, let's just return this as an additional piece of information
that is the output of grid layout. We compute the used block size in the
exact same way that we currently do so there should be no behavior
change. This makes it much more obvious where the integration code
should get the used block size from when it needs to put a value back on
RenderGrid.

* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
(WebCore::Layout::GridFormattingContext::layout):
Once GridLayout::layout is done we are able to compute the used block
size in the exact same way we do in 
GridLayout::updateFormattingContextRootRenderer
so we can just move that lambda over here.

* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.h:
Add blockContentSize to GridLayoutResult.

* Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.cpp:
(WebCore::LayoutIntegration::GridLayout::updateFormattingContextRootRenderer): 
Use the
block content size from GridFormattingContext instead of computing it.

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



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

Reply via email to