Skip to content

Commit

Permalink
Bug 1922856 [wpt PR 48482] - [line-clamp] Always clamp immediately af…
Browse files Browse the repository at this point in the history
…ter 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 <ikilpatrickchromium.org>
Commit-Queue: Andreu Botella <abotellaigalia.com>
Cr-Commit-Position: refs/heads/main{#1364495}

--

wpt-commits: 1563c1e3a851d13982c2e9a0c2eabb8287823b35
wpt-pr: 48482

UltraBlame original commit: 5751601c841de1f7d26475e22ebaa4d8ca71b474
  • Loading branch information
marco-c committed Oct 15, 2024
1 parent 01cc465 commit 4fd2a44
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 1,327 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,11 @@
0
it
should
not
still
show
any
lines
and
its
content
box
'
s
intrinsic
size
should
be
zero
the
first
line
"
>
<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
clamp
point
is
visible
hidden
<
/
title
Expand Down Expand Up @@ -99,13 +99,13 @@
"
reference
/
webkit
-
line
-
clamp
-
auto
-
025
005
-
ref
.
Expand Down Expand Up @@ -133,9 +133,10 @@
:
auto
is
at
the
last
one
line
where
the
box
Expand All @@ -145,38 +146,27 @@
t
overflow
.
Since
non
-
inline
abspos
have
a
clamp
point
after
them
and
they
don
An
immediately
following
box
even
if
it
'
t
take
up
any
space
in
the
container
s
an
abspos
right
at
the
boundary
that
takes
up
no
block
size
should
still
be
visible
hidden
.
"
>
Expand Down Expand Up @@ -205,6 +195,11 @@
32px
serif
;
padding
:
0
4px
;
background
-
color
Expand Down
Loading

0 comments on commit 4fd2a44

Please sign in to comment.