[Masonry] Apply [min|max]-content style to masonry items [chromium/src : main]

0 views
Skip to first unread message

Celeste Pan (Gerrit)

unread,
Jun 17, 2025, 2:29:33 PMJun 17
to Alison Maher, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Alison Maher, Ian Kilpatrick and Kurt Catti-Schmidt

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Alison Maher
  • Ian Kilpatrick
  • Kurt Catti-Schmidt
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
Gerrit-Change-Number: 6641886
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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
Gerrit-Attention: Alison Maher <alm...@microsoft.com>
Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Tue, 17 Jun 2025 18:29:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ian Kilpatrick (Gerrit)

unread,
Jun 17, 2025, 3:48:20 PMJun 17
to Celeste Pan, Alison Maher, Kurt Catti-Schmidt, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Alison Maher, Celeste Pan and Kurt Catti-Schmidt

Ian Kilpatrick added 4 comments

File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
Line 94, Patchset 4 (Latest): }
Ian Kilpatrick . unresolved

Hmmm... this shouldn't be necessary. Basically we shouldn't condition the algorithm, based on if the width has a particular keyword.

Put another way - there should be no different in the layout if we have
`width: min-content` or `width: 100px` (if `100px` == `min-content`).

Line 171, Patchset 4 (Latest): bool is_for_min_max_sizing) {
Ian Kilpatrick . unresolved

Do we need both args? (e.g. if comment above, can we get away with just std::optional<SizingConstraint> ?)

Line 225, Patchset 4 (Latest): }
Ian Kilpatrick . unresolved
Pull into lambda so we do thing on demand. e.g.
```
std::optional<LayoutUnit> fixed_inline_size = ([&]() {
if (sizing_constraint == kLayout)
return std::nullopt;

const ConstraintSpace space = CreateConstraintSpaceForMeasure(masonry_item);
const MinMaxSizes sizes =
ComputeMinAndMaxContentContributionForSelf(masonry_item.node,
space)
.sizes;

if (sizing_constraitn == kMinContent) {
return sizes.min_size;
}

})();
```

Line 235, Patchset 4 (Latest): }
Ian Kilpatrick . unresolved

```
const ConstraintSpace space = is_for_min_max_sizing ? CreateCon... : CreateCon...;
```

Open in Gerrit

Related details

Attention is currently required from:
  • Alison Maher
  • Celeste Pan
  • Kurt Catti-Schmidt
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
    Gerrit-Change-Number: 6641886
    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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 19:48:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kurt Catti-Schmidt (Gerrit)

    unread,
    Jun 17, 2025, 4:55:47 PMJun 17
    to Celeste Pan, Alison Maher, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Alison Maher and Celeste Pan

    Kurt Catti-Schmidt added 2 comments

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Line 566, Patchset 4 (Latest): DCHECK_EQ(fixed_available_size.inline_size, kIndefiniteSize);
    Kurt Catti-Schmidt . unresolved

    These DCHECK's aren't validating any logic - you're setting `fixed_available_size` to `kIndefiniteLogicalSize` above, so this'll always be true.

    Is this supposed to be:

    `DCHECK_EQ(opt_fixed_inline_size->inline_size, kIndefiniteSize);`

    Line 569, Patchset 4 (Latest): DCHECK_EQ(fixed_available_size.block_size, kIndefiniteSize);
    Kurt Catti-Schmidt . unresolved

    Same here

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    • Celeste Pan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
    Gerrit-Change-Number: 6641886
    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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 20:55:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    Jun 17, 2025, 7:44:36 PMJun 17
    to Celeste Pan, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan

    Alison Maher added 1 comment

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Ian Kilpatrick . unresolved

    Hmmm... this shouldn't be necessary. Basically we shouldn't condition the algorithm, based on if the width has a particular keyword.

    Put another way - there should be no different in the layout if we have
    `width: min-content` or `width: 100px` (if `100px` == `min-content`).

    Alison Maher

    +1, we likely want to pass down which one we want if this is coming from a compute min/max call instead of trying to calculate it here.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Celeste Pan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
    Gerrit-Change-Number: 6641886
    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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 23:44:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    Jun 17, 2025, 9:08:02 PMJun 17
    to Celeste Pan, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan

    Alison Maher added 1 comment

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Ian Kilpatrick . unresolved

    Hmmm... this shouldn't be necessary. Basically we shouldn't condition the algorithm, based on if the width has a particular keyword.

    Put another way - there should be no different in the layout if we have
    `width: min-content` or `width: 100px` (if `100px` == `min-content`).

    Alison Maher

    +1, we likely want to pass down which one we want if this is coming from a compute min/max call instead of trying to calculate it here.

    Alison Maher

    Chatted a bit with Celeste on this, and I realized I was thinking this was something else (i.e. I thought this was being set for when we called ComputeMinMaxSizes as opposed to Layout directly). So, feel free to ignore my suggestion in the comment, but in either case, agree with Ian that we shouldn't need this, so this is likely indicative of a bug elsewhere (potentially track sizing or the constraint space)

    Gerrit-Comment-Date: Wed, 18 Jun 2025 01:07:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alison Maher <alm...@microsoft.com>
    Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kurt Catti-Schmidt (Gerrit)

    unread,
    Jun 19, 2025, 4:33:03 PMJun 19
    to Celeste Pan, Alison Maher, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan

    Kurt Catti-Schmidt added 1 comment

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Line 566, Patchset 4: DCHECK_EQ(fixed_available_size.inline_size, kIndefiniteSize);
    Kurt Catti-Schmidt . unresolved

    These DCHECK's aren't validating any logic - you're setting `fixed_available_size` to `kIndefiniteLogicalSize` above, so this'll always be true.

    Is this supposed to be:

    `DCHECK_EQ(opt_fixed_inline_size->inline_size, kIndefiniteSize);`

    Kurt Catti-Schmidt

    Maybe `DCHECK_NE(opt_fixed_inline_size->inline_size, kIndefiniteSize);` makes more sense here. Or is this supposed to be checked after the assignment? If not, can this DCHECK be removed?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Celeste Pan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
    Gerrit-Change-Number: 6641886
    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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Thu, 19 Jun 2025 20:32:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Kurt Catti-Schmidt <ksc...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Celeste Pan (Gerrit)

    unread,
    Jun 20, 2025, 6:05:34 PMJun 20
    to Alison Maher, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Alison Maher, Ian Kilpatrick and Kurt Catti-Schmidt

    Celeste Pan added 6 comments

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Ian Kilpatrick . unresolved

    Hmmm... this shouldn't be necessary. Basically we shouldn't condition the algorithm, based on if the width has a particular keyword.

    Put another way - there should be no different in the layout if we have
    `width: min-content` or `width: 100px` (if `100px` == `min-content`).

    Celeste Pan

    Changes were made to use kLayout instead; I've also updated the test expectations as it looks like the min-content/max-content constraints of the container should NOT apply to the children of the container during layout, and fit-content should apply to them instead (as a default). However, I've put the min-content and max-content tests under a "fit-content" section in the TestExpectations file as they will only exhibit the correct behavior once we have Alison's change to have fit-content as the default behavior.

    Line 171, Patchset 4: bool is_for_min_max_sizing) {
    Ian Kilpatrick . unresolved

    Do we need both args? (e.g. if comment above, can we get away with just std::optional<SizingConstraint> ?)

    Celeste Pan

    Hm, I'm not sure if we can because in the `ComputeMinMaxSizes` pass we'd want to make sure to call `LayoutMasonryItemForMeasure` instead of `item.Layout(...)`. And there isn't really a way to differentiate if we're in a layout pass vs computing pass just based on the value of `sizing_constraint`, since both layout and measuring could use any of the `SizingConstraint` options (nullopt, kLayout, kMinContent, kMaxContent).

    Line 225, Patchset 4: }
    Ian Kilpatrick . resolved
    Pull into lambda so we do thing on demand. e.g.
    ```
    std::optional<LayoutUnit> fixed_inline_size = ([&]() {
    if (sizing_constraint == kLayout)
    return std::nullopt;

    const ConstraintSpace space = CreateConstraintSpaceForMeasure(masonry_item);
    const MinMaxSizes sizes =
    ComputeMinAndMaxContentContributionForSelf(masonry_item.node,
    space)
    .sizes;

    if (sizing_constraitn == kMinContent) {
    return sizes.min_size;
    }

    })();
    ```

    Celeste Pan

    Done

    Line 235, Patchset 4: }
    Ian Kilpatrick . resolved

    ```
    const ConstraintSpace space = is_for_min_max_sizing ? CreateCon... : CreateCon...;
    ```

    Celeste Pan

    Done

    Line 566, Patchset 4: DCHECK_EQ(fixed_available_size.inline_size, kIndefiniteSize);
    Kurt Catti-Schmidt . resolved

    These DCHECK's aren't validating any logic - you're setting `fixed_available_size` to `kIndefiniteLogicalSize` above, so this'll always be true.

    Is this supposed to be:

    `DCHECK_EQ(opt_fixed_inline_size->inline_size, kIndefiniteSize);`

    Celeste Pan

    Alison was able to help me better understand the logic here, and the thing here is that we don't want to set up a forced constraint if the parent already has a size set in that direction, because in that case we would use that sizing constraint instead.

    This will automatically be true at the moment, but may not be later when we add in code for subgrid (as marked by the TODO in `CreateConstraintSpaceForMeasure`). I'll add in a TODO that's identical to the one in `CreateConstraintForMeasure`!

    Line 569, Patchset 4: DCHECK_EQ(fixed_available_size.block_size, kIndefiniteSize);
    Kurt Catti-Schmidt . resolved

    Same here

    Celeste Pan

    Addressed in the above comment :)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    • Ian Kilpatrick
    • Kurt Catti-Schmidt
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
    Gerrit-Change-Number: 6641886
    Gerrit-PatchSet: 6
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Comment-Date: Fri, 20 Jun 2025 22:05:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alison Maher (Gerrit)

    unread,
    Jun 23, 2025, 6:59:59 PMJun 23
    to Celeste Pan, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan, Ian Kilpatrick and Kurt Catti-Schmidt

    Alison Maher added 4 comments

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.h
    Line 21, Patchset 9 (Latest):class MasonryRunningPositions;
    Alison Maher . unresolved

    This looks like a repeat of line 18 (probably from a rebase)

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Line 94, Patchset 4: }
    Ian Kilpatrick . resolved

    Hmmm... this shouldn't be necessary. Basically we shouldn't condition the algorithm, based on if the width has a particular keyword.

    Put another way - there should be no different in the layout if we have
    `width: min-content` or `width: 100px` (if `100px` == `min-content`).

    Celeste Pan

    Changes were made to use kLayout instead; I've also updated the test expectations as it looks like the min-content/max-content constraints of the container should NOT apply to the children of the container during layout, and fit-content should apply to them instead (as a default). However, I've put the min-content and max-content tests under a "fit-content" section in the TestExpectations file as they will only exhibit the correct behavior once we have Alison's change to have fit-content as the default behavior.

    Alison Maher

    Acknowledged

    Line 96, Patchset 9 (Latest): /*is_for_min_max_sizing=*/false);
    Alison Maher . unresolved

    This should already be false, right? I may just remove the false default for these to be on the safe side

    Line 171, Patchset 4: bool is_for_min_max_sizing) {
    Ian Kilpatrick . unresolved

    Do we need both args? (e.g. if comment above, can we get away with just std::optional<SizingConstraint> ?)

    Celeste Pan

    Hm, I'm not sure if we can because in the `ComputeMinMaxSizes` pass we'd want to make sure to call `LayoutMasonryItemForMeasure` instead of `item.Layout(...)`. And there isn't really a way to differentiate if we're in a layout pass vs computing pass just based on the value of `sizing_constraint`, since both layout and measuring could use any of the `SizingConstraint` options (nullopt, kLayout, kMinContent, kMaxContent).

    Alison Maher

    Hmm I'm somewhat confused by this, as well. Are you saying when we run layout, we may pass in a non-kLayout sizing constraint (or was this residual from the code you had added (but now removed) to force items to min or max content at layout time)? If so, I think we should only need the sizing constraint

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Celeste Pan
    • Ian Kilpatrick
    • Kurt Catti-Schmidt
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
    Gerrit-Change-Number: 6641886
    Gerrit-PatchSet: 9
    Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
    Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
    Gerrit-Comment-Date: Mon, 23 Jun 2025 22:59:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
    Comment-In-Reply-To: Celeste Pan <celes...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Celeste Pan (Gerrit)

    unread,
    Jun 24, 2025, 12:53:16 PMJun 24
    to Alison Maher, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Alison Maher, Ian Kilpatrick and Kurt Catti-Schmidt

    Celeste Pan added 3 comments

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.h
    Line 21, Patchset 9:class MasonryRunningPositions;
    Alison Maher . resolved

    This looks like a repeat of line 18 (probably from a rebase)

    Celeste Pan

    Done

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Line 96, Patchset 9: /*is_for_min_max_sizing=*/false);
    Alison Maher . resolved

    This should already be false, right? I may just remove the false default for these to be on the safe side

    Celeste Pan

    Done

    Line 171, Patchset 4: bool is_for_min_max_sizing) {
    Ian Kilpatrick . resolved

    Do we need both args? (e.g. if comment above, can we get away with just std::optional<SizingConstraint> ?)

    Celeste Pan

    Hm, I'm not sure if we can because in the `ComputeMinMaxSizes` pass we'd want to make sure to call `LayoutMasonryItemForMeasure` instead of `item.Layout(...)`. And there isn't really a way to differentiate if we're in a layout pass vs computing pass just based on the value of `sizing_constraint`, since both layout and measuring could use any of the `SizingConstraint` options (nullopt, kLayout, kMinContent, kMaxContent).

    Alison Maher

    Hmm I'm somewhat confused by this, as well. Are you saying when we run layout, we may pass in a non-kLayout sizing constraint (or was this residual from the code you had added (but now removed) to force items to min or max content at layout time)? If so, I think we should only need the sizing constraint

    Celeste Pan

    Looked over this again, and after the discussion that we should always be using `kLayout` when running `PlaceMasonryItems` during the layout pass, you're right in that we don't need the variable anymore, and we can get by with just using `SizingConstraint`. Removed the boolean!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alison Maher
    • Ian Kilpatrick
    • Kurt Catti-Schmidt
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
    Gerrit-Change-Number: 6641886
    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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-Attention: Alison Maher <alm...@microsoft.com>
    Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Comment-Date: Tue, 24 Jun 2025 16:53:05 +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 24, 2025, 1:03:37 PMJun 24
    to Celeste Pan, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
    Attention needed from Celeste Pan, Ian Kilpatrick and Kurt Catti-Schmidt

    Alison Maher added 6 comments

    File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
    Line 64, Patchset 10 (Parent): ResolveItemToleranceForMasonry(Style(), masonry_available_size_));
    Alison Maher . unresolved

    This was something that came through in a rebase from one of my recent CLs. I think we can continue to use `masonry_available_size_` here, instead of calling `ChildAvailableSize()`.

    Line 105, Patchset 10 (Latest): ResolveItemToleranceForMasonry(Style(), ChildAvailableSize()));
    Alison Maher . unresolved

    Same here, `masonry_available_size_` instead

    Line 157, Patchset 10 (Latest): const auto is_for_layout = sizing_constraint == SizingConstraint::kLayout;
    Alison Maher . unresolved

    I would use bool here, instead of auto

    Line 198, Patchset 10 (Latest): // We need to compute the available space for the item, IF we are using it
    Alison Maher . unresolved

    nit: "if"

    Line 219, Patchset 10 (Latest): /*is_for_min_max_sizing=*/true);
    Alison Maher . unresolved

    nit: up to you, but we could also pass in `!is_for_layout` instead

    Line 224, Patchset 10 (Latest): sizing_constraint == SizingConstraint::kLayout
    Alison Maher . unresolved

    Can we use `is_for_layout` here, too?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Celeste Pan
    • Ian Kilpatrick
    • Kurt Catti-Schmidt
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
      Gerrit-Change-Number: 6641886
      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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
      Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
      Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
      Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
      Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
      Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
      Gerrit-Comment-Date: Tue, 24 Jun 2025 17:03:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Celeste Pan (Gerrit)

      unread,
      Jun 24, 2025, 2:06:04 PMJun 24
      to Alison Maher, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
      Attention needed from Alison Maher, Ian Kilpatrick and Kurt Catti-Schmidt

      Celeste Pan added 6 comments

      File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
      Line 64, Patchset 10 (Parent): ResolveItemToleranceForMasonry(Style(), masonry_available_size_));
      Alison Maher . resolved

      This was something that came through in a rebase from one of my recent CLs. I think we can continue to use `masonry_available_size_` here, instead of calling `ChildAvailableSize()`.

      Celeste Pan

      Done

      Line 105, Patchset 10: ResolveItemToleranceForMasonry(Style(), ChildAvailableSize()));
      Alison Maher . resolved

      Same here, `masonry_available_size_` instead

      Celeste Pan

      Done

      Line 157, Patchset 10: const auto is_for_layout = sizing_constraint == SizingConstraint::kLayout;
      Alison Maher . resolved

      I would use bool here, instead of auto

      Celeste Pan

      Done

      Line 198, Patchset 10: // We need to compute the available space for the item, IF we are using it
      Alison Maher . resolved

      nit: "if"

      Celeste Pan

      Done

      Line 219, Patchset 10: /*is_for_min_max_sizing=*/true);
      Alison Maher . resolved

      nit: up to you, but we could also pass in `!is_for_layout` instead

      Celeste Pan

      I think it's slightly easier to read with the `true`, so will leave as is, but thank you for the suggestion!

      Line 224, Patchset 10: sizing_constraint == SizingConstraint::kLayout
      Alison Maher . resolved

      Can we use `is_for_layout` here, too?

      Celeste Pan

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alison Maher
      • Ian Kilpatrick
      • Kurt Catti-Schmidt
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
      Gerrit-Change-Number: 6641886
      Gerrit-PatchSet: 11
      Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
      Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
      Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
      Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
      Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
      Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
      Gerrit-Attention: Alison Maher <alm...@microsoft.com>
      Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
      Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
      Gerrit-Comment-Date: Tue, 24 Jun 2025 18:05:55 +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 24, 2025, 2:52:21 PMJun 24
      to Celeste Pan, Kurt Catti-Schmidt, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
      Attention needed from Celeste Pan, Ian Kilpatrick and Kurt Catti-Schmidt

      Alison Maher voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Celeste Pan
      • Ian Kilpatrick
      • Kurt Catti-Schmidt
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
      Gerrit-Change-Number: 6641886
      Gerrit-PatchSet: 11
      Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
      Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
      Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
      Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
      Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
      Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
      Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
      Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
      Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
      Gerrit-Comment-Date: Tue, 24 Jun 2025 18:52:12 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Kurt Catti-Schmidt (Gerrit)

      unread,
      Jun 24, 2025, 4:26:55 PMJun 24
      to Celeste Pan, Alison Maher, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
      Attention needed from Celeste Pan and Ian Kilpatrick

      Kurt Catti-Schmidt voted and added 1 comment

      Votes added by Kurt Catti-Schmidt

      Code-Review+1

      1 comment

      File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
      Line 212, Patchset 11 (Latest): // Create the space based on whether we're doing this for measure or for
      // layout.
      Kurt Catti-Schmidt . unresolved

      Nit: this comment can go away, the code is nice and clear

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Celeste Pan
      • Ian Kilpatrick
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
        Gerrit-Change-Number: 6641886
        Gerrit-PatchSet: 11
        Gerrit-Owner: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
        Gerrit-Reviewer: Celeste Pan <celes...@microsoft.com>
        Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
        Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
        Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
        Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
        Gerrit-Attention: Celeste Pan <celes...@microsoft.com>
        Gerrit-Comment-Date: Tue, 24 Jun 2025 20:26:44 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Celeste Pan (Gerrit)

        unread,
        Jun 24, 2025, 4:50:02 PMJun 24
        to Kurt Catti-Schmidt, Alison Maher, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
        Attention needed from Ian Kilpatrick

        Celeste Pan added 1 comment

        File third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
        Line 212, Patchset 11: // Create the space based on whether we're doing this for measure or for
        // layout.
        Kurt Catti-Schmidt . resolved

        Nit: this comment can go away, the code is nice and clear

        Celeste Pan

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ian Kilpatrick
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
        Gerrit-Change-Number: 6641886
        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-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
        Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
        Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
        Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
        Gerrit-Comment-Date: Tue, 24 Jun 2025 20:49:52 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Kurt Catti-Schmidt <ksc...@microsoft.com>
        satisfied_requirement
        open
        diffy

        Celeste Pan (Gerrit)

        unread,
        Jun 24, 2025, 4:50:19 PMJun 24
        to Kurt Catti-Schmidt, Alison Maher, Ian Kilpatrick, Chromium LUCI CQ, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org
        Attention needed from Ian Kilpatrick

        Celeste Pan voted Commit-Queue+2

        Commit-Queue+2
        Gerrit-Comment-Date: Tue, 24 Jun 2025 20:50:09 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Jun 24, 2025, 5:40:16 PMJun 24
        to Celeste Pan, Kurt Catti-Schmidt, Alison Maher, Ian Kilpatrick, chromium...@chromium.org, Javier Fernandez, blink-revi...@chromium.org, blink-...@chromium.org, zol...@webkit.org

        Chromium LUCI CQ submitted the change with unreviewed changes

        Unreviewed changes

        11 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/masonry/masonry_layout_algorithm.cc
        Insertions: 0, Deletions: 2.

        @@ -209,8 +209,6 @@
        : sizes.max_size);
        })();

        - // Create the space based on whether we're doing this for measure or for
        - // layout.
        const ConstraintSpace space =
        is_for_layout
        ? CreateConstraintSpaceForLayout(masonry_item, track_collection,
        ```

        Change information

        Commit message:
        [Masonry] Apply [min|max]-content style to masonry items

        This change applies min/max-content sizing to all of the items inside of
        the container when we are computing the min/max-content size of the
        masonry container.

        The new tests which display visible items have been triaged in
        TestExpectations under the fit-content section, as we are waiting on
        this change:
        https://chromium-review.googlesource.com/c/chromium/src/+/6649165 to
        always apply fit-content as the default behavior for items.
        Bug: 343257585
        Change-Id: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
        Reviewed-by: Alison Maher <alm...@microsoft.com>
        Reviewed-by: Kurt Catti-Schmidt <ksc...@microsoft.com>
        Commit-Queue: Celeste Pan <celes...@microsoft.com>
        Cr-Commit-Position: refs/heads/main@{#1478197}
        Files:
        • M third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.cc
        • M third_party/blink/renderer/core/layout/masonry/masonry_layout_algorithm.h
        • M third_party/blink/web_tests/TestExpectations
        • A third_party/blink/web_tests/wpt_internal/css/css-masonry/row-auto-placement-max-content-ref.html
        • A third_party/blink/web_tests/wpt_internal/css/css-masonry/row-auto-placement-max-content.html
        • A third_party/blink/web_tests/wpt_internal/css/css-masonry/row-auto-placement-min-content-ref.html
        • A third_party/blink/web_tests/wpt_internal/css/css-masonry/row-auto-placement-min-content.html
        • A third_party/blink/web_tests/wpt_internal/css/css-masonry/row-min-max-content-container-ref.html
        • A third_party/blink/web_tests/wpt_internal/css/css-masonry/row-min-max-content-container.html
        Change size: L
        Delta: 9 files changed, 368 insertions(+), 15 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Kurt Catti-Schmidt, +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: I089a3307059344ab3dd5c5bbdaa6a44df324e0cb
        Gerrit-Change-Number: 6641886
        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-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
        Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages