Skip to content

Commit 4fd2a44

Browse files
committed
Bug 1922856 [wpt PR 48482] - [line-clamp] Always clamp immediately after a line box, a=testonly
Automatic update from web-platform-tests [line-clamp] Always clamp immediately after a line box In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian Kilpatrick Commit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main{#1364495} -- wpt-commits: 1563c1e3a851d13982c2e9a0c2eabb8287823b35 wpt-pr: 48482 UltraBlame original commit: 5751601c841de1f7d26475e22ebaa4d8ca71b474
1 parent 01cc465 commit 4fd2a44

11 files changed

+91
-1327
lines changed

testing/web-platform/tests/css/css-overflow/line-clamp/line-clamp-auto-011.tentative.html

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,11 @@
141141
0
142142
it
143143
should
144-
not
144+
still
145145
show
146-
any
147-
lines
148-
and
149-
its
150-
content
151-
box
152-
'
153-
s
154-
intrinsic
155-
size
156-
should
157-
be
158-
zero
146+
the
147+
first
148+
line
159149
"
160150
>
161151
<

testing/web-platform/tests/css/css-overflow/line-clamp/line-clamp-auto-025.tentative.html

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
clamp
2727
point
2828
is
29-
visible
29+
hidden
3030
<
3131
/
3232
title
@@ -99,13 +99,13 @@
9999
"
100100
reference
101101
/
102+
webkit
103+
-
102104
line
103105
-
104106
clamp
105107
-
106-
auto
107-
-
108-
025
108+
005
109109
-
110110
ref
111111
.
@@ -133,9 +133,10 @@
133133
:
134134
auto
135135
is
136+
at
136137
the
137138
last
138-
one
139+
line
139140
where
140141
the
141142
box
@@ -145,38 +146,27 @@
145146
t
146147
overflow
147148
.
148-
Since
149-
non
150-
-
151-
inline
152-
abspos
153-
have
154-
a
155-
clamp
156-
point
157-
after
158-
them
159-
and
160-
they
161-
don
149+
An
150+
immediately
151+
following
152+
box
153+
even
154+
if
155+
it
162156
'
163-
t
164-
take
165-
up
166-
any
167-
space
168-
in
169-
the
170-
container
157+
s
171158
an
172159
abspos
173-
right
174-
at
175-
the
176-
boundary
160+
that
161+
takes
162+
up
163+
no
164+
block
165+
size
177166
should
167+
still
178168
be
179-
visible
169+
hidden
180170
.
181171
"
182172
>
@@ -205,6 +195,11 @@
205195
32px
206196
serif
207197
;
198+
padding
199+
:
200+
0
201+
4px
202+
;
208203
background
209204
-
210205
color

0 commit comments

Comments
 (0)