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

  Changed paths:
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/layout/formattingContexts/grid/AutoRepeatResolver.cpp
    A Source/WebCore/layout/formattingContexts/grid/AutoRepeatResolver.h
    M Source/WebCore/layout/formattingContexts/grid/ExplicitGridResolver.cpp
    M Source/WebCore/layout/formattingContexts/grid/ExplicitGridResolver.h
    M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp

  Log Message:
  -----------
  [GFC] Add basic support for auto-repeat tracks.
https://bugs.webkit.org/show_bug.cgi?id=325816
rdar://problem/188827624

Reviewed by Alan Baradlay.

Here we add some very basic support for the auto-repeat type of tracks
by adding some initial logic that is focused on auto-fill. The basic
idea is fairly straightforward: ExplicitGridResolver will check to see
if there are any auto-fill tracks in the track list and then use
AutoRepeatResolver to figure out the number of tracks that will come
from this. This requires a bit of extra plumbing into
ExplicitGridResolver since we may need a bit more data like the used gap
sizes.

AutoRepeatResolver is where the core of this logic will live and
basically implements the spec text in a straightforward manner. It
figures out the space that the repeated tracks will fill, make sure that
there is at least one definite track to use for the repition from each
entrry in the list, and then tries to figure out how many times that
list can be repeated.

* Source/WebCore/layout/formattingContexts/grid/AutoRepeatResolver.cpp: Added.
(WebCore::Layout::trackSizeForRepetitions):
Determines which of the sizing functions to use by checking which one is
definite.

(WebCore::Layout::nonRepeatedTracksSpace):
How much room the rest of the tracks that are not in the auto-repeat
list take up.

(WebCore::Layout::repetitionsToFill):
This is basically just a implementation of the spec text with regards to
figuring out the space for the repitions and then trying to repeat that
in the space that is available to us to fill.

(WebCore::Layout::AutoRepeatResolver::resolveRepetitions):
Entrypoint function for AutoRepeatResolver. This figures out the
constraint that we will be filling into (preferred size vs minimum size)
and then calls into the rest of the code. Since the way in which we
repeat the tracks into the available space will change slightly based on
which constraint we are using we need to keep track of that as well.

* Source/WebCore/layout/formattingContexts/grid/ExplicitGridResolver.cpp:
(WebCore::Layout::trackSizesWithAutoRepetitions):
Once the number of repeated tracks has been determined we can then
create the entire track list by fitting in the repititions into the
insert point given to us by style.

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



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

Reply via email to