[M144] [line-clamp] Don't count phantom/empty lines when choosing to relayout [chromium/src : refs/branch-heads/7559]

0 views
Skip to first unread message

Chrome Cherry Picker (Gerrit)

unread,
Dec 22, 2025, 3:16:08 PM (17 hours ago) Dec 22
to Andreu Botella, AyeAye, blink-revie...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-...@chromium.org

Chrome Cherry Picker voted Auto-Submit+1

Auto-Submit+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedLint
  • 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: refs/branch-heads/7559
Gerrit-Change-Id: I4ab2fba137d1a2f5ca8f13991bf377ca64ae6fe6
Gerrit-Change-Number: 7302967
Gerrit-PatchSet: 2
Gerrit-Reviewer: Chrome Cherry Picker <chrome-che...@chops-service-accounts.iam.gserviceaccount.com>
Gerrit-CC: Andreu Botella <abot...@igalia.com>
Gerrit-Comment-Date: Mon, 22 Dec 2025 20:16:01 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Rubber Stamper (Gerrit)

unread,
Dec 22, 2025, 3:17:31 PM (17 hours ago) Dec 22
to Andreu Botella, Chrome Cherry Picker, AyeAye, blink-revie...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-...@chromium.org

Rubber Stamper voted

Bot-Commit+1
Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedLint
  • 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: refs/branch-heads/7559
Gerrit-Change-Id: I4ab2fba137d1a2f5ca8f13991bf377ca64ae6fe6
Gerrit-Change-Number: 7302967
Gerrit-PatchSet: 2
Gerrit-Reviewer: Chrome Cherry Picker <chrome-che...@chops-service-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Rubber Stamper <rubber-...@appspot.gserviceaccount.com>
Gerrit-CC: Andreu Botella <abot...@igalia.com>
Gerrit-Comment-Date: Mon, 22 Dec 2025 20:17:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Dec 22, 2025, 4:39:30 PM (15 hours ago) Dec 22
to Andreu Botella, Chrome Cherry Picker, Rubber Stamper, AyeAye, blink-revie...@chromium.org, zol...@webkit.org, blink-revi...@chromium.org, blink-...@chromium.org

Chromium LUCI CQ submitted the change

Change information

Commit message:
[M144] [line-clamp] Don't count phantom/empty lines when choosing to relayout

Original change's description:
> [line-clamp] Don't count phantom/empty lines when choosing to relayout
>
> The CSS-INLINE spec defines a concept called "phantom line boxes"
> (previously also known as "invisible line boxes"), which Chromium
> refers to as "empty lines" (e.g. `LineInfo::IsEmptyLine`). Such line
> boxes and their in-flow content must be treated as non-existing for
> any purpose other than determining the position of their OOF
> descendants, and for `line-clamp` they are indeed not counted when
> clamping by lines.
>
> Line-clamping should only have any effect when there is any content
> after the clamp point; and in https://crrev.com/c/7009807 we fixed a
> bug where lineless blocks and IFCs were ignored after the clamp point
> by having them decrease the number of lines until clamp if the current
> number is zero. However, this code only checked whether an in-flow
> fragment did not decrease the number of lines, and assumed that it
> must then be either a lineless block or an IFC.
>
> As it turns out, however, phantom/empty line boxes are also in-flow
> fragments that don't decrease the number of lines, but which are not
> lineless blocks or IFCs. This change then made the presence of a
> phantom/empty line box not be treated as non-existent if it is the
> only content between the clamp point and the end of the line-clamp
> container. To fix this, we added the condition that the fragment must
> not be a line box.
>
> Additionally, when writing tests, we also noticed that the DCHECK
> inside this condition, which makes sure that there has been a previous
> clamp point that we've previously chosen, would not hold if the
> current block box starts immediately after the clamp point, since the
> initial value of the number of lines until clamp would be zero. We
> fixed this by removing this assertion, which in this case is harmless.
>
> Bug: 467448802, 40336192
> Change-Id: I4ab2fba137d1a2f5ca8f13991bf377ca64ae6fe6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7253151
> Commit-Queue: Ian Kilpatrick <ikilp...@chromium.org>
> Reviewed-by: Ian Kilpatrick <ikilp...@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1558875}

(cherry picked from commit 65558713a249870c9f381ecf39acada6fc037472)
Bug: 470087026,467448802,40336192
Change-Id: I4ab2fba137d1a2f5ca8f13991bf377ca64ae6fe6
Commit-Queue: Rubber Stamper <rubber-...@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-...@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/7559@{#1948}
Cr-Branched-From: 223dfbac1c7542a06b422390d954afe5b560b607-refs/heads/main@{#1552494}
Files:
  • M third_party/blink/renderer/core/layout/block_layout_algorithm.cc
  • A third_party/blink/web_tests/external/wpt/css/css-overflow/line-clamp/line-clamp-037.html
  • A third_party/blink/web_tests/external/wpt/css/css-overflow/line-clamp/line-clamp-038.html
Change size: M
Delta: 3 files changed, 55 insertions(+), 3 deletions(-)
Branch: refs/branch-heads/7559
Submit Requirements:
  • requirement satisfiedCode-Review: Bot-Commit+1 by Rubber Stamper
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: refs/branch-heads/7559
Gerrit-Change-Id: I4ab2fba137d1a2f5ca8f13991bf377ca64ae6fe6
Gerrit-Change-Number: 7302967
Gerrit-PatchSet: 3
Gerrit-Reviewer: Chrome Cherry Picker <chrome-che...@chops-service-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages