From c2fa93089b2251e72973ded1fa042ef4207dfa34 Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Mon, 2 Sep 2024 13:57:00 +0200
Subject: [PATCH 01/13] [css-overflow-4] Draft spec for `continue: collapse`
(#7708)
---
css-overflow-4/Overview.bs | 119 ++++++++++++++++++++++++++++---------
1 file changed, 91 insertions(+), 28 deletions(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 6dc3db0d26c..3f828d3ac9b 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -707,12 +707,15 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property
This property allows inserting content into the last line box
- before a (forced or unforced) region break
- to indicate the continuity of truncated/interrupted content.
+ before a (forced or unforced) region break or a [=clamp point=]
+ to indicate the continuity of truncated / interrupted content.
It only affects line boxes contained directly by the block container itself,
but as it inherits, will have an effect on descendants’ line boxes unless overridden.
- If the box contains no line box immediately preceding a region break,
- then this property has no effect.
+
+ This property only affects a line box if there is eiher a [=region break=] or a [=clamp point=]
+ after it in the [=block formatting context=], and there are no boxes or line boxes in between.
+ If the [=clamp point=] is placed at the end of the [=line-clamp container=], then the line will
+ not be affected.
Note: See [[css-overflow-4#fragmentation]] for a way to generate boxes with such a [=region break=].
@@ -777,10 +780,12 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property
The [=block overflow ellipsis=] must not be included
in either the ''::first-letter'' nor the ''::first-line'' pseudo-elements.
- If there is a subsequent fragmentation container in the [=fragmentation context=]
+ If the [=block overflow ellipsis=] is placed before a [=region break=] and
+ there is a subsequent fragmentation container in the [=fragmentation context=]
that would receive subsequent content,
then the content displaced by the block overflow ellipsis
- must be pushed to that fragmentation container.
+ must be pushed to that fragmentation container. If it is placed before a [=clamp point=],
+ then the displaced content must be pushed to the remainder of the [=inline formatting context=].
The UA must treat the block overflow ellipsis as an unbreakable string,
If any part of the [=block overflow ellipsis=] overflows,
@@ -844,7 +849,7 @@ Limiting Visible Lines: the 'line-clamp' shorthand property
<>
<'block-ellipsis'>
- Sets 'continue' to ''discard''
+ Sets 'continue' to ''collapse''
if either or both values ares specified.
Sets 'max-lines' to the specified <>
@@ -901,7 +906,7 @@ Legacy compatibility
For compatibility with legacy content,
UAs that support 'line-clamp' must also support the '-webkit-line-clamp' property
- and the additional ''-webkit-discard'' value for the 'continue' property.
+ and the additional ''-webkit-collapse'' value for the 'continue' property.
Name: -webkit-line-clamp
@@ -912,17 +917,17 @@ Legacy compatibility
Name: continue
- New Values: -webkit-discard
+ New Values: -webkit-collapse
Like 'line-clamp', '-webkit-line-clamp' is a shorthand of 'max-lines', 'continue', and 'block-ellipsis',
except that:
* its syntax is ''line-clamp/none'' | <>
- * it sets 'continue' to ''-webkit-discard'' instead of ''discard''
+ * it sets 'continue' to ''-webkit-collapse'' instead of ''collapse''
* it unconditionally sets 'block-ellipsis' to ''block-ellipsis/auto''
- The -webkit-discard value behaves identically to ''discard'',
+ The -webkit-collapse value behaves identically to ''collapse'',
except that it only takes effect
if the [=specified value=] of the 'display' property
is ''-webkit-box'' or ''-webkit-inline-box''
@@ -947,28 +952,33 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property
Name: max-lines
Value: ''none'' | <>
Initial: ''none''
- Applies to: block containers which are also [=fragmentation containers=] that capture [=region breaks=]
+ Applies to: block containers which are also either [=fragmentation containers=] that capture [=region breaks=] or [=line-clamp containers=]
Inherited: no
Percentages: N/A
Computed value: the keyword ''max-lines/none'' or an integer
Animation type: by computed value type
- This property only has an effect on boxes that are [=fragmentation containers=] that capture [=region breaks=].
+ If the value of 'max-lines' is not none, then, where
+ N is the computed value of 'max-lines':
+
+ - If the box is a [=fragmentation container=] that captures [=region breaks=],
+ a region break or
+ is forced after its Nth
+ descendant in-flow line box.
+ If fewer than N line boxes exist,
+ then 'max-lines' introduces no region break.
+ - If the box is a [=line-clamp container=], its [=clamp point=] is set after its Nth
+ descendant in-flow line box.
+ If fewer than N line boxes exist, then the clamp point is set to the end of the
+ line-clamp container.
- Also, if the value of 'max-lines' is not none,
- a region break
- is forced after its Nth
- descendant in-flow line box,
- where N is the specified value of 'max-lines'.
- Only lines boxes in the same Block Formatting Context
+
+ Only line boxes in the same Block Formatting Context
are counted:
the contents of descendants that establish independent formatting contexts
are skipped over while counting line boxes.
- If fewer than N line boxes exist,
- then 'max-lines' introduces no region break.
-
Note: This implies that 'max-lines' has no effect when applied to [=multi-column containers=],
since any line box they contain are nested into [=independent formatting contexts=].
@@ -1004,7 +1014,7 @@ Fragmentation of Overflow: the 'continue' property
Name: continue
- Value: auto | discard
+ Value: auto | discard | collapse
Initial: ''continue/auto''
Applies to: [=block containers=] and [=multicol containers=]
Inherited: no
@@ -1014,10 +1024,11 @@ Fragmentation of Overflow: the 'continue' property
The 'continue' property gives authors the ability
- to turn a box into a [=fragmentation container=] (see [[!CSS-BREAK-3]])
- and to specify that content after the [=fragmentation break=] must be discarded.
+ to truncate/interrupt the content inside a box, by either visually hiding
+ the remaining content, or by turning the box into a [=fragmentation container=] (see [[!CSS-BREAK-3]])
+ and discarding the content after the [=fragmentation break=].
- Issue: This property is meant to generalize and replace the region-fragment property from [[CSS-REGIONS-1]].
+ Issue: ''continue: discard'' is meant to generalize and replace the region-fragment property from [[CSS-REGIONS-1]].
Once it is sufficiently stable in this specification,
region-fragment should be removed from the regions specification in favor of this.
@@ -1048,6 +1059,15 @@ Fragmentation of Overflow: the 'continue' property
Breaks applying to other [=fragmentation contexts=]
(such as pagination of this box itself)
do not cause any content to be discarded.
+
+ collapse
+
+ If the box is a [=block container=], then it must
+ [=establish an independent formatting context=] that also becomes a [=line-clamp container=].
+ This causes all content after the [=clamp point=] to be visually hidden, and to not be
+ taken into account for the box's [=automatic block size=].
+
+ This keyword has no effect on [=multicol containers=].
@@ -1115,6 +1135,9 @@ Fragmentation of Overflow: the 'continue' property
would cause intrinsic sizes to depend on layout, which would cause circularities.
-->
+ Note: This differs from the ''visibility: hidden''-like behavior of content after the [=clamp
+ point=] with ''continue: collapse''.
+
Note: In the case of
parallel fragmentation flows,
content occurring after the
fragmentation break in the box tree
could still be rendered,
@@ -1123,12 +1146,12 @@ Fragmentation of Overflow: the 'continue' property
Additionaliy,
for compatibility (see [[#webkit-line-clamp]]),
- when the [=computed value=] of the 'continue' property is ''discard''
+ when the [=computed value=] of the 'continue' property is ''collapse'' or ''-webkit-collapse''
and the [=computed value=] of the '-webkit-box-orient' property is ''vertical'':
* If the [=specified value=] of the 'display' property is ''-webkit-box'',
the [=computed value=] becomes ''flow-root'' and
the box establishes a [=BFC=].
- * If the [=specified value=] of the 'display property is ''-webkit-inline-box'',
+ * If the [=specified value=] of the 'display' property is ''-webkit-inline-box'',
the [=computed value=] becomes ''inline-block'' and
the box establishes a [=BFC=].
@@ -1140,6 +1163,46 @@ Fragmentation of Overflow: the 'continue' property
as the box would be a [=flex container=] rather than a [=block container=],
and thus the 'continue' property would not apply.
+
Line-clamp containers
+
+ A
line-clamp container is an [=independent formatting context|independent=] [=block formatting context=] that
+ additionally follows the rules in this section. All line-clamp containers contain a
+
clamp point, which is one of the following positions inside it:
+
+ - The start of the line-clamp container.
+ - A point between two [=in-flow=] sibling boxes in the line-clamp
+ container's [=block formatting context=].
+ - A point between two [=line boxes=] in an in-flow [=inline formatting
+ context=] inside the line-clamp container's [=block formatting context=].
+ - The end of the line-clamp container.
+
+ Note: The [=clamp point=] can never be before a parent box's first child, or
+ after a parent box's last child, unless that parent box is the line-clamp
+ container. Similarly, the clamp point can never be before the first line or
+ after the first line of an [=inline formatting context=]. It can also never
+ be in [=out-of-flow=] content, or inside an [=independent formatting
+ context=].
+
+ If the [=line-clamp container=]'s [=block formatting context root=] has a [=computed value=] of
+ 'max-lines' other than ''max-lines/none'', then that property will determine the [=clamp point=].
+ Otherwise, the clamp point will be set to the last possible clamp point such that, for it and
+ all previous possible clamp points, the line-clamp container's [=automatic block size=] (as
+ determined below) is not greater than the [=block size=] the box would have if its automatic
+ block size were infinite.
+
+ Any boxes in a [=line-clamp container=] that follow its [=clamp point=] in the box tree, as well
+ as any [=line boxes=] that follow it inside an [=inline formatting context=], will be invisible
+ (behaving like ''visibility: hidden''). This includes [=independent formatting contexts=] as
+ well as [=out-of-flow=] boxes, and all of their descendants. Any overflow such boxes and line
+ boxes might have is always counted as [=ink overflow=] rather than [=scrollable overflow=].
+
+ NOTE: This differs from the ''display: none''-like behavior of not rendered content with
+ ''continue: discard''.
+
+ If a [=block container=] contains a [=clamp point=], within itself or in any of its descendants,
+ its [=automatic block size=] will not take into account any of its children after the clamp point.
+ This also applies for the [=line-clamp container=] itself.
+
Appendix A: Possible extensions for ''scrollbar-gutter''
From c7df9c98f80dca9cae99369a8f30162928f6e50e Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Sun, 15 Sep 2024 01:25:50 +0200
Subject: [PATCH 02/13] Clarification about float clearance in the automatic
block size
---
css-overflow-4/Overview.bs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 3f828d3ac9b..c322df1d40c 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -1203,6 +1203,12 @@ Fragmentation of Overflow: the 'continue' property
its [=automatic block size=] will not take into account any of its children after the clamp point.
This also applies for the [=line-clamp container=] itself.
+ NOTE: If there are any floats before the [=clamp point=], the [=line-clamp container=]'s
+ automatic size must grow to encompass the clearance, just like it would if it were a regular
+ [=block formatting context=] root that only contained its contents before the [=clamp point=].
+ This is regardless of whether this would cause any content after the [=clamp point=] to be
+ within the container's bounds.
+
Appendix A: Possible extensions for ''scrollbar-gutter''
From 1699d89b19296b9715e79d5092f4e41ab30ee35c Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Fri, 4 Oct 2024 08:36:34 +0900
Subject: [PATCH 03/13] Update to only allow clamping after a line
---
css-overflow-4/Overview.bs | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index c322df1d40c..56013f5f97d 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -712,8 +712,8 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property
It only affects line boxes contained directly by the block container itself,
but as it inherits, will have an effect on descendants’ line boxes unless overridden.
- This property only affects a line box if there is eiher a [=region break=] or a [=clamp point=]
- after it in the [=block formatting context=], and there are no boxes or line boxes in between.
+ This property only affects a line box if it immediately precedes
+ eiher a [=region break=] or a [=clamp point=] in the [=block formatting context=].
If the [=clamp point=] is placed at the end of the [=line-clamp container=], then the line will
not be affected.
@@ -1169,26 +1169,18 @@ Fragmentation of Overflow: the 'continue' property
additionally follows the rules in this section. All line-clamp containers contain a
clamp point, which is one of the following positions inside it:
- - The start of the line-clamp container.
- - A point between two [=in-flow=] sibling boxes in the line-clamp
- container's [=block formatting context=].
- - A point between two [=line boxes=] in an in-flow [=inline formatting
- context=] inside the line-clamp container's [=block formatting context=].
- - The end of the line-clamp container.
-
- Note: The [=clamp point=] can never be before a parent box's first child, or
- after a parent box's last child, unless that parent box is the line-clamp
- container. Similarly, the clamp point can never be before the first line or
- after the first line of an [=inline formatting context=]. It can also never
- be in [=out-of-flow=] content, or inside an [=independent formatting
- context=].
+ - A point immediately after a [=line box=] in the line-clamp container's [=block formatting
+ context=].
+ - The end of the line-clamp container, if there are any boxes after the last [=inline formatting
+ context=] in the line-clamp container's [=block formatting context=].
If the [=line-clamp container=]'s [=block formatting context root=] has a [=computed value=] of
'max-lines' other than ''max-lines/none'', then that property will determine the [=clamp point=].
Otherwise, the clamp point will be set to the last possible clamp point such that, for it and
all previous possible clamp points, the line-clamp container's [=automatic block size=] (as
determined below) is not greater than the [=block size=] the box would have if its automatic
- block size were infinite.
+ block size were infinite; or if that is not the case for any clamp points, to the first clamp
+ point in the block formatting context.
Any boxes in a [=line-clamp container=] that follow its [=clamp point=] in the box tree, as well
as any [=line boxes=] that follow it inside an [=inline formatting context=], will be invisible
From ee8fab92fae27523e90748eb604f4dc83fc88ebf Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Tue, 3 Dec 2024 10:10:19 +0100
Subject: [PATCH 04/13] Apply suggestions from code review
Co-authored-by: Florian Rivoal
---
css-overflow-4/Overview.bs | 112 +++++++++++++++++++++----------------
1 file changed, 65 insertions(+), 47 deletions(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 56013f5f97d..7b6b6c4750e 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -712,10 +712,11 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property
It only affects line boxes contained directly by the block container itself,
but as it inherits, will have an effect on descendants’ line boxes unless overridden.
- This property only affects a line box if it immediately precedes
- eiher a [=region break=] or a [=clamp point=] in the [=block formatting context=].
- If the [=clamp point=] is placed at the end of the [=line-clamp container=], then the line will
- not be affected.
+ This property only affects a line box
+ if it immediately precedes eiher a [=region break=]
+ or a [=clamp point=] in the [=block formatting context=].
+ If the [=clamp point=] is placed at the end of the [=line-clamp container=],
+ then the line will not be affected.
Note: See [[css-overflow-4#fragmentation]] for a way to generate boxes with such a [=region break=].
@@ -784,7 +785,8 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property
there is a subsequent fragmentation container in the [=fragmentation context=]
that would receive subsequent content,
then the content displaced by the block overflow ellipsis
- must be pushed to that fragmentation container. If it is placed before a [=clamp point=],
+ must be pushed to that fragmentation container.
+ If it is placed before a [=clamp point=],
then the displaced content must be pushed to the remainder of the [=inline formatting context=].
The UA must treat the block overflow ellipsis as an unbreakable string,
@@ -849,6 +851,9 @@ Limiting Visible Lines: the 'line-clamp' shorthand property
<>
<'block-ellipsis'>
+
+ Issue(7708): Whether this should imply ''discard'' or ''collapse'' is an unresolved question.
+
Sets 'continue' to ''collapse''
if either or both values ares specified.
@@ -959,19 +964,20 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property
Animation type: by computed value type
- If the value of 'max-lines' is not none, then, where
- N is the computed value of 'max-lines':
+ If the value of 'max-lines' is not none,
+ then, given a [=computed value=] of N:
- If the box is a [=fragmentation container=] that captures [=region breaks=],
- a region break or
+ a region break
is forced after its Nth
descendant in-flow line box.
If fewer than N line boxes exist,
then 'max-lines' introduces no region break.
- - If the box is a [=line-clamp container=], its [=clamp point=] is set after its Nth
+ - If the box is a [=line-clamp container=],
+ its [=clamp point=] is set after its Nth
descendant in-flow line box.
- If fewer than N line boxes exist, then the clamp point is set to the end of the
- line-clamp container.
+ If fewer than N line boxes exist,
+ then the clamp point is set to the end of the line-clamp container.
Only line boxes in the same Block Formatting Context
@@ -1024,8 +1030,9 @@ Fragmentation of Overflow: the 'continue' property
The 'continue' property gives authors the ability
- to truncate/interrupt the content inside a box, by either visually hiding
- the remaining content, or by turning the box into a [=fragmentation container=] (see [[!CSS-BREAK-3]])
+ to truncate/interrupt the content inside a box,
+ either by visually hiding the remaining content,
+ or by turning the box into a [=fragmentation container=] (see [[!CSS-BREAK-3]])
and discarding the content after the [=fragmentation break=].
Issue: ''continue: discard'' is meant to generalize and replace the region-fragment property from [[CSS-REGIONS-1]].
@@ -1135,8 +1142,8 @@ Fragmentation of Overflow: the 'continue' property
would cause intrinsic sizes to depend on layout, which would cause circularities.
-->
- Note: This differs from the ''visibility: hidden''-like behavior of content after the [=clamp
- point=] with ''continue: collapse''.
+ Note: This differs from the ''visibility: hidden''-like behavior
+ of content after the [=clamp point=] with ''continue: collapse''.
Note: In the case of parallel fragmentation flows,
content occurring after the fragmentation break in the box tree
@@ -1165,41 +1172,52 @@ Fragmentation of Overflow: the 'continue' property
Line-clamp containers
- A line-clamp container is an [=independent formatting context|independent=] [=block formatting context=] that
- additionally follows the rules in this section. All line-clamp containers contain a
- clamp point, which is one of the following positions inside it:
-
- - A point immediately after a [=line box=] in the line-clamp container's [=block formatting
- context=].
- - The end of the line-clamp container, if there are any boxes after the last [=inline formatting
- context=] in the line-clamp container's [=block formatting context=].
-
- If the [=line-clamp container=]'s [=block formatting context root=] has a [=computed value=] of
- 'max-lines' other than ''max-lines/none'', then that property will determine the [=clamp point=].
- Otherwise, the clamp point will be set to the last possible clamp point such that, for it and
- all previous possible clamp points, the line-clamp container's [=automatic block size=] (as
- determined below) is not greater than the [=block size=] the box would have if its automatic
- block size were infinite; or if that is not the case for any clamp points, to the first clamp
- point in the block formatting context.
-
- Any boxes in a [=line-clamp container=] that follow its [=clamp point=] in the box tree, as well
- as any [=line boxes=] that follow it inside an [=inline formatting context=], will be invisible
- (behaving like ''visibility: hidden''). This includes [=independent formatting contexts=] as
- well as [=out-of-flow=] boxes, and all of their descendants. Any overflow such boxes and line
- boxes might have is always counted as [=ink overflow=] rather than [=scrollable overflow=].
-
- NOTE: This differs from the ''display: none''-like behavior of not rendered content with
- ''continue: discard''.
-
- If a [=block container=] contains a [=clamp point=], within itself or in any of its descendants,
+ A line-clamp container is an [=independent formatting context|independent=] [=block formatting context=]
+ that additionally follows the rules in this section.
+ All line-clamp containers contain a clamp point,
+ which is one of the following positions inside it:
+
+ - A point immediately after a [=line box=]
+ in the line-clamp container's [=block formatting context=].
+ - The end of the line-clamp container,
+ if there are any boxes after the last [=inline formatting context=]
+ in the line-clamp container's [=block formatting context=].
+
+ If the [=line-clamp container=]'s [=block formatting context root=]
+ has a [=computed value=] of 'max-lines' other than ''max-lines/none'',
+ then that property will determine the [=clamp point=].
+ Otherwise, the clamp point will be set to the last possible clamp point
+ such that, for it and all previous possible clamp points,
+ the line-clamp container's [=automatic block size=]
+ (as determined below)
+ is not greater than the [=block size=] the box would have
+ if its automatic block size were infinite;
+ or if that is not the case for any possible clamp points,
+ to the first possible clamp point in the block formatting context.
+
+ Any boxes in a [=line-clamp container=] that follow its [=clamp point=] in the box tree,
+ as well as any [=line boxes=] that follow it inside an [=inline formatting context=],
+ will be invisible (behaving like ''visibility: hidden'').
+ This includes [=independent formatting contexts=]
+ as well as [=out-of-flow=] boxes,
+ and all of their descendants.
+ Any overflow such boxes and line boxes might have
+ is always counted as [=ink overflow=] rather than [=scrollable overflow=].
+
+ NOTE: This differs from the ''display: none''-like behavior
+ of not rendered content with ''continue: discard''.
+
+ If a [=block container=] contains a [=clamp point=],
+ within itself or in any of its descendants,
its [=automatic block size=] will not take into account any of its children after the clamp point.
This also applies for the [=line-clamp container=] itself.
- NOTE: If there are any floats before the [=clamp point=], the [=line-clamp container=]'s
- automatic size must grow to encompass the clearance, just like it would if it were a regular
- [=block formatting context=] root that only contained its contents before the [=clamp point=].
- This is regardless of whether this would cause any content after the [=clamp point=] to be
- within the container's bounds.
+ NOTE: If there are any floats before the [=clamp point=],
+ the [=line-clamp container=]'s automatic size must grow to encompass the clearance,
+ just like it would if it were a regular [=block formatting context=] root
+ that only contained its contents before the [=clamp point=].
+ This is regardless of whether this would cause any content after the [=clamp point=]
+ to be within the container's bounds.
Appendix A: Possible extensions for ''scrollbar-gutter''
From 178c050a2cc44d97d48ba970e3b0c7b59f8821ab Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Tue, 3 Dec 2024 10:35:22 +0100
Subject: [PATCH 05/13] Update css-overflow-4/Overview.bs
Co-authored-by: Florian Rivoal
---
css-overflow-4/Overview.bs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 7b6b6c4750e..4e5b7d63bc5 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -1153,7 +1153,7 @@ Fragmentation of Overflow: the 'continue' property
Additionaliy,
for compatibility (see [[#webkit-line-clamp]]),
- when the [=computed value=] of the 'continue' property is ''collapse'' or ''-webkit-collapse''
+ when the [=computed value=] of the 'continue' property is '''collapse'', ''-webkit-collapse'', or ''discard''
and the [=computed value=] of the '-webkit-box-orient' property is ''vertical'':
* If the [=specified value=] of the 'display' property is ''-webkit-box'',
the [=computed value=] becomes ''flow-root'' and
From c9aadd345fcfe908fdabd4f3ca642db8e80dac32 Mon Sep 17 00:00:00 2001
From: "Tab Atkins Jr."
Date: Fri, 23 May 2025 15:37:14 -0700
Subject: [PATCH 06/13] Update css-overflow-4/Overview.bs
---
css-overflow-4/Overview.bs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 4e5b7d63bc5..f7731eb9b0b 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -968,16 +968,16 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property
then, given a [=computed value=] of N:
- If the box is a [=fragmentation container=] that captures [=region breaks=],
- a region break
- is forced after its Nth
- descendant in-flow line box.
- If fewer than N line boxes exist,
- then 'max-lines' introduces no region break.
+ a region break
+ is forced after its Nth
+ descendant in-flow line box.
+ If fewer than N line boxes exist,
+ then 'max-lines' introduces no region break.
- If the box is a [=line-clamp container=],
- its [=clamp point=] is set after its Nth
- descendant in-flow line box.
- If fewer than N line boxes exist,
- then the clamp point is set to the end of the line-clamp container.
+ its [=clamp point=] is set after its Nth
+ descendant in-flow line box.
+ If fewer than N line boxes exist,
+ then the clamp point is set to the end of the line-clamp container.
Only line boxes in the same Block Formatting Context
From ce29a7af28906cb5db5b414b901a89fa711396ad Mon Sep 17 00:00:00 2001
From: "Tab Atkins Jr."
Date: Fri, 23 May 2025 15:37:22 -0700
Subject: [PATCH 07/13] Update css-overflow-4/Overview.bs
---
css-overflow-4/Overview.bs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index f7731eb9b0b..85c8eecf00a 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -980,7 +980,7 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property
then the clamp point is set to the end of the line-clamp container.
- Only line boxes in the same Block Formatting Context
+ Only line boxes in the same block formatting context
are counted:
the contents of descendants that establish independent formatting contexts
are skipped over while counting line boxes.
From 716ddfc64183bee79fec40ba8f7b3ac1ecd5f14e Mon Sep 17 00:00:00 2001
From: "Tab Atkins Jr."
Date: Fri, 23 May 2025 15:37:30 -0700
Subject: [PATCH 08/13] Update css-overflow-4/Overview.bs
---
css-overflow-4/Overview.bs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 85c8eecf00a..c456f164ed3 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -1172,7 +1172,7 @@ Fragmentation of Overflow: the 'continue' property
Line-clamp containers
- A line-clamp container is an [=independent formatting context|independent=] [=block formatting context=]
+ A line-clamp container is an [=independent formatting context|independent=] [=block formatting context=]
that additionally follows the rules in this section.
All line-clamp containers contain a clamp point,
which is one of the following positions inside it:
From 0db0a52ee017693c517897f019c195a34eefddc1 Mon Sep 17 00:00:00 2001
From: "Tab Atkins Jr."
Date: Fri, 23 May 2025 15:37:37 -0700
Subject: [PATCH 09/13] Update css-overflow-4/Overview.bs
---
css-overflow-4/Overview.bs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index c456f164ed3..37f8b4415b1 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -1175,7 +1175,7 @@ Fragmentation of Overflow: the 'continue' property
A line-clamp container is an [=independent formatting context|independent=] [=block formatting context=]
that additionally follows the rules in this section.
All line-clamp containers contain a clamp point,
- which is one of the following positions inside it:
+ which is one of the following block-axis positions inside it:
- A point immediately after a [=line box=]
in the line-clamp container's [=block formatting context=].
From e5b5c69d0f88172b0cba290149a198be78a28134 Mon Sep 17 00:00:00 2001
From: "Tab Atkins Jr."
Date: Fri, 23 May 2025 15:37:45 -0700
Subject: [PATCH 10/13] Update css-overflow-4/Overview.bs
---
css-overflow-4/Overview.bs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 37f8b4415b1..2cee7415f8d 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -1197,7 +1197,7 @@ Fragmentation of Overflow: the 'continue' property
Any boxes in a [=line-clamp container=] that follow its [=clamp point=] in the box tree,
as well as any [=line boxes=] that follow it inside an [=inline formatting context=],
- will be invisible (behaving like ''visibility: hidden'').
+ become [=invisible boxes=].
This includes [=independent formatting contexts=]
as well as [=out-of-flow=] boxes,
and all of their descendants.
From 6398998ae529e7079069775f7fe53bdca2dcbbb3 Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Tue, 22 Apr 2025 17:37:19 +0200
Subject: [PATCH 11/13] Update for #10439
---
css-overflow-4/Overview.bs | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 2cee7415f8d..bae50cb89a5 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -817,7 +817,7 @@ Limiting Visible Lines: the 'line-clamp' shorthand property
Name: line-clamp
- Value: none | <> || <<'block-ellipsis'>>
+ Value: none | [<> || <<'block-ellipsis'>>] ''-webkit-legacy''?
Initial: none
Percentages: N/A
@@ -855,13 +855,17 @@ Limiting Visible Lines: the 'line-clamp' shorthand property
Issue(7708): Whether this should imply ''discard'' or ''collapse'' is an unresolved question.
Sets 'continue' to ''collapse''
- if either or both values ares specified.
+ if either or both values are specified,
+ unless the ''line-clamp/-webkit-legacy'' keyword is also specified.
Sets 'max-lines' to the specified <>
or to ''max-lines/none'' if omitted,
and 'block-ellipsis' to other component of the value if specified
or to ''block-ellipsis/auto'' if omitted.
+ -webkit-legacy
+ Sets 'continue' to ''continue/-webkit-legacy''.
+
See the corresponding longhand properties for details
@@ -911,7 +915,7 @@ Legacy compatibility
For compatibility with legacy content,
UAs that support 'line-clamp' must also support the '-webkit-line-clamp' property
- and the additional ''-webkit-collapse'' value for the 'continue' property.
+ and the additional ''continue/-webkit-legacy'' value for the 'continue' property.
Name: -webkit-line-clamp
@@ -922,17 +926,18 @@ Legacy compatibility
Name: continue
- New Values: -webkit-collapse
+ New Values: -webkit-legacy
Like 'line-clamp', '-webkit-line-clamp' is a shorthand of 'max-lines', 'continue', and 'block-ellipsis',
except that:
* its syntax is ''line-clamp/none'' | <>
- * it sets 'continue' to ''-webkit-collapse'' instead of ''collapse''
+ * it sets 'continue' to ''continue/-webkit-legacy'' instead of ''collapse''
+ (as if the ''line-clamp/-webkit-legacy'' keyword was set on 'line-clamp')
* it unconditionally sets 'block-ellipsis' to ''block-ellipsis/auto''
- The -webkit-collapse value behaves identically to ''collapse'',
+ The -webkit-legacy value behaves identically to ''collapse'',
except that it only takes effect
if the [=specified value=] of the 'display' property
is ''-webkit-box'' or ''-webkit-inline-box''
@@ -1153,7 +1158,7 @@ Fragmentation of Overflow: the 'continue' property
Additionaliy,
for compatibility (see [[#webkit-line-clamp]]),
- when the [=computed value=] of the 'continue' property is '''collapse'', ''-webkit-collapse'', or ''discard''
+ when the [=computed value=] of the 'continue' property is ''collapse'', ''continue/-webkit-legacy'', or ''discard''
and the [=computed value=] of the '-webkit-box-orient' property is ''vertical'':
* If the [=specified value=] of the 'display' property is ''-webkit-box'',
the [=computed value=] becomes ''flow-root'' and
From 94503b348f370b31b2f3210470f537f9c1bee05d Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Tue, 22 Apr 2025 17:43:26 +0200
Subject: [PATCH 12/13] Update for #11962
---
css-overflow-4/Overview.bs | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index bae50cb89a5..36e74377d6a 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -1200,13 +1200,20 @@ Fragmentation of Overflow: the 'continue' property
or if that is not the case for any possible clamp points,
to the first possible clamp point in the block formatting context.
- Any boxes in a [=line-clamp container=] that follow its [=clamp point=] in the box tree,
- as well as any [=line boxes=] that follow it inside an [=inline formatting context=],
- become [=invisible boxes=].
- This includes [=independent formatting contexts=]
- as well as [=out-of-flow=] boxes,
- and all of their descendants.
- Any overflow such boxes and line boxes might have
+ Within a [=line-clamp container=],
+ the following boxes and line boxes become [=invisible boxes=]:
+
+ - Any [=in-flow=] or floating boxes
+ that follow the [=clamp point=] in the box tree.
+ This includes [=independent formatting contexts=]
+ and all of their descendants.
+ - Any [=line boxes=] that follow the [=clamp point=]
+ inside an [=inline formatting context=].
+ - Any [=absolutely positioned box=]
+ which has an invisible box within its [=containing block chain=],
+ and all of its descendants.
+
+ Any overflow such invisible boxes and line boxes might have
is always counted as [=ink overflow=] rather than [=scrollable overflow=].
NOTE: This differs from the ''display: none''-like behavior
@@ -1214,7 +1221,7 @@ Fragmentation of Overflow: the 'continue' property
If a [=block container=] contains a [=clamp point=],
within itself or in any of its descendants,
- its [=automatic block size=] will not take into account any of its children after the clamp point.
+ its [=automatic block size=] will not take into account any invisible boxes.
This also applies for the [=line-clamp container=] itself.
NOTE: If there are any floats before the [=clamp point=],
From cb6491ab802366fbb27ba164bb0d0b7caaef9c85 Mon Sep 17 00:00:00 2001
From: Andreu Botella
Date: Tue, 22 Apr 2025 17:43:58 +0200
Subject: [PATCH 13/13] Update for #10868
---
css-overflow-4/Overview.bs | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/css-overflow-4/Overview.bs b/css-overflow-4/Overview.bs
index 36e74377d6a..6aae232a529 100644
--- a/css-overflow-4/Overview.bs
+++ b/css-overflow-4/Overview.bs
@@ -715,8 +715,6 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property
This property only affects a line box
if it immediately precedes eiher a [=region break=]
or a [=clamp point=] in the [=block formatting context=].
- If the [=clamp point=] is placed at the end of the [=line-clamp container=],
- then the line will not be affected.
Note: See [[css-overflow-4#fragmentation]] for a way to generate boxes with such a [=region break=].
@@ -853,7 +851,7 @@ Limiting Visible Lines: the 'line-clamp' shorthand property
Issue(7708): Whether this should imply ''discard'' or ''collapse'' is an unresolved question.
-
+
Sets 'continue' to ''collapse''
if either or both values are specified,
unless the ''line-clamp/-webkit-legacy'' keyword is also specified.
@@ -979,10 +977,13 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property
If fewer than N line boxes exist,
then 'max-lines' introduces no region break.
- If the box is a [=line-clamp container=],
- its [=clamp point=] is set after its Nth
+ its [=clamp point=] is set
+ to the first possible clamp point after
+ its Nth
descendant in-flow line box.
If fewer than N line boxes exist,
- then the clamp point is set to the end of the line-clamp container.
+ or if there are no clamp points after it,
+ then that line-clamp container has no clamp point.
Only line boxes in the same block formatting context
@@ -1179,13 +1180,14 @@ Fragmentation of Overflow: the 'continue' property
A line-clamp container is an [=independent formatting context|independent=] [=block formatting context=]
that additionally follows the rules in this section.
- All line-clamp containers contain a clamp point,
+ Line-clamp containers can have a clamp point,
which is one of the following block-axis positions inside it:
- - A point immediately after a [=line box=]
- in the line-clamp container's [=block formatting context=].
- - The end of the line-clamp container,
- if there are any boxes after the last [=inline formatting context=]
+ - The start of the [=line-clamp container=].
+ - A point between two consecutive [=line boxes=]
+ in an [=inline formatting context=]
+ contained by the line-clamp container's [=block formatting context=].
+ - A point between two [=in-flow=] [=block-level=] sibling boxes
in the line-clamp container's [=block formatting context=].
If the [=line-clamp container=]'s [=block formatting context root=]
@@ -1196,9 +1198,9 @@ Fragmentation of Overflow: the 'continue' property
the line-clamp container's [=automatic block size=]
(as determined below)
is not greater than the [=block size=] the box would have
- if its automatic block size were infinite;
- or if that is not the case for any possible clamp points,
- to the first possible clamp point in the block formatting context.
+ if its automatic block size were infinite.
+ If the [=block size=] would be infinite,
+ then there is no clamp point.
Within a [=line-clamp container=],
the following boxes and line boxes become [=invisible boxes=]: