[Masonry] Apply stacking-axis alignment [chromium/src : main]

1 view
Skip to first unread message

Celeste Pan (Gerrit)

unread,
Jun 5, 2026, 3:42:05 PMJun 5
to Alison Maher, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Alison Maher

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Alison Maher
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
Gerrit-Change-Number: 7899886
Gerrit-PatchSet: 4
Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
Gerrit-Attention: Alison Maher <alm...@microsoft.com>
Gerrit-Comment-Date: Fri, 05 Jun 2026 19:41:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alison Maher (Gerrit)

unread,
Jun 5, 2026, 7:05:53 PMJun 5
to Celeste Pan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Celeste Pan

Alison Maher added 41 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Alison Maher . resolved

Some initial comments/questions. Haven't looked at tests yet

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.h
Line 176, Patchset 4 (Latest): GridLayoutData& layout_data,
const Vector<StackingAxisStretchItem>& stacking_axis_stretch_items);
Alison Maher . unresolved

Can these be const? If not, would be good to call them out in the method comment on how they are updated

Line 174, Patchset 4 (Latest): LayoutUnit effective_stacking_axis_size,
LayoutUnit stacking_axis_gap,
Alison Maher . unresolved

reading this, it isn't immediately obvious to me the difference between these two, so would be worth calling out in the comment for the method. Can these be combined at all into one LayoutUnit or do they need to remain separate?

Line 173, Patchset 4 (Latest): GridTrackSizingDirection grid_axis_direction,
Alison Maher . unresolved

Same comment here about not needing to pass this in

Line 171, Patchset 4 (Latest): GridItems& grid_items,
GridLanesRunningPositions& running_positions,
Alison Maher . unresolved

Can these be const?

Line 165, Patchset 4 (Latest): GridTrackSizingDirection grid_axis_direction);
Alison Maher . unresolved

nit: since these are part of the algo, no need to pass them in to these methods since it is pretty cheap to recalc in the methods with `Style().GridLanesTrackSizingDirection();`

Line 147, Patchset 4 (Latest): void RunGridLanesPlacementPhase(
Alison Maher . unresolved

nit: can you add a note about the the new optional out param in the method comment?

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.cc
Line 24, Patchset 4 (Latest):struct StackingAxisStretchItem {
Alison Maher . unresolved

I'm wondering if this can live on running positions, same with the vector for them, that way we don't need to pass around a vector of these, and can access via running positions, which we are already passing around

Line 36, Patchset 4 (Latest):// placement via `MoveChildrenInDirection`.
Alison Maher . unresolved

Since this is just used internally, could this be a Pair of <LayoutObject, LayoutUnit> below instead of a new struct?

Line 187, Patchset 4 (Latest): HasStackingAxisAlignment(style, *grid_items, grid_axis_direction);
Alison Maher . unresolved

I think all of these can be calculated inside of running_positions based on what is already passed in there. Can we move the calculation for that there instead?

Line 434, Patchset 4 (Latest): if (running_positions.IsStackingAxisAlignmentPresent()) {
Alison Maher . unresolved

nit: instead of checking this here, we can move it to ApplyStackingAxisAlignment and have it return early if this is false (this way if another call site uses this, it will already be in place for both)

Line 517, Patchset 4 (Latest): for (const auto& item : grid_items) {
Alison Maher . unresolved

Instead of looping here, can we store maybe a member var for has_alignment_in_stacking_axis and compute this at another spot in the code we loop over items? IIRC we may do something similar for baselines as a reference

Line 542, Patchset 4 (Latest): Vector<AlignmentEntry> alignment_entries;
Alison Maher . unresolved

Maybe alignment_subjects

Line 543, Patchset 4 (Latest): for (auto& grid_lanes_item : grid_items) {
Alison Maher . unresolved

Do we need to do this for every grid item, or are we already keeping track of alignment candidates as we go, and can just loop through those?

Line 560, Patchset 4 (Latest): alignment_space, /*size=*/LayoutUnit(),
/*margin_start=*/LayoutUnit(), /*margin_end=*/LayoutUnit(),
/*baseline_offset=*/LayoutUnit(), stacking_axis_alignment,
Alison Maher . unresolved

Why are all of these 0?

Line 563, Patchset 4 (Latest): is_for_columns ? grid_lanes_item.IsOverflowSafe(kForRows)
Alison Maher . unresolved

Are there any tests for safe alignment? Does that apply in the stacking axis?

Line 573, Patchset 4 (Latest): if (!alignment_entries.empty()) {
Alison Maher . unresolved

If we inverted this check, could we early return?

```
if (alignment_entries.empty()) {
return;
}
...
```
Line 590, Patchset 4 (Latest): container_builder_.MoveChildrenInDirection(
Alison Maher . unresolved

Do we need to do this for stretch candidates?

Line 594, Patchset 4 (Latest): // TODO(celestepan): Adding stretch items to the container after laying out
// the rest of the items may affect paint order. Verify and fix if needed.
Alison Maher . unresolved

Yeah I think if we have to relayout, this would impact ordering of items. To avoid this, I think we need to add a way to run an extra layout pass that somehow ensures on the second pass, stretched items are aware that they need to stretch as they are being laid out.

Something we may want to run by Ian for ideas.

Technically if dense packing weren't a thing, we would be able to do this as we go (and not have to relayout) since we'd know alignment candidates as we go

Unless, like offsets, we can adjust the block size of the layout result after it has completed layout previously without rerunning layout (this would be the most ideal approach)

Line 596, Patchset 4 (Latest): if (!stacking_axis_stretch_items.empty()) {
Alison Maher . unresolved

If the comments I mentioned about having a way to keep track of alignment candidates and only loop through those above make sense, I wonder if there is a way to avoid this separate vector, and as we loop through those, have a way to tell which ones are stretched, and add those to a local vector to this method instead

Line 639, Patchset 4 (Latest): stretch_item.opt_fixed_inline_size);
Alison Maher . unresolved

Wondering if we can use this to handle fixed_available_size.inline_size = stretched_size;

And then have an opt_fixed_block_size as well for the other case

This way we don't need a base_space

Line 1015, Patchset 4 (Latest): const StyleSelfAlignmentData normal_value(ItemPosition::kNormal,
OverflowAlignment::kDefault);
Alison Maher . unresolved

What does this do?

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
Line 370, Patchset 4 (Latest): Vector<Vector<ItemAboveTrackOpening>> items_above_track_openings_;
Alison Maher . unresolved

Can this live on TrackOpening?

Line 364, Patchset 4 (Latest): // `[track_index][opening_index]`. Each entry stores the `GridItemData`
Alison Maher . unresolved

nit: similar to the comment for track_collection_openings_, I'd maybe spell this out more explicitly. If we do need to keep this separate from track_collection_openings_, I'd maybe place these next to each other instead

Line 361, Patchset 4 (Latest): bool stacking_axis_alignment_{false};
Alison Maher . unresolved

nit: is_stacking_axis_alignment_set_

Line 359, Patchset 4 (Latest): // When true, track openings are populated in `UpdateRunningPositionsForSpan`
// even without dense-packing, for stacking-axis alignment purposes.
Alison Maher . unresolved

nit: "When true, the last item in a track or the last item above a spanner can be aligned within empty space available in the track as a result. This means, similar to dense packing, we'll need to keep track of track openings as we place items."

Line 207, Patchset 4 (Latest): bool IsStackingAxisAlignmentPresent() const {
Alison Maher . unresolved

nit IsStackingAxisAlignmentSet

Line 130, Patchset 4 (Latest): GridItemData* placed_item = nullptr);
Alison Maher . unresolved

Should we just always pass in the grid item, and then we can maybe get the span from the item itself?

Line 130, Patchset 4 (Latest): GridItemData* placed_item = nullptr);
Alison Maher . unresolved

nit: `item`

Line 130, Patchset 4 (Latest): GridItemData* placed_item = nullptr);
Alison Maher . unresolved

Can this be const?

Line 122, Patchset 4 (Latest): // When `placed_item` is provided and stacking axis alignment is needed, the
Alison Maher . unresolved

nit: The stacking axis alignment stated for `placed_item` will be updated for each track it spans if applicable. This can happen if the item is above a newly formed opening from a spanning item or if the item is above the last unbounded opening in the track.

Line 79, Patchset 4 (Latest): CalculateAndCacheTrackSizes(track_collection);
Alison Maher . unresolved

Should we do this for stacking_axis_alignment_present as well?

Line 69, Patchset 4 (Latest): is_dense_packing_(style.IsGridLanesPackDense()),
Alison Maher . unresolved

I think stacking_axis_alignment_ should be set here based on stacking_axis_alignment_present

Line 58, Patchset 4 (Latest): bool stacking_axis_alignment_present = false)
Alison Maher . unresolved

nit: maybe is_stacking_axis_alignment_set

Line 58, Patchset 4 (Latest): bool stacking_axis_alignment_present = false)
Alison Maher . unresolved

Will we handle self alignment as well, or just content alignment in the stacking axis?

Line 37, Patchset 4 (Latest): UntracedMember<GridItemData> item = nullptr;
Alison Maher . unresolved

Since this only holds an item, I think we can just store the item directly rather than a new struct type. Also, as mentioned later, this could maybe just live on TrackOpening instead

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
Line 191, Patchset 4 (Latest): if (stacking_axis_alignment_ && placed_item) {
Alison Maher . unresolved

If `stacking_axis_alignment_` should `placed_item` always be passed in? If so, I'd move this to CHECK(placed_item) instead (same with other similar if-statements)

Line 199, Patchset 4 (Latest): if (stacking_axis_alignment_ && placed_item) {
Alison Maher . unresolved

nit: can you add a comment for this one?

Line 225, Patchset 4 (Latest): last_opening.start_position -= stacking_axis_gap;
Alison Maher . unresolved

Is this not needed for openings except the end?

Line 240, Patchset 4 (Latest): bool found = false;
Alison Maher . unresolved

nit: found_opening

Line 254, Patchset 4 (Latest): return min_opening_size == LayoutUnit::Max() ? LayoutUnit()
: min_opening_size;
Alison Maher . unresolved

Since we check for found above, do we need to check if it equals Max here? Or do we need the check for found above, and just rely on the check here for Max?

Open in Gerrit

Related details

Attention is currently required from:
  • Celeste Pan
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
    Gerrit-Change-Number: 7899886
    Gerrit-PatchSet: 4
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Fri, 05 Jun 2026 23:05:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Celeste Pan (Gerrit)

    unread,
    Jun 9, 2026, 4:47:14 PMJun 9
    to Alison Maher, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Alison Maher

    Celeste Pan added 40 comments

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.h
    Line 176, Patchset 4: GridLayoutData& layout_data,

    const Vector<StackingAxisStretchItem>& stacking_axis_stretch_items);
    Alison Maher . resolved

    Can these be const? If not, would be good to call them out in the method comment on how they are updated

    Celeste Pan

    Done

    Line 174, Patchset 4: LayoutUnit effective_stacking_axis_size,
    LayoutUnit stacking_axis_gap,
    Alison Maher . resolved

    reading this, it isn't immediately obvious to me the difference between these two, so would be worth calling out in the comment for the method. Can these be combined at all into one LayoutUnit or do they need to remain separate?

    Celeste Pan

    They represent 2 different things -- `effective_stacking_axis_size` is the size of the tacking axis, and `stacking_axis_gap` is the gap between items specified by the `gap` property. Will add a comment for this!

    Line 173, Patchset 4: GridTrackSizingDirection grid_axis_direction,
    Alison Maher . resolved

    Same comment here about not needing to pass this in

    Celeste Pan

    Done

    Line 171, Patchset 4: GridItems& grid_items,
    GridLanesRunningPositions& running_positions,
    Alison Maher . resolved

    Can these be const?

    Celeste Pan

    `grid_items` can be const, but `running_positions` can't be const because in `FinalizeTrackOpeningsForStackingAxisAlignment` we alter the track openings stored in the class.

    Line 165, Patchset 4: GridTrackSizingDirection grid_axis_direction);
    Alison Maher . resolved

    nit: since these are part of the algo, no need to pass them in to these methods since it is pretty cheap to recalc in the methods with `Style().GridLanesTrackSizingDirection();`

    Celeste Pan

    Done

    Line 147, Patchset 4: void RunGridLanesPlacementPhase(
    Alison Maher . resolved

    nit: can you add a note about the the new optional out param in the method comment?

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.cc
    Line 24, Patchset 4:struct StackingAxisStretchItem {
    Alison Maher . unresolved

    I'm wondering if this can live on running positions, same with the vector for them, that way we don't need to pass around a vector of these, and can access via running positions, which we are already passing around

    Celeste Pan

    I feel like since we're really only touching it during the placement algorithm and relayout, which all happens in the GridLanesLayoutAlgorithm methods, it might make more sense for it to live in this file, as opposed to running positions. Happy to discuss more offline!

    Line 36, Patchset 4:// placement via `MoveChildrenInDirection`.
    Alison Maher . resolved

    Since this is just used internally, could this be a Pair of <LayoutObject, LayoutUnit> below instead of a new struct?

    Celeste Pan

    I'd tried this before, there are GC restrictions, so we can't just use a plan pair.

    Line 187, Patchset 4: HasStackingAxisAlignment(style, *grid_items, grid_axis_direction);
    Alison Maher . unresolved

    I think all of these can be calculated inside of running_positions based on what is already passed in there. Can we move the calculation for that there instead?

    Celeste Pan

    I think it makes sense for style and grid_axis_direction, but I'm not sure it would make sense to store `grid_items`, or even a reference to `grid_items` just for this occasion. If you think it makes sense to have a `grid_items` pointer we could do that, I can add a TODO for it for a later change!

    Line 434, Patchset 4: if (running_positions.IsStackingAxisAlignmentPresent()) {
    Alison Maher . resolved

    nit: instead of checking this here, we can move it to ApplyStackingAxisAlignment and have it return early if this is false (this way if another call site uses this, it will already be in place for both)

    Celeste Pan

    Done

    Line 517, Patchset 4: for (const auto& item : grid_items) {
    Alison Maher . unresolved

    Instead of looping here, can we store maybe a member var for has_alignment_in_stacking_axis and compute this at another spot in the code we loop over items? IIRC we may do something similar for baselines as a reference

    Celeste Pan

    If you're thinking of `BuildSizingCollection`, since it's a const method, it would be a bit awkward to set a member variable, since it's invoked by a shared util method. The baselines variables that's set is a local variable.

    I do feel like keeping things contained in this O(n) loop is cleaner since I can't think of another alternative at the moment, but let me know if you feel otherwise!

    Line 542, Patchset 4: Vector<AlignmentEntry> alignment_entries;
    Alison Maher . resolved

    Maybe alignment_subjects

    Celeste Pan

    Done

    Line 543, Patchset 4: for (auto& grid_lanes_item : grid_items) {
    Alison Maher . unresolved

    Do we need to do this for every grid item, or are we already keeping track of alignment candidates as we go, and can just loop through those?

    Celeste Pan

    At the moment we're not keeping track of alignment candidates as we go, since alignment candidates are constantly changing as placement happens -- it's more efficient to do this O(n) loop here than to loop through an existing alignment candidates vector during placement and remove/replace as we go through placement.

    Line 560, Patchset 4: alignment_space, /*size=*/LayoutUnit(),
    /*margin_start=*/LayoutUnit(), /*margin_end=*/LayoutUnit(),
    /*baseline_offset=*/LayoutUnit(), stacking_axis_alignment,
    Alison Maher . resolved

    Why are all of these 0?

    Celeste Pan

    The "size" represents the size the item takes up, but since `alignment_space` already represents the exact amoutn of free space that we have, there is not size of the item that we need to subtract in `AlignmentOffset`.

    For the margins, we've already accounted for the margin sizes when creating the track opening, so we shouldn't be passing in values for those either.

    We're not doing baseline alignment in the stacking axis, so we shouldn't be passing in a `baseline_offset` here.

    Line 563, Patchset 4: is_for_columns ? grid_lanes_item.IsOverflowSafe(kForRows)
    Alison Maher . resolved

    Are there any tests for safe alignment? Does that apply in the stacking axis?

    Celeste Pan

    I'm not sure this is applicable in the stacking axis, since we only perform the alignment if there is free space -- if there's no free space, then we wouldn't be performing alignment anyways.

    I'll change the code to just pass in false!

    Line 573, Patchset 4: if (!alignment_entries.empty()) {
    Alison Maher . resolved

    If we inverted this check, could we early return?

    ```
    if (alignment_entries.empty()) {
    return;
    }
    ...
    ```
    Celeste Pan

    We shouldn't do an early return here because `stacking_axis_stretch_items` isn't a subset of `alignment_entries`, so we do have to handle those separately.

    Line 590, Patchset 4: container_builder_.MoveChildrenInDirection(
    Alison Maher . resolved

    Do we need to do this for stretch candidates?

    Celeste Pan

    No, since we're not moving them in a certain direction like we are for items that need start/end alignment, we're actually re-sizing them and re-laying them out.

    Line 594, Patchset 4: // TODO(celestepan): Adding stretch items to the container after laying out

    // the rest of the items may affect paint order. Verify and fix if needed.
    Alison Maher . unresolved

    Yeah I think if we have to relayout, this would impact ordering of items. To avoid this, I think we need to add a way to run an extra layout pass that somehow ensures on the second pass, stretched items are aware that they need to stretch as they are being laid out.

    Something we may want to run by Ian for ideas.

    Technically if dense packing weren't a thing, we would be able to do this as we go (and not have to relayout) since we'd know alignment candidates as we go

    Unless, like offsets, we can adjust the block size of the layout result after it has completed layout previously without rerunning layout (this would be the most ideal approach)

    Celeste Pan

    Okay, so I tried out a version where we don't defer the addition into the container builder, and we end up recording the child index of items that need stretch. Later on, we re-layout the items which need stretch, and then call `container_builder_.ReplaceChild` with the new fragment.

    Line 596, Patchset 4: if (!stacking_axis_stretch_items.empty()) {
    Alison Maher . unresolved

    If the comments I mentioned about having a way to keep track of alignment candidates and only loop through those above make sense, I wonder if there is a way to avoid this separate vector, and as we loop through those, have a way to tell which ones are stretched, and add those to a local vector to this method instead

    Celeste Pan

    Not sure if I'm fully understanding this, but I actually do prefer a separate vector for stretch items since we do separate work for this -- it feels clean to have that ``MoveChildrenInDirection on `alignment_entries` separately as well.

    Also, we need `child_layout_subtree` for stretching subgrid items, so that's more information we keep separately from the other alignment entries.

    Line 639, Patchset 4: stretch_item.opt_fixed_inline_size);
    Alison Maher . unresolved

    Wondering if we can use this to handle fixed_available_size.inline_size = stretched_size;

    And then have an opt_fixed_block_size as well for the other case

    This way we don't need a base_space

    Celeste Pan

    Could you clarify what you mean here? Right now `CreateConstraintSpaceForLayout` only supports `opt_fixed_inline_size`. For column grid-lanes, the stretched size is in the block direction, so we'd need to either add an `opt_fixed_block_size` parameter to `CreateConstraintSpaceForLayout`, or keep the current two-step approach (base_space + CreateConstraintSpace).

    I tried implementing an approach where we just use the track size for the grid-axis available size and the stretch size for the stacking axis available size, let me know if you think this approach is okay!

    Line 1015, Patchset 4: const StyleSelfAlignmentData normal_value(ItemPosition::kNormal,
    OverflowAlignment::kDefault);
    Alison Maher . resolved

    What does this do?

    Celeste Pan

    It's creating the value that ResolvedAlignSelf/ResolvedJustifySelf returns when the final resolved alignment is `normal` (i.e., neither the item nor the parent has set an explicit alignment).

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
    Line 370, Patchset 4: Vector<Vector<ItemAboveTrackOpening>> items_above_track_openings_;
    Alison Maher . resolved

    Can this live on TrackOpening?

    Celeste Pan

    Addressed with the other comments to have this live on TrackOpening.

    Line 364, Patchset 4: // `[track_index][opening_index]`. Each entry stores the `GridItemData`
    Alison Maher . resolved

    nit: similar to the comment for track_collection_openings_, I'd maybe spell this out more explicitly. If we do need to keep this separate from track_collection_openings_, I'd maybe place these next to each other instead

    Celeste Pan

    No longer relevant since we're having these live on TrackOpening!

    Line 361, Patchset 4: bool stacking_axis_alignment_{false};
    Alison Maher . resolved

    nit: is_stacking_axis_alignment_set_

    Celeste Pan

    Done

    Line 359, Patchset 4: // When true, track openings are populated in `UpdateRunningPositionsForSpan`

    // even without dense-packing, for stacking-axis alignment purposes.
    Alison Maher . resolved

    nit: "When true, the last item in a track or the last item above a spanner can be aligned within empty space available in the track as a result. This means, similar to dense packing, we'll need to keep track of track openings as we place items."

    Celeste Pan

    Done

    Line 207, Patchset 4: bool IsStackingAxisAlignmentPresent() const {
    Alison Maher . resolved

    nit IsStackingAxisAlignmentSet

    Celeste Pan

    Done

    Line 130, Patchset 4: GridItemData* placed_item = nullptr);
    Alison Maher . resolved

    Should we just always pass in the grid item, and then we can maybe get the span from the item itself?

    Celeste Pan

    Done

    Line 130, Patchset 4: GridItemData* placed_item = nullptr);
    Alison Maher . resolved

    Can this be const?

    Celeste Pan

    No, because the `item_above` we store can't be const since we have to change it as the item above the track opening changes, and we need to assign that to `placed_item` sometimes.

    Line 130, Patchset 4: GridItemData* placed_item = nullptr);
    Alison Maher . resolved

    nit: `item`

    Celeste Pan

    Done

    Line 122, Patchset 4: // When `placed_item` is provided and stacking axis alignment is needed, the
    Alison Maher . resolved

    nit: The stacking axis alignment stated for `placed_item` will be updated for each track it spans if applicable. This can happen if the item is above a newly formed opening from a spanning item or if the item is above the last unbounded opening in the track.

    Celeste Pan

    I'm not sure this comment is fully accurate since we're not tracking stacking axis alignment per track.

    Also, since we changed the parameters, this would change the comment as well. Let me know what you think about what I add for `grid_lanes_item`!

    Line 79, Patchset 4: CalculateAndCacheTrackSizes(track_collection);
    Alison Maher . resolved

    Should we do this for stacking_axis_alignment_present as well?

    Celeste Pan

    We don't actually need the track sizes for stacking axis alignment, since we're not deciding the placement of any items!

    Line 69, Patchset 4: is_dense_packing_(style.IsGridLanesPackDense()),
    Alison Maher . resolved

    I think stacking_axis_alignment_ should be set here based on stacking_axis_alignment_present

    Celeste Pan

    Done

    Line 58, Patchset 4: bool stacking_axis_alignment_present = false)
    Alison Maher . resolved

    Will we handle self alignment as well, or just content alignment in the stacking axis?

    Celeste Pan

    It's accounting for self-alignment as well!

    Line 58, Patchset 4: bool stacking_axis_alignment_present = false)
    Alison Maher . resolved

    nit: maybe is_stacking_axis_alignment_set

    Celeste Pan

    Done

    Line 37, Patchset 4: UntracedMember<GridItemData> item = nullptr;
    Alison Maher . resolved

    Since this only holds an item, I think we can just store the item directly rather than a new struct type. Also, as mentioned later, this could maybe just live on TrackOpening instead

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
    Line 191, Patchset 4: if (stacking_axis_alignment_ && placed_item) {
    Alison Maher . resolved

    If `stacking_axis_alignment_` should `placed_item` always be passed in? If so, I'd move this to CHECK(placed_item) instead (same with other similar if-statements)

    Celeste Pan

    since it's not optional anymore going to resolve this comment!

    Line 199, Patchset 4: if (stacking_axis_alignment_ && placed_item) {
    Alison Maher . resolved

    nit: can you add a comment for this one?

    Celeste Pan

    Done

    Line 225, Patchset 4: last_opening.start_position -= stacking_axis_gap;
    Alison Maher . resolved

    Is this not needed for openings except the end?

    Celeste Pan

    yup, since for the other openings we do still want to account for gap between items!

    Line 240, Patchset 4: bool found = false;
    Alison Maher . resolved

    nit: found_opening

    Celeste Pan

    Done

    Line 254, Patchset 4: return min_opening_size == LayoutUnit::Max() ? LayoutUnit()
    : min_opening_size;
    Alison Maher . resolved

    Since we check for found above, do we need to check if it equals Max here? Or do we need the check for found above, and just rely on the check here for Max?

    Celeste Pan

    Replaced with just returning min_opening_size -- we still want `found_opening` above since otherwise we would return a min opening that is the max size.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
    Gerrit-Change-Number: 7899886
    Gerrit-PatchSet: 5
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Comment-Date: Tue, 09 Jun 2026 20:47:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alison Maher <alm...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    Jun 10, 2026, 7:01:25 PMJun 10
    to Celeste Pan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan

    Alison Maher added 21 comments

    Commit Message
    Line 1, Patchset 5 (Latest):Parent: e863db91 (Printing: Check for inactive RFHs when handling more printing requests)
    Alison Maher . unresolved

    I can't remember - do we already have tests for alignment + fill-reverse/track-reverse?

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.h
    Line 169, Patchset 5 (Latest): // offsets, and relayouts stretch items with their stretched size.
    Alison Maher . unresolved

    nit: "items that are stretch aligned"

    Line 158, Patchset 5 (Latest): Vector<StackingAxisStretchItem>* stacking_axis_stretch_items = nullptr);
    Alison Maher . unresolved

    nit: maybe instead items_to_stretch_in_stacking_axis (it's a bit more verbose, but slightly easier to read

    Line 147, Patchset 5 (Latest): // items that have stretch alignment in the stacking axis.
    Alison Maher . unresolved

    "will need to be stretched in the stacking axis"

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.cc
    Line 24, Patchset 4:struct StackingAxisStretchItem {
    Alison Maher . unresolved

    I'm wondering if this can live on running positions, same with the vector for them, that way we don't need to pass around a vector of these, and can access via running positions, which we are already passing around

    Celeste Pan

    I feel like since we're really only touching it during the placement algorithm and relayout, which all happens in the GridLanesLayoutAlgorithm methods, it might make more sense for it to live in this file, as opposed to running positions. Happy to discuss more offline!

    Alison Maher

    Was thinking that the grid layout algo could call into running positions to get those items, though. But more than happy to discuss offline. I might be missing something

    Line 27, Patchset 5 (Latest): UntracedMember<GridItemData> item;
    Alison Maher . unresolved

    Chatted with Kurt, and he said we can probably just make this a raw ptr instead.

    https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/heap/BlinkGCAPIReference.md#STACK_ALLOCATED

    If the struct is on the stack, it can use STACK_ALLOCATED and refer to GC'd objects as raw pointers
    Line 30, Patchset 5 (Latest): UntracedMember<GridLayoutSubtree> child_layout_subtree;
    Alison Maher . unresolved

    Same here

    Line 36, Patchset 4:// placement via `MoveChildrenInDirection`.
    Alison Maher . unresolved

    Since this is just used internally, could this be a Pair of <LayoutObject, LayoutUnit> below instead of a new struct?

    Celeste Pan

    I'd tried this before, there are GC restrictions, so we can't just use a plan pair.

    Alison Maher

    If you used raw ptr for the LayoutObject in the pair does that work?

    Line 187, Patchset 4: HasStackingAxisAlignment(style, *grid_items, grid_axis_direction);
    Alison Maher . resolved

    I think all of these can be calculated inside of running_positions based on what is already passed in there. Can we move the calculation for that there instead?

    Celeste Pan

    I think it makes sense for style and grid_axis_direction, but I'm not sure it would make sense to store `grid_items`, or even a reference to `grid_items` just for this occasion. If you think it makes sense to have a `grid_items` pointer we could do that, I can add a TODO for it for a later change!

    Alison Maher

    Ah for some reason I was thinking we already were passing in the items. Makes sense, thanks!

    Line 517, Patchset 4: for (const auto& item : grid_items) {
    Alison Maher . unresolved

    Instead of looping here, can we store maybe a member var for has_alignment_in_stacking_axis and compute this at another spot in the code we loop over items? IIRC we may do something similar for baselines as a reference

    Celeste Pan

    If you're thinking of `BuildSizingCollection`, since it's a const method, it would be a bit awkward to set a member variable, since it's invoked by a shared util method. The baselines variables that's set is a local variable.

    I do feel like keeping things contained in this O(n) loop is cleaner since I can't think of another alternative at the moment, but let me know if you feel otherwise!

    Alison Maher

    Another alternative would be to have an out param for this information

    Line 543, Patchset 4: for (auto& grid_lanes_item : grid_items) {
    Alison Maher . unresolved

    Do we need to do this for every grid item, or are we already keeping track of alignment candidates as we go, and can just loop through those?

    Celeste Pan

    At the moment we're not keeping track of alignment candidates as we go, since alignment candidates are constantly changing as placement happens -- it's more efficient to do this O(n) loop here than to loop through an existing alignment candidates vector during placement and remove/replace as we go through placement.

    Alison Maher

    Hmm let's maybe chat on this offline since I think we could improve this a bit based on how we end up storing this information inside of running positions

    Line 560, Patchset 4: alignment_space, /*size=*/LayoutUnit(),
    /*margin_start=*/LayoutUnit(), /*margin_end=*/LayoutUnit(),
    /*baseline_offset=*/LayoutUnit(), stacking_axis_alignment,
    Alison Maher . unresolved

    Why are all of these 0?

    Celeste Pan

    The "size" represents the size the item takes up, but since `alignment_space` already represents the exact amoutn of free space that we have, there is not size of the item that we need to subtract in `AlignmentOffset`.

    For the margins, we've already accounted for the margin sizes when creating the track opening, so we shouldn't be passing in values for those either.

    We're not doing baseline alignment in the stacking axis, so we shouldn't be passing in a `baseline_offset` here.

    Alison Maher

    Ok thanks - I think a comment here with the context could be useful

    Line 563, Patchset 4: is_for_columns ? grid_lanes_item.IsOverflowSafe(kForRows)
    Alison Maher . unresolved

    Are there any tests for safe alignment? Does that apply in the stacking axis?

    Celeste Pan

    I'm not sure this is applicable in the stacking axis, since we only perform the alignment if there is free space -- if there's no free space, then we wouldn't be performing alignment anyways.

    I'll change the code to just pass in false!

    Alison Maher

    So safe alignment is about what happens when you overflow the container (IIRC). We can technically overflow the container in the stacking axis, if for example, it is explicitly sized too small. I wonder if we do need support for that?

    Line 573, Patchset 4: if (!alignment_entries.empty()) {
    Alison Maher . unresolved

    If we inverted this check, could we early return?

    ```
    if (alignment_entries.empty()) {
    return;
    }
    ...
    ```
    Celeste Pan

    We shouldn't do an early return here because `stacking_axis_stretch_items` isn't a subset of `alignment_entries`, so we do have to handle those separately.

    Alison Maher

    Why aren't those a subset? I would have thought if it stretches, it is also an alignment subject. Perhaps a comment or a change in the name of the var would help clarify that

    Line 590, Patchset 4: container_builder_.MoveChildrenInDirection(
    Alison Maher . resolved

    Do we need to do this for stretch candidates?

    Celeste Pan

    No, since we're not moving them in a certain direction like we are for items that need start/end alignment, we're actually re-sizing them and re-laying them out.

    Alison Maher

    Yeah this question came out of the fact I assumed alignment_subjects included stretched items

    Line 596, Patchset 4: if (!stacking_axis_stretch_items.empty()) {
    Alison Maher . unresolved

    If the comments I mentioned about having a way to keep track of alignment candidates and only loop through those above make sense, I wonder if there is a way to avoid this separate vector, and as we loop through those, have a way to tell which ones are stretched, and add those to a local vector to this method instead

    Celeste Pan

    Not sure if I'm fully understanding this, but I actually do prefer a separate vector for stretch items since we do separate work for this -- it feels clean to have that ``MoveChildrenInDirection on `alignment_entries` separately as well.

    Also, we need `child_layout_subtree` for stretching subgrid items, so that's more information we keep separately from the other alignment entries.

    Alison Maher

    I find tracking these separately to be somewhat difficult to follow. Even if we need to track extra inforamation for stretch, that information can be optional, and if set, we know they are stretch candidates

    Also the mention of subgrids gets me wondering - if a subgrid stretches, do we need to re-run layout in case that resize in the standalone axis could impact track sizing of subgridded items in the grid axis. May be worth a TODO for that (and something I may want to run by Ian to double check)

    Line 611, Patchset 5 (Latest): const auto& fragment = To<PhysicalBoxFragment>(
    *container_builder_.Children()[stretch_item.child_index].fragment);
    const LogicalBoxFragment original_fragment(
    GetConstraintSpace().GetWritingDirection(), fragment);
    const LayoutUnit original_stacking_size =
    is_for_columns ? original_fragment.BlockSize()
    : original_fragment.InlineSize();
    const LayoutUnit stretched_size = original_stacking_size + alignment_space;

    // Build the containing size using the item's original grid-axis size
    // and the stretched stacking-axis size.
    const LogicalSize containing_size =
    is_for_columns
    ? LogicalSize(original_fragment.InlineSize(), stretched_size)
    : LogicalSize(stretched_size, original_fragment.BlockSize());
    const ConstraintSpace stretched_space = CreateConstraintSpace(
    *stretch_item.item, containing_size,
    /*fixed_available_size=*/containing_size,
    LayoutResultCacheSlot::kLayout, stretch_item.child_layout_subtree);
    Alison Maher . unresolved

    Can we create a new CreateConstraintSpaceForStretch or something along the lines that handles this logic for us?

    Line 639, Patchset 4: stretch_item.opt_fixed_inline_size);
    Alison Maher . resolved

    Wondering if we can use this to handle fixed_available_size.inline_size = stretched_size;

    And then have an opt_fixed_block_size as well for the other case

    This way we don't need a base_space

    Celeste Pan

    Could you clarify what you mean here? Right now `CreateConstraintSpaceForLayout` only supports `opt_fixed_inline_size`. For column grid-lanes, the stretched size is in the block direction, so we'd need to either add an `opt_fixed_block_size` parameter to `CreateConstraintSpaceForLayout`, or keep the current two-step approach (base_space + CreateConstraintSpace).

    I tried implementing an approach where we just use the track size for the grid-axis available size and the stretch size for the stacking axis available size, let me know if you think this approach is okay!

    Alison Maher

    Yeah I meant to add opt_fixed_block_size, and then use each of those in their respective cases to handle this instead

    But updates make sense, thanks!

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
    Line 339, Patchset 5 (Latest): // When true, the last item in a track or the last item above a spanner can be
    // aligned within empty space available in the track as a result. This means,
    // similar to dense packing, we'll need to keep track of track openings as we
    // place items.
    Alison Maher . unresolved

    Should we note that this is true if any item is self aligned to be stretched or if the container has this set for all items?

    Line 46, Patchset 5 (Latest): UntracedMember<GridItemData> item_above = nullptr;
    Alison Maher . unresolved

    Can this be a raw ptr instead (similar to other comments)

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
    Line 225, Patchset 4: last_opening.start_position -= stacking_axis_gap;
    Alison Maher . unresolved

    Is this not needed for openings except the end?

    Celeste Pan

    yup, since for the other openings we do still want to account for gap between items!

    Alison Maher

    Sounds good, might be worth a comment for extra context

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Celeste Pan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
    Gerrit-Change-Number: 7899886
    Gerrit-PatchSet: 5
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Wed, 10 Jun 2026 23:01:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Celeste Pan <celes...@microsoft.com>
    Comment-In-Reply-To: Alison Maher <alm...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Celeste Pan (Gerrit)

    unread,
    Jun 15, 2026, 4:04:41 PMJun 15
    to Alison Maher, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Alison Maher

    Celeste Pan added 19 comments

    Commit Message
    Line 1, Patchset 5:Parent: e863db91 (Printing: Check for inactive RFHs when handling more printing requests)
    Alison Maher . unresolved

    I can't remember - do we already have tests for alignment + fill-reverse/track-reverse?

    Celeste Pan

    Not for align-items -- I just tested it and it only works correctly for track reverse (we need to account for fill-reverse in our math for moving the items).

    I do think that a spec issue needs to be raised for this -- in the case that we have `align-items: start` for columns, is the "start" where the fill-reverse is, or the start of the container?

    I think this should be in a separate CL so we don't add too much to this current one. I'll add a TODO and file an issue for what I mentioned above!

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.h
    Line 169, Patchset 5: // offsets, and relayouts stretch items with their stretched size.
    Alison Maher . resolved

    nit: "items that are stretch aligned"

    Celeste Pan

    Done

    Line 158, Patchset 5: Vector<StackingAxisStretchItem>* stacking_axis_stretch_items = nullptr);
    Alison Maher . resolved

    nit: maybe instead items_to_stretch_in_stacking_axis (it's a bit more verbose, but slightly easier to read

    Celeste Pan

    Done

    Line 147, Patchset 5: // items that have stretch alignment in the stacking axis.
    Alison Maher . resolved

    "will need to be stretched in the stacking axis"

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.cc
    Line 24, Patchset 4:struct StackingAxisStretchItem {
    Alison Maher . resolved

    I'm wondering if this can live on running positions, same with the vector for them, that way we don't need to pass around a vector of these, and can access via running positions, which we are already passing around

    Celeste Pan

    I feel like since we're really only touching it during the placement algorithm and relayout, which all happens in the GridLanesLayoutAlgorithm methods, it might make more sense for it to live in this file, as opposed to running positions. Happy to discuss more offline!

    Alison Maher

    Was thinking that the grid layout algo could call into running positions to get those items, though. But more than happy to discuss offline. I might be missing something

    Celeste Pan

    Spoke offline -- we end up storing the alignment information in `TrackOpening`, and then we return the items above the openings in the `GetStackingAxisAlignmentCandidates` method, and then work with those in the `GridLanesLayoutAlgorithm`.

    Line 27, Patchset 5: UntracedMember<GridItemData> item;
    Alison Maher . resolved

    Chatted with Kurt, and he said we can probably just make this a raw ptr instead.

    https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/heap/BlinkGCAPIReference.md#STACK_ALLOCATED

    If the struct is on the stack, it can use STACK_ALLOCATED and refer to GC'd objects as raw pointers
    Celeste Pan

    Spoke offline with Ian, we should use the pattern of `HeapVector` and `Member`. This does require a `Trace` method and `WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS`.

    Line 30, Patchset 5: UntracedMember<GridLayoutSubtree> child_layout_subtree;
    Alison Maher . resolved

    Same here

    Celeste Pan

    Used HeapVector with Member.

    Line 36, Patchset 4:// placement via `MoveChildrenInDirection`.
    Alison Maher . resolved

    Since this is just used internally, could this be a Pair of <LayoutObject, LayoutUnit> below instead of a new struct?

    Celeste Pan

    I'd tried this before, there are GC restrictions, so we can't just use a plan pair.

    Alison Maher

    If you used raw ptr for the LayoutObject in the pair does that work?

    Celeste Pan

    Used HeapVector with Member.

    Line 517, Patchset 4: for (const auto& item : grid_items) {
    Alison Maher . unresolved

    Instead of looping here, can we store maybe a member var for has_alignment_in_stacking_axis and compute this at another spot in the code we loop over items? IIRC we may do something similar for baselines as a reference

    Celeste Pan

    If you're thinking of `BuildSizingCollection`, since it's a const method, it would be a bit awkward to set a member variable, since it's invoked by a shared util method. The baselines variables that's set is a local variable.

    I do feel like keeping things contained in this O(n) loop is cleaner since I can't think of another alternative at the moment, but let me know if you feel otherwise!

    Alison Maher

    Another alternative would be to have an out param for this information

    Celeste Pan

    That had been one of my thoughts, but since `BuildSizingCollection` is called by `BuildGridSizingTree`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/grid/grid_layout_utils.cc;l=644;drc=d635c024a266e5abb2e1b8a68fe6a4fa7f7c5755;bpv=1;bpt=1,

    which is a method used by both grid and grid lanes in grid_layout_utils.cc, it felt a bit awkward to add a grid-lanes specific parameter to all the methods leading up to `BuildSizingCollection`. I might be missing something here, so happy to talk about this offline as well.

    I moved the calculation to `ConstructGridItems` instead and performed the check there when we're iterating through the items, so it would avoid an extra iteration! Let me know if you have feedback on this.

    Line 543, Patchset 4: for (auto& grid_lanes_item : grid_items) {
    Alison Maher . resolved

    Do we need to do this for every grid item, or are we already keeping track of alignment candidates as we go, and can just loop through those?

    Celeste Pan

    At the moment we're not keeping track of alignment candidates as we go, since alignment candidates are constantly changing as placement happens -- it's more efficient to do this O(n) loop here than to loop through an existing alignment candidates vector during placement and remove/replace as we go through placement.

    Alison Maher

    Hmm let's maybe chat on this offline since I think we could improve this a bit based on how we end up storing this information inside of running positions

    Celeste Pan

    Okay, actually I realized that we could just iterate through the items above track openings held in GridLanesRunningPositions, and populate `alignment_subjects` with those. Since we have reference to the actual items, then it's not a problem for to check their alignment with that.

    I added that as the implementation, but let's still talk more about how we might be able to improve it!

    Edit: spoke offline, this is fine. Done!

    Line 560, Patchset 4: alignment_space, /*size=*/LayoutUnit(),
    /*margin_start=*/LayoutUnit(), /*margin_end=*/LayoutUnit(),
    /*baseline_offset=*/LayoutUnit(), stacking_axis_alignment,
    Alison Maher . resolved

    Why are all of these 0?

    Celeste Pan

    The "size" represents the size the item takes up, but since `alignment_space` already represents the exact amoutn of free space that we have, there is not size of the item that we need to subtract in `AlignmentOffset`.

    For the margins, we've already accounted for the margin sizes when creating the track opening, so we shouldn't be passing in values for those either.

    We're not doing baseline alignment in the stacking axis, so we shouldn't be passing in a `baseline_offset` here.

    Alison Maher

    Ok thanks - I think a comment here with the context could be useful

    Celeste Pan

    Done

    Line 563, Patchset 4: is_for_columns ? grid_lanes_item.IsOverflowSafe(kForRows)
    Alison Maher . resolved

    Are there any tests for safe alignment? Does that apply in the stacking axis?

    Celeste Pan

    I'm not sure this is applicable in the stacking axis, since we only perform the alignment if there is free space -- if there's no free space, then we wouldn't be performing alignment anyways.

    I'll change the code to just pass in false!

    Alison Maher

    So safe alignment is about what happens when you overflow the container (IIRC). We can technically overflow the container in the stacking axis, if for example, it is explicitly sized too small. I wonder if we do need support for that?

    Celeste Pan

    Spoke offline, but will clarify here: if there's no space for alignment of the last item in each track, then we wouldn't move the item at all.

    And then for items in track openings, it's fine to align them because there are already items below it, so it's not as though aligning the item within the opening is causing the overflow.

    Added tests for safe alignment though, to make sure that the behavior IS the same as regular alignment!

    Line 573, Patchset 4: if (!alignment_entries.empty()) {
    Alison Maher . resolved

    If we inverted this check, could we early return?

    ```
    if (alignment_entries.empty()) {
    return;
    }
    ...
    ```
    Celeste Pan

    We shouldn't do an early return here because `stacking_axis_stretch_items` isn't a subset of `alignment_entries`, so we do have to handle those separately.

    Alison Maher

    Why aren't those a subset? I would have thought if it stretches, it is also an alignment subject. Perhaps a comment or a change in the name of the var would help clarify that

    Celeste Pan

    Technically `alignment_entries` are only center and end alignment (since start doesn't need anything). We handle this separately from stretch items.

    Just renamed to `items_to_offset_in_stacking_axis`!

    Line 594, Patchset 4: // TODO(celestepan): Adding stretch items to the container after laying out
    // the rest of the items may affect paint order. Verify and fix if needed.
    Alison Maher . resolved

    Yeah I think if we have to relayout, this would impact ordering of items. To avoid this, I think we need to add a way to run an extra layout pass that somehow ensures on the second pass, stretched items are aware that they need to stretch as they are being laid out.

    Something we may want to run by Ian for ideas.

    Technically if dense packing weren't a thing, we would be able to do this as we go (and not have to relayout) since we'd know alignment candidates as we go

    Unless, like offsets, we can adjust the block size of the layout result after it has completed layout previously without rerunning layout (this would be the most ideal approach)

    Celeste Pan

    Okay, so I tried out a version where we don't defer the addition into the container builder, and we end up recording the child index of items that need stretch. Later on, we re-layout the items which need stretch, and then call `container_builder_.ReplaceChild` with the new fragment.

    Celeste Pan

    Done

    Line 596, Patchset 4: if (!stacking_axis_stretch_items.empty()) {
    Alison Maher . resolved

    If the comments I mentioned about having a way to keep track of alignment candidates and only loop through those above make sense, I wonder if there is a way to avoid this separate vector, and as we loop through those, have a way to tell which ones are stretched, and add those to a local vector to this method instead

    Celeste Pan

    Not sure if I'm fully understanding this, but I actually do prefer a separate vector for stretch items since we do separate work for this -- it feels clean to have that ``MoveChildrenInDirection on `alignment_entries` separately as well.

    Also, we need `child_layout_subtree` for stretching subgrid items, so that's more information we keep separately from the other alignment entries.

    Alison Maher

    I find tracking these separately to be somewhat difficult to follow. Even if we need to track extra inforamation for stretch, that information can be optional, and if set, we know they are stretch candidates

    Also the mention of subgrids gets me wondering - if a subgrid stretches, do we need to re-run layout in case that resize in the standalone axis could impact track sizing of subgridded items in the grid axis. May be worth a TODO for that (and something I may want to run by Ian to double check)

    Celeste Pan

    Spoke offline -- added a comment for why a simple re-layout is fine for now, as the case where the subgrid might end up resizing the stacking axis would cause a circularity (ie, we change the stacking axis size, the subgrid might be placed in a different location then, which means it might not even be a stretch item anymore, etc0.

    Line 611, Patchset 5: const auto& fragment = To<PhysicalBoxFragment>(

    *container_builder_.Children()[stretch_item.child_index].fragment);
    const LogicalBoxFragment original_fragment(
    GetConstraintSpace().GetWritingDirection(), fragment);
    const LayoutUnit original_stacking_size =
    is_for_columns ? original_fragment.BlockSize()
    : original_fragment.InlineSize();
    const LayoutUnit stretched_size = original_stacking_size + alignment_space;

    // Build the containing size using the item's original grid-axis size
    // and the stretched stacking-axis size.
    const LogicalSize containing_size =
    is_for_columns
    ? LogicalSize(original_fragment.InlineSize(), stretched_size)
    : LogicalSize(stretched_size, original_fragment.BlockSize());
    const ConstraintSpace stretched_space = CreateConstraintSpace(
    *stretch_item.item, containing_size,
    /*fixed_available_size=*/containing_size,
    LayoutResultCacheSlot::kLayout, stretch_item.child_layout_subtree);
    Alison Maher . resolved

    Can we create a new CreateConstraintSpaceForStretch or something along the lines that handles this logic for us?

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
    Line 339, Patchset 5: // When true, the last item in a track or the last item above a spanner can be

    // aligned within empty space available in the track as a result. This means,
    // similar to dense packing, we'll need to keep track of track openings as we
    // place items.
    Alison Maher . resolved

    Should we note that this is true if any item is self aligned to be stretched or if the container has this set for all items?

    Celeste Pan

    Done

    Line 46, Patchset 5: UntracedMember<GridItemData> item_above = nullptr;
    Alison Maher . resolved

    Can this be a raw ptr instead (similar to other comments)

    Celeste Pan

    We ended up using HeapVector + Member pattern!

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
    Line 225, Patchset 4: last_opening.start_position -= stacking_axis_gap;
    Alison Maher . resolved

    Is this not needed for openings except the end?

    Celeste Pan

    yup, since for the other openings we do still want to account for gap between items!

    Alison Maher

    Sounds good, might be worth a comment for extra context

    Celeste Pan

    This is in the header file comment -- let me know if you'd prefer for me to move it into this file!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
    Gerrit-Change-Number: 7899886
    Gerrit-PatchSet: 10
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Comment-Date: Mon, 15 Jun 2026 20:04:28 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    Jun 16, 2026, 12:00:10 PMJun 16
    to Celeste Pan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan

    Alison Maher added 19 comments

    Commit Message
    Line 1, Patchset 5:Parent: e863db91 (Printing: Check for inactive RFHs when handling more printing requests)
    Alison Maher . resolved

    I can't remember - do we already have tests for alignment + fill-reverse/track-reverse?

    Celeste Pan

    Not for align-items -- I just tested it and it only works correctly for track reverse (we need to account for fill-reverse in our math for moving the items).

    I do think that a spec issue needs to be raised for this -- in the case that we have `align-items: start` for columns, is the "start" where the fill-reverse is, or the start of the container?

    I think this should be in a separate CL so we don't add too much to this current one. I'll add a TODO and file an issue for what I mentioned above!

    Alison Maher

    Acknowledged

    File third_party/blink/renderer/core/layout/grid/grid_item.h
    Line 555, Patchset 10 (Latest): // Computed during item construction in grid-lanes.
    Alison Maher . unresolved

    nit: no need to say when this computes, but it could say something like "this only applies to layout modes that has a stacking axis, like grid lanes."

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.cc
    Line 505, Patchset 10 (Latest): // We currently don't account for the case where the stretched item is a
    Alison Maher . unresolved

    nit: Can you add TODO(layout-dev): at the begininning? I won't add a tracking item for it since this is something we aren't planning to fix (at least not now), but this would just help it stand out as something that is technically missing or incorrect

    Line 517, Patchset 4: for (const auto& item : grid_items) {
    Alison Maher . resolved

    Instead of looping here, can we store maybe a member var for has_alignment_in_stacking_axis and compute this at another spot in the code we loop over items? IIRC we may do something similar for baselines as a reference

    Celeste Pan

    If you're thinking of `BuildSizingCollection`, since it's a const method, it would be a bit awkward to set a member variable, since it's invoked by a shared util method. The baselines variables that's set is a local variable.

    I do feel like keeping things contained in this O(n) loop is cleaner since I can't think of another alternative at the moment, but let me know if you feel otherwise!

    Alison Maher

    Another alternative would be to have an out param for this information

    Celeste Pan

    That had been one of my thoughts, but since `BuildSizingCollection` is called by `BuildGridSizingTree`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/grid/grid_layout_utils.cc;l=644;drc=d635c024a266e5abb2e1b8a68fe6a4fa7f7c5755;bpv=1;bpt=1,

    which is a method used by both grid and grid lanes in grid_layout_utils.cc, it felt a bit awkward to add a grid-lanes specific parameter to all the methods leading up to `BuildSizingCollection`. I might be missing something here, so happy to talk about this offline as well.

    I moved the calculation to `ConstructGridItems` instead and performed the check there when we're iterating through the items, so it would avoid an extra iteration! Let me know if you have feedback on this.

    Alison Maher

    This solution makes sense to me, thanks!

    Line 528, Patchset 10 (Latest): const LayoutUnit offset = AlignmentOffset(
    Alison Maher . unresolved

    nit: alignment_offset_adjustment

    Line 896, Patchset 10 (Latest): static_cast<wtf_size_t>(container_builder_.Children().size()),
    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
    Line 252, Patchset 10 (Latest): LayoutUnit GetAlignmentSpaceForItem(const GridItemData* item,
    Alison Maher . unresolved

    nit: GetAvailableAlignmentSpaceForItem

    Line 240, Patchset 10 (Latest): // Returns the unique above track openings that have positive alignment space
    // below them, along with each item's alignment space.
    Alison Maher . unresolved

    all of the last items that are above a track opening that should be considered for stacking axis alignment. (A link to the spec here could be useful, as well)

    Line 126, Patchset 10 (Latest): // non-null for subgrids). Both are used for adjustments for alignment in the
    // stacking axis after placement.
    Alison Maher . unresolved

    nit: no need to say how they are used

    Line 124, Patchset 10 (Latest): // `child_index` is the index of the item's fragment in the container
    Alison Maher . unresolved

    nit: item_index

    Line 71, Patchset 10 (Latest): AlignmentCandidate item_above;
    Alison Maher . unresolved

    nit: alignment_candidate

    Line 70, Patchset 10 (Latest): // axis
    Alison Maher . unresolved

    nit: missing punctuation

    Line 47, Patchset 10 (Latest): LayoutUnit alignment_space;
    Alison Maher . unresolved

    nit: Maybe "available_alignment_space"

    Line 46, Patchset 10 (Latest): Member<GridLayoutSubtree> child_layout_subtree;
    Alison Maher . unresolved

    Same comment about this one being prefixed with "child".

    Also might be worth a note that this is needed for stretch aligned items only as they will need to be relaid out once we know the final alignment candidate for a give track opening

    Line 45, Patchset 10 (Latest): wtf_size_t child_index{kNotFound};
    Alison Maher . unresolved

    This naming makes me think it is the child index in item. Maybe item_index

    Line 32, Patchset 10 (Latest): // Stored on the track opening above which the item sits.
    Alison Maher . unresolved

    nit: no need to say where it is stored

    Line 31, Patchset 10 (Latest): // Holds per-item data needed for stacking-axis alignment adjustment.
    Alison Maher . unresolved

    nit: A link to the spec in this comment might be useful for future readers

    https://drafts.csswg.org/css-grid-3/#stacking-self-alignment

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
    Line 250, Patchset 10 (Latest): bool found_opening = false;
    Alison Maher . unresolved

    nit: found_consecutive_opening

    Line 266, Patchset 10 (Latest):HeapVector<GridLanesRunningPositions::AlignmentCandidate>
    GridLanesRunningPositions::GetStackingAxisAlignmentCandidates() const {
    DCHECK(is_stacking_axis_alignment_set_);

    // References to multi-span items may appear multiple times across various
    // track openings, so we use `seen_items` to ensure that we only return one
    // alignment candidate per item.
    HashSet<const void*> seen_items;
    HeapVector<AlignmentCandidate> candidates;

    for (const auto& track_openings : track_collection_openings_) {
    for (const auto& opening : track_openings) {
    if (!opening.item_above.IsValid() ||
    !seen_items.insert(opening.item_above.item.Get()).is_new_entry) {
    continue;
    }

    const LayoutUnit alignment_space = GetAlignmentSpaceForItem(
    opening.item_above.item,
    opening.item_above.item->resolved_position.Span(
    grid_axis_direction_));
    if (alignment_space > LayoutUnit()) {
    AlignmentCandidate candidate = opening.item_above;
    candidate.alignment_space = alignment_space;
    candidates.push_back(candidate);
    }
    }
    }

    return candidates;
    }
    Alison Maher . unresolved

    Can we create an iterator of alignment candidates instead? This way, we don't have to loop to find them, and then loop to apply alignment to them (and can just do that all in the same loop)?

    Also, how do we handle spanners that may have different alignment space in different tracks, or even may span a track that it doesn't have any alignment space at all?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Celeste Pan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
    Gerrit-Change-Number: 7899886
    Gerrit-PatchSet: 10
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Tue, 16 Jun 2026 15:59:59 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Celeste Pan (Gerrit)

    unread,
    Jun 16, 2026, 6:38:24 PMJun 16
    to kokoro, Alison Maher, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Alison Maher

    Celeste Pan added 17 comments

    File third_party/blink/renderer/core/layout/grid/grid_item.h
    Line 555, Patchset 10: // Computed during item construction in grid-lanes.
    Alison Maher . resolved

    nit: no need to say when this computes, but it could say something like "this only applies to layout modes that has a stacking axis, like grid lanes."

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.cc
    Line 505, Patchset 10: // We currently don't account for the case where the stretched item is a
    Alison Maher . resolved

    nit: Can you add TODO(layout-dev): at the begininning? I won't add a tracking item for it since this is something we aren't planning to fix (at least not now), but this would just help it stand out as something that is technically missing or incorrect

    Celeste Pan

    Done

    Line 528, Patchset 10: const LayoutUnit offset = AlignmentOffset(
    Alison Maher . resolved

    nit: alignment_offset_adjustment

    Celeste Pan

    Done

    Line 896, Patchset 10: static_cast<wtf_size_t>(container_builder_.Children().size()),
    Alison Maher . resolved
    Celeste Pan

    My bad, I had thought it returned a size_t! Just removed.

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
    Line 252, Patchset 10: LayoutUnit GetAlignmentSpaceForItem(const GridItemData* item,
    Alison Maher . resolved

    nit: GetAvailableAlignmentSpaceForItem

    Celeste Pan

    Done

    Line 240, Patchset 10: // Returns the unique above track openings that have positive alignment space

    // below them, along with each item's alignment space.
    Alison Maher . resolved

    all of the last items that are above a track opening that should be considered for stacking axis alignment. (A link to the spec here could be useful, as well)

    Celeste Pan

    Done!

    Line 126, Patchset 10: // non-null for subgrids). Both are used for adjustments for alignment in the

    // stacking axis after placement.
    Alison Maher . resolved

    nit: no need to say how they are used

    Celeste Pan

    Done

    Line 124, Patchset 10: // `child_index` is the index of the item's fragment in the container
    Alison Maher . resolved

    nit: item_index

    Celeste Pan

    Done

    Line 71, Patchset 10: AlignmentCandidate item_above;
    Alison Maher . resolved

    nit: alignment_candidate

    Celeste Pan

    Done

    Line 70, Patchset 10: // axis
    Alison Maher . resolved

    nit: missing punctuation

    Celeste Pan

    Done

    Line 47, Patchset 10: LayoutUnit alignment_space;
    Alison Maher . resolved

    nit: Maybe "available_alignment_space"

    Celeste Pan

    Done

    Line 46, Patchset 10: Member<GridLayoutSubtree> child_layout_subtree;
    Alison Maher . resolved

    Same comment about this one being prefixed with "child".

    Also might be worth a note that this is needed for stretch aligned items only as they will need to be relaid out once we know the final alignment candidate for a give track opening

    Celeste Pan

    Done

    Line 45, Patchset 10: wtf_size_t child_index{kNotFound};
    Alison Maher . resolved

    This naming makes me think it is the child index in item. Maybe item_index

    Celeste Pan

    Done

    Line 32, Patchset 10: // Stored on the track opening above which the item sits.
    Alison Maher . resolved

    nit: no need to say where it is stored

    Celeste Pan

    Done

    Line 31, Patchset 10: // Holds per-item data needed for stacking-axis alignment adjustment.
    Alison Maher . resolved

    nit: A link to the spec in this comment might be useful for future readers

    https://drafts.csswg.org/css-grid-3/#stacking-self-alignment

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
    Line 250, Patchset 10: bool found_opening = false;
    Alison Maher . resolved

    nit: found_consecutive_opening

    Celeste Pan

    Done

    Line 266, Patchset 10:HeapVector<GridLanesRunningPositions::AlignmentCandidate>

    GridLanesRunningPositions::GetStackingAxisAlignmentCandidates() const {
    DCHECK(is_stacking_axis_alignment_set_);

    // References to multi-span items may appear multiple times across various
    // track openings, so we use `seen_items` to ensure that we only return one
    // alignment candidate per item.
    HashSet<const void*> seen_items;
    HeapVector<AlignmentCandidate> candidates;

    for (const auto& track_openings : track_collection_openings_) {
    for (const auto& opening : track_openings) {
    if (!opening.item_above.IsValid() ||
    !seen_items.insert(opening.item_above.item.Get()).is_new_entry) {
    continue;
    }

    const LayoutUnit alignment_space = GetAlignmentSpaceForItem(
    opening.item_above.item,
    opening.item_above.item->resolved_position.Span(
    grid_axis_direction_));
    if (alignment_space > LayoutUnit()) {
    AlignmentCandidate candidate = opening.item_above;
    candidate.alignment_space = alignment_space;
    candidates.push_back(candidate);
    }
    }
    }

    return candidates;
    }
    Alison Maher . resolved

    Can we create an iterator of alignment candidates instead? This way, we don't have to loop to find them, and then loop to apply alignment to them (and can just do that all in the same loop)?

    Also, how do we handle spanners that may have different alignment space in different tracks, or even may span a track that it doesn't have any alignment space at all?

    Celeste Pan

    Done for the iterator portion!

    We handle the spanner issue in `GetAlignmentSpaceForItem`, where we end up choosing the minimum space for all the openings that the item spans.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
      Gerrit-Change-Number: 7899886
      Gerrit-PatchSet: 12
      Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
      Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
      Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
      Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
      Gerrit-CC: kokoro <noreply...@google.com>
      Gerrit-Attention: Alison Maher <alm...@microsoft.com>
      Gerrit-Comment-Date: Tue, 16 Jun 2026 22:38:11 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Alison Maher <alm...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alison Maher (Gerrit)

      unread,
      Jun 17, 2026, 11:29:57 AMJun 17
      to Celeste Pan, kokoro, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
      Attention needed from Celeste Pan

      Alison Maher voted and added 1 comment

      Votes added by Alison Maher

      Code-Review+1

      1 comment

      File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
      Line 269, Patchset 12 (Latest): HashSet<const void*> seen_items_;
      Alison Maher . unresolved

      nit: processed_alignment_candidates_

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Celeste Pan
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
      Gerrit-Change-Number: 7899886
      Gerrit-PatchSet: 12
      Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
      Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
      Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
      Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
      Gerrit-CC: kokoro <noreply...@google.com>
      Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
      Gerrit-Comment-Date: Wed, 17 Jun 2026 15:29:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Celeste Pan (Gerrit)

      unread,
      Jun 17, 2026, 1:01:28 PMJun 17
      to Alison Maher, kokoro, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org

      Celeste Pan added 1 comment

      File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
      Line 269, Patchset 12: HashSet<const void*> seen_items_;
      Alison Maher . resolved

      nit: processed_alignment_candidates_

      Celeste Pan

      Done

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
        Gerrit-Change-Number: 7899886
        Gerrit-PatchSet: 13
        Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
        Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
        Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
        Gerrit-CC: kokoro <noreply...@google.com>
        Gerrit-Comment-Date: Wed, 17 Jun 2026 17:01:09 +0000
        satisfied_requirement
        open
        diffy

        Celeste Pan (Gerrit)

        unread,
        Jun 17, 2026, 1:01:37 PMJun 17
        to Alison Maher, kokoro, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org

        Celeste Pan voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
        Gerrit-Change-Number: 7899886
        Gerrit-PatchSet: 13
        Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
        Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
        Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
        Gerrit-CC: kokoro <noreply...@google.com>
        Gerrit-Comment-Date: Wed, 17 Jun 2026 17:01:18 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Jun 17, 2026, 1:09:45 PMJun 17
        to Celeste Pan, Alison Maher, kokoro, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org

        Message from Blink W3C Test Autoroller

        Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/60694.

        When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

        WPT Export docs:
        https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
        Gerrit-Change-Number: 7899886
        Gerrit-PatchSet: 13
        Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
        Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Wed, 17 Jun 2026 17:09:36 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Jun 17, 2026, 2:20:24 PMJun 17
        to Celeste Pan, Blink W3C Test Autoroller, Alison Maher, kokoro, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org

        Chromium LUCI CQ submitted the change with unreviewed changes

        Unreviewed changes

        12 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
        Insertions: 1, Deletions: 1.

        @@ -266,7 +266,7 @@
        wtf_size_t opening_index_ = 0;
        // Multi-span items may appear in multiple track openings; track which
        // items have already been yielded to avoid returning duplicate candidates.
        - HashSet<const void*> seen_items_;
        + HashSet<const void*> processed_alignment_candidates_;
        };

        AlignmentCandidateIterator GetAlignmentCandidateIterator() const {
        ```
        ```
        The name of the file: third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
        Insertions: 2, Deletions: 1.

        @@ -280,7 +280,8 @@

        // Skip invalid openings and already-seen multi-span items.
        if (!opening.alignment_candidate.IsValid() ||
        - !seen_items_.insert(opening.alignment_candidate.item.Get())
        + !processed_alignment_candidates_
        + .insert(opening.alignment_candidate.item.Get())
        .is_new_entry) {
        continue;
        }
        ```

        Change information

        Commit message:
        [Masonry] Apply stacking-axis alignment

        Follow-ups will be needed to implement stacking-axis alignment together
        with dense-packing, and to add tests to ensure that content alignment
        works with stacking-axis alignment.

        To account for items which need stacking-axis alignment, we keep track
        of the item placed above each track opening. After placement is complete
        and track openings are finalized, we perform stacking axis alignment. We
        perform stretch alignment at the very end as we need to re-layout the
        item and actually add it to the container builder.

        Although we are still waiting on the CSSWG on whether or not explicit
        sizing should override stretch alignment [1], this change assumes that
        we do want to let explicit size override stretch alignment.

        Lastly, tests were fixed to have widths/heights that matched with the
        track with the largest running position, which is what the ref files had
        -- previously the containers were falling short so it looked like the
        stretch items weren't properly stretching.

        Stacking axis alignment for OOF items are already tested in:
        1.third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/abspos/column-grid-lanes-alignment.html
        2.third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/abspos/column-grid-lanes-alignment-ref.html
        3.third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/abspos/row-grid-lanes-alignment.html
        4.third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/abspos/row-grid-lanes-alignment-ref.html

        [1] https://github.com/w3c/csswg-drafts/issues/13950
        Bug: 343257585
        Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
        Reviewed-by: Alison Maher <alm...@microsoft.com>
        Commit-Queue: Celeste Pan <celes...@microsoft.com>
        Cr-Commit-Position: refs/heads/main@{#1648464}
        Files:
        • M third_party/blink/renderer/core/layout/fragment_builder.h
        • M third_party/blink/renderer/core/layout/grid/grid_item.h
        • M third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.cc
        • M third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_layout_algorithm.h
        • M third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_node.cc
        • M third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.cc
        • M third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_running_positions.h
        • M third_party/blink/web_tests/TestExpectations
        • M third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-items-003.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-items-004-ref.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-items-004.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-items-005-ref.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-items-005.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-items-006.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-items-007.html
        • M third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/column-align-self-003.html
        • M third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-001.html
        • M third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-002.html
        • M third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-003-ref.html
        • M third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-003.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-004-ref.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-004.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-005.html
        • A third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-items-006.html
        • M third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/alignment/row-justify-self-003.html
        Change size: XL
        Delta: 25 files changed, 943 insertions(+), 73 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Alison Maher
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
        Gerrit-Change-Number: 7899886
        Gerrit-PatchSet: 14
        Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
        Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        open
        diffy
        satisfied_requirement

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Jun 17, 2026, 3:30:41 PMJun 17
        to Celeste Pan, Chromium LUCI CQ, Alison Maher, kokoro, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Javier Fernandez, oilpan-...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org

        Message from Blink W3C Test Autoroller

        The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/60694

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I7b1b51448e478dc0d0f762ca1fd6aa58ca2fa701
        Gerrit-Change-Number: 7899886
        Gerrit-PatchSet: 14
        Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
        Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
        Gerrit-CC: kokoro <noreply...@google.com>
        Gerrit-Comment-Date: Wed, 17 Jun 2026 19:30:33 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages