Skip to content

Commit 82aea1f

Browse files
andreubotellafrivoal
authored andcommitted
[css-overflow-4] Don't clamp by height with line-clamp: <integer>
As per the latest resolution on #12041, `line-clamp: <integer>` cannot clamp by both lines and height due to web compat issues with its prefixed `-webkit-line-clamp` alias. The behavior of clamping by lines and height, whichever comes earlier, is still wanted; but it needs an opt-in syntax that has not been decided yet. Since neither the syntax of this behavior on the `line-clamp` shorthand, nor its mapping into its longhands, are yet clear, this PR disables this behavior –clamping only by the auto clamp point when `max-lines: none`, and only by the line-based clamp point otherwise– while adding an issue marker. This change also moves the definition of "line-based clamp point" to the `max-lines` section.
1 parent df2c247 commit 82aea1f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

css-overflow-4/Overview.bs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property</h3>
11881188
then, given a [=computed value=] of <var>N</var>:
11891189

11901190
- If the box is a [=line-clamp container=],
1191-
its [=line-based clamp point=] is set
1191+
its <dfn>line-based clamp point</dfn> is set
11921192
to the first possible clamp point after
11931193
its <var>N</var>th
11941194
descendant <a>in-flow</a> <a>line box</a>.
@@ -1584,13 +1584,11 @@ Handling of Excess Content: the 'continue' property</h3>
15841584
if its automatic block size were infinite.
15851585
If the [=block size=] would be infinite,
15861586
then there is no [=auto clamp point=].
1587-
Additionally,
1588-
when the [=line-clamp container=]'s [=block formatting context root=]
1589-
has a [=computed value=] of 'max-lines' other than ''max-lines/none'',
1590-
then that property determines the <dfn>line-based clamp point</dfn>.
1591-
The actual [=clamp point=] used is
1592-
either the [=auto clamp point=] or the [=line-based clamp point=],
1593-
choosing the earlier when both exist.
1587+
1588+
If the [=line-clamp container=]'s [=block formatting context root=]
1589+
has a [=computed value=] of 'max-lines' set to ''max-lines/none'',
1590+
then the actual [=clamp point=] is the [=auto clamp point=], if any.
1591+
Otherwise, the actual clamp point is the [=line-based clamp point=], if any.
15941592

15951593
<wpt>
15961594
line-clamp-011.html
@@ -1622,6 +1620,10 @@ Handling of Excess Content: the 'continue' property</h3>
16221620
webkit-line-clamp-with-max-height.html
16231621
</wpt>
16241622

1623+
Issue(12041): Having the actual [=clamp point=] be the earlier of
1624+
the [=line-based clamp point=] and the [=auto clamp point=], if both exist,
1625+
is a wanted behavior, but the syntax for it is still being worked out.
1626+
16251627
Within a [=line-clamp container=],
16261628
the following boxes and line boxes become [=invisible boxes=]:
16271629

0 commit comments

Comments
 (0)