[line-clamp] Fix clamping by height with nested height constraints [chromium/src : main]

0 views
Skip to first unread message

Ian Kilpatrick (Gerrit)

unread,
Feb 23, 2026, 6:22:46 PM (5 days ago) Feb 23
to Andreu Botella, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Andreu Botella

Ian Kilpatrick added 1 comment

File third_party/blink/renderer/core/layout/block_layout_algorithm.cc
Line 839, Patchset 2 (Latest): line_clamp_data_.data.clamp_bfc_offset != LayoutUnit::Max()) {
Ian Kilpatrick . unresolved

If possible can you change this to a std::optional<LayoutUnit> instead of relying on the LayoutUnit::Max sentinel value?

Open in Gerrit

Related details

Attention is currently required from:
  • Andreu Botella
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: I50ab38f720532d0ea4cbca455db7e584dda7003b
Gerrit-Change-Number: 7600439
Gerrit-PatchSet: 2
Gerrit-Owner: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Attention: Andreu Botella <abot...@igalia.com>
Gerrit-Comment-Date: Mon, 23 Feb 2026 23:22:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andreu Botella (Gerrit)

unread,
Feb 23, 2026, 8:53:39 PM (5 days ago) Feb 23
to Chromium LUCI CQ, Ian Kilpatrick, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Ian Kilpatrick

Andreu Botella added 1 comment

File third_party/blink/renderer/core/layout/block_layout_algorithm.cc
Line 839, Patchset 2: line_clamp_data_.data.clamp_bfc_offset != LayoutUnit::Max()) {
Ian Kilpatrick . unresolved

If possible can you change this to a std::optional<LayoutUnit> instead of relying on the LayoutUnit::Max sentinel value?

Andreu Botella

Maybe it'd be better to have an additional value in `LineClampData::State` only for counting the number of lines in a box. Since both of the checks I added for `LayoutUnit::Max()` also check that we're clamping by height, we could just move that into the state check.

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Kilpatrick
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: I50ab38f720532d0ea4cbca455db7e584dda7003b
Gerrit-Change-Number: 7600439
Gerrit-PatchSet: 3
Gerrit-Owner: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Tue, 24 Feb 2026 01:53:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ian Kilpatrick (Gerrit)

unread,
Feb 26, 2026, 3:21:57 PM (2 days ago) Feb 26
to Andreu Botella, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Andreu Botella

Ian Kilpatrick added 1 comment

File third_party/blink/renderer/core/layout/block_layout_algorithm.cc
Line 839, Patchset 2: line_clamp_data_.data.clamp_bfc_offset != LayoutUnit::Max()) {
Ian Kilpatrick . unresolved

If possible can you change this to a std::optional<LayoutUnit> instead of relying on the LayoutUnit::Max sentinel value?

Andreu Botella

Maybe it'd be better to have an additional value in `LineClampData::State` only for counting the number of lines in a box. Since both of the checks I added for `LayoutUnit::Max()` also check that we're clamping by height, we could just move that into the state check.

Ian Kilpatrick

That sounds good.

Open in Gerrit

Related details

Attention is currently required from:
  • Andreu Botella
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: I50ab38f720532d0ea4cbca455db7e584dda7003b
Gerrit-Change-Number: 7600439
Gerrit-PatchSet: 4
Gerrit-Owner: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Attention: Andreu Botella <abot...@igalia.com>
Gerrit-Comment-Date: Thu, 26 Feb 2026 20:21:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Andreu Botella <abot...@igalia.com>
Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Ian Kilpatrick (Gerrit)

unread,
Feb 26, 2026, 3:24:43 PM (2 days ago) Feb 26
to Andreu Botella, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Andreu Botella

Ian Kilpatrick added 3 comments

File third_party/blink/renderer/core/layout/block_layout_algorithm.cc
Line 850, Patchset 4 (Latest): MinMaxSizes size_constraints;
Ian Kilpatrick . unresolved

do you want to initialize this to LayoutUnit(), LayoutUnit::Max() ?

Line 854, Patchset 4 (Latest): if (size_constraints.min_size >= size_constraints.max_size) {
File third_party/blink/renderer/core/layout/line_clamp_data.h
Line 139, Patchset 4 (Latest): block_size_constraints_(
Ian Kilpatrick . unresolved

we typically call these block_min_max_sizes

Open in Gerrit

Related details

Attention is currently required from:
  • Andreu Botella
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: I50ab38f720532d0ea4cbca455db7e584dda7003b
Gerrit-Change-Number: 7600439
Gerrit-PatchSet: 4
Gerrit-Owner: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Attention: Andreu Botella <abot...@igalia.com>
Gerrit-Comment-Date: Thu, 26 Feb 2026 20:24:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andreu Botella (Gerrit)

unread,
Feb 26, 2026, 4:17:31 PM (2 days ago) Feb 26
to Chromium LUCI CQ, Ian Kilpatrick, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Ian Kilpatrick

Andreu Botella added 1 comment

File third_party/blink/renderer/core/layout/block_layout_algorithm.cc
Line 839, Patchset 2: line_clamp_data_.data.clamp_bfc_offset != LayoutUnit::Max()) {
Ian Kilpatrick . unresolved

If possible can you change this to a std::optional<LayoutUnit> instead of relying on the LayoutUnit::Max sentinel value?

Andreu Botella

Maybe it'd be better to have an additional value in `LineClampData::State` only for counting the number of lines in a box. Since both of the checks I added for `LayoutUnit::Max()` also check that we're clamping by height, we could just move that into the state check.

Ian Kilpatrick

That sounds good.

Andreu Botella

I'm thinking that maybe I should do that in a follow-up CL. For this one, I could keep Max as a sentinel value, or alternatively I could set the size constraints to the fixed size. Both should give the same result.

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Kilpatrick
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: I50ab38f720532d0ea4cbca455db7e584dda7003b
Gerrit-Change-Number: 7600439
Gerrit-PatchSet: 4
Gerrit-Owner: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Andreu Botella <abot...@igalia.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Thu, 26 Feb 2026 21:17:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andreu Botella (Gerrit)

unread,
8:25 AM (12 hours ago) 8:25 AM
to Chromium LUCI CQ, Ian Kilpatrick, chromium...@chromium.org, blink-revi...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Ian Kilpatrick

Andreu Botella added 4 comments

File third_party/blink/renderer/core/layout/block_layout_algorithm.cc
Line 839, Patchset 2: line_clamp_data_.data.clamp_bfc_offset != LayoutUnit::Max()) {
Ian Kilpatrick . resolved

If possible can you change this to a std::optional<LayoutUnit> instead of relying on the LayoutUnit::Max sentinel value?

Andreu Botella

Maybe it'd be better to have an additional value in `LineClampData::State` only for counting the number of lines in a box. Since both of the checks I added for `LayoutUnit::Max()` also check that we're clamping by height, we could just move that into the state check.

Ian Kilpatrick

That sounds good.

Andreu Botella

I'm thinking that maybe I should do that in a follow-up CL. For this one, I could keep Max as a sentinel value, or alternatively I could set the size constraints to the fixed size. Both should give the same result.

Andreu Botella

Made this change, setting `block_min_max_sizes` to the fixed size in this CL.

Line 850, Patchset 4: MinMaxSizes size_constraints;
Ian Kilpatrick . resolved

do you want to initialize this to LayoutUnit(), LayoutUnit::Max() ?

Andreu Botella

Not relevant anymore in this CL. Will take that into account for the follow-up CL.

Line 854, Patchset 4: if (size_constraints.min_size >= size_constraints.max_size) {
Ian Kilpatrick . resolved
Andreu Botella

Not relevant anymore in this CL. Will take that into account for the follow-up CL.

File third_party/blink/renderer/core/layout/line_clamp_data.h
Line 139, Patchset 4: block_size_constraints_(
Ian Kilpatrick . resolved

we typically call these block_min_max_sizes

Andreu Botella

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Kilpatrick
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: I50ab38f720532d0ea4cbca455db7e584dda7003b
    Gerrit-Change-Number: 7600439
    Gerrit-PatchSet: 5
    Gerrit-Owner: Andreu Botella <abot...@igalia.com>
    Gerrit-Reviewer: Andreu Botella <abot...@igalia.com>
    Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Comment-Date: Sat, 28 Feb 2026 13:25:42 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages