@@ -707,12 +707,15 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property</h3>
707
707
</pre>
708
708
709
709
This property allows inserting content into the last line box
710
- before a (forced <em> or</em> unforced) <a>region break</a>
711
- to indicate the continuity of truncated/ interrupted content.
710
+ before a (forced <em> or</em> unforced) <a>region break</a> or a [=clamp point=]
711
+ to indicate the continuity of truncated / interrupted content.
712
712
It only affects line boxes contained directly by the <a>block container</a> itself,
713
713
but as it inherits, will have an effect on descendants’ line boxes unless overridden.
714
- If the box contains no line box immediately preceding a <a>region break</a> ,
715
- then this property has no effect.
714
+
715
+ This property only affects a line box if there is eiher a [=region break=] or a [=clamp point=]
716
+ after it in the [=block formatting context=] , and there are no boxes or line boxes in between.
717
+ If the [=clamp point=] is placed at the end of the [=line-clamp container=] , then the line will
718
+ not be affected.
716
719
717
720
Note: See [[css-overflow-4#fragmentation]] for a way to generate boxes with such a [=region break=] .
718
721
@@ -777,10 +780,12 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property</h3>
777
780
The [=block overflow ellipsis=] must not be included
778
781
in either the ''::first-letter'' nor the ''::first-line'' pseudo-elements.
779
782
780
- If there is a subsequent <a>fragmentation container</a> in the [=fragmentation context=]
783
+ If the [=block overflow ellipsis=] is placed before a [=region break=] and
784
+ there is a subsequent <a>fragmentation container</a> in the [=fragmentation context=]
781
785
that would receive subsequent content,
782
786
then the content displaced by the <a>block overflow ellipsis</a>
783
- must be pushed to that <a>fragmentation container</a> .
787
+ must be pushed to that <a>fragmentation container</a> . If it is placed before a [=clamp point=] ,
788
+ then the displaced content must be pushed to the remainder of the [=inline formatting context=] .
784
789
785
790
The UA must treat the <a>block overflow ellipsis</a> as an unbreakable string,
786
791
If any part of the [=block overflow ellipsis=] overflows,
@@ -844,7 +849,7 @@ Limiting Visible Lines: the 'line-clamp' shorthand property</h3>
844
849
<dt> <dfn><<integer [1,∞]>></dfn>
845
850
</dt> <dfn><'block-ellipsis'></dfn>
846
851
<dd>
847
- Sets 'continue' to ''discard ''
852
+ Sets 'continue' to ''collapse ''
848
853
if either or both values ares specified.
849
854
850
855
Sets 'max-lines' to the specified <<integer>>
@@ -901,7 +906,7 @@ Legacy compatibility</h4>
901
906
902
907
For compatibility with legacy content,
903
908
UAs that support 'line-clamp' must also support the '-webkit-line-clamp' property
904
- and the additional ''-webkit-discard '' value for the 'continue' property.
909
+ and the additional ''-webkit-collapse '' value for the 'continue' property.
905
910
906
911
<pre class="propdef shorthand">
907
912
Name : -webkit-line-clamp
@@ -912,17 +917,17 @@ Legacy compatibility</h4>
912
917
913
918
<pre class="propdef partial">
914
919
Name : continue
915
- New Values : -webkit-discard
920
+ New Values : -webkit-collapse
916
921
</pre>
917
922
918
923
Like 'line-clamp' , '-webkit-line-clamp' is a shorthand of 'max-lines' , 'continue' , and 'block-ellipsis' ,
919
924
except that:
920
925
921
926
* its syntax is ''line-clamp/none'' | <<integer [1,∞]>>
922
- * it sets 'continue' to ''-webkit-discard '' instead of ''discard ''
927
+ * it sets 'continue' to ''-webkit-collapse '' instead of ''collapse ''
923
928
* it unconditionally sets 'block-ellipsis' to ''block-ellipsis/auto''
924
929
925
- The <dfn value for=continue>-webkit-discard </dfn> value behaves identically to ''discard '' ,
930
+ The <dfn value for=continue>-webkit-collapse </dfn> value behaves identically to ''collapse '' ,
926
931
except that it only takes effect
927
932
if the [=specified value=] of the 'display' property
928
933
is ''-webkit-box'' or ''-webkit-inline-box''
@@ -947,28 +952,33 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property</h3>
947
952
Name : max-lines
948
953
Value : ''none'' | <<integer [1,∞]>>
949
954
Initial : ''none''
950
- Applies to : <a>block containers</a> which are also [=fragmentation containers=] that capture [=region breaks=]
955
+ Applies to : <a>block containers</a> which are also either [=fragmentation containers=] that capture [=region breaks=] or [=line-clamp containers =]
951
956
Inherited : no
952
957
Percentages : N/A
953
958
Computed value : the keyword ''max-lines/none'' or an integer
954
959
Animation type : by computed value type
955
960
</pre>
956
961
957
- This property only has an effect on boxes that are [=fragmentation containers=] that capture [=region breaks=] .
962
+ If the value of 'max-lines' is not <dfn for=max-lines dfn-type=value>none</dfn> , then, where
963
+ <var> N</var> is the computed value of 'max-lines' :
964
+
965
+ - If the box is a [=fragmentation container=] that captures [=region breaks=] ,
966
+ a <a>region break</a> or
967
+ is forced after its <var> N</var> th
968
+ descendant <a>in-flow</a> <a>line box</a> .
969
+ If fewer than <var> N</var> line boxes exist,
970
+ then 'max-lines' introduces no <a>region break</a> .
971
+ - If the box is a [=line-clamp container=] , its [=clamp point=] is set after its <var> N</var> th
972
+ descendant <a>in-flow</a> <a>line box</a> .
973
+ If fewer than <var> N</var> line boxes exist, then the clamp point is set to the end of the
974
+ line-clamp container.
958
975
959
- Also, if the value of 'max-lines' is not <dfn for=max-lines dfn-type=value>none</dfn> ,
960
- a <a>region break</a>
961
- is forced after its <var> N</var> th
962
- descendant <a>in-flow</a> <a>line box</a> ,
963
- where <var> N</var> is the specified value of 'max-lines' .
964
- Only lines boxes in the same <a>Block Formatting Context</a>
976
+
977
+ Only line boxes in the same <a>Block Formatting Context</a>
965
978
are counted:
966
979
the contents of descendants that establish <a>independent formatting contexts</a>
967
980
are skipped over while counting line boxes.
968
981
969
- If fewer than <var> N</var> line boxes exist,
970
- then 'max-lines' introduces no <a>region break</a> .
971
-
972
982
Note: This implies that 'max-lines' has no effect when applied to [=multi-column containers=] ,
973
983
since any line box they contain are nested into [=independent formatting contexts=] .
974
984
@@ -1004,7 +1014,7 @@ Fragmentation of Overflow: the 'continue' property</h3>
1004
1014
1005
1015
<pre class=propdef>
1006
1016
Name : continue
1007
- Value : auto | discard
1017
+ Value : auto | discard | collapse
1008
1018
Initial : ''continue/auto''
1009
1019
Applies to : [=block containers=] and [=multicol containers=]
1010
1020
Inherited : no
@@ -1014,10 +1024,11 @@ Fragmentation of Overflow: the 'continue' property</h3>
1014
1024
</pre>
1015
1025
1016
1026
The 'continue' property gives authors the ability
1017
- to turn a box into a [=fragmentation container=] (see [[!CSS-BREAK-3]] )
1018
- and to specify that content after the [=fragmentation break=] must be discarded.
1027
+ to truncate/interrupt the content inside a box, by either visually hiding
1028
+ the remaining content, or by turning the box into a [=fragmentation container=] (see [[!CSS-BREAK-3]] )
1029
+ and discarding the content after the [=fragmentation break=] .
1019
1030
1020
- Issue: This property is meant to generalize and replace the <code> region-fragment</code> property from [[CSS-REGIONS-1]] .
1031
+ Issue: ''continue: discard'' is meant to generalize and replace the <code> region-fragment</code> property from [[CSS-REGIONS-1]] .
1021
1032
Once it is sufficiently stable in this specification,
1022
1033
<code> region-fragment</code> should be removed from the regions specification in favor of this.
1023
1034
@@ -1048,6 +1059,15 @@ Fragmentation of Overflow: the 'continue' property</h3>
1048
1059
Breaks applying to other [=fragmentation contexts=]
1049
1060
(such as pagination of this box itself)
1050
1061
do not cause any content to be discarded.
1062
+
1063
+ <dt> <dfn>collapse</dfn>
1064
+ <dd>
1065
+ If the box is a [=block container=] , then it must
1066
+ [=establish an independent formatting context=] that also becomes a [=line-clamp container=] .
1067
+ This causes all content after the [=clamp point=] to be visually hidden, and to not be
1068
+ taken into account for the box's [=automatic block size=] .
1069
+
1070
+ This keyword has no effect on [=multicol containers=] .
1051
1071
</dl>
1052
1072
1053
1073
<div class=example>
@@ -1115,6 +1135,9 @@ Fragmentation of Overflow: the 'continue' property</h3>
1115
1135
would cause intrinsic sizes to depend on layout, which would cause circularities.
1116
1136
-->
1117
1137
1138
+ Note: This differs from the ''visibility: hidden'' -like behavior of content after the [=clamp
1139
+ point=] with ''continue: collapse'' .
1140
+
1118
1141
Note: In the case of <a href="https://www.w3.org/TR/css-break-3/#parallel-flows">parallel fragmentation flows</a> ,
1119
1142
content occurring after the <a>fragmentation break</a> in the box tree
1120
1143
could still be rendered,
@@ -1123,13 +1146,13 @@ Fragmentation of Overflow: the 'continue' property</h3>
1123
1146
1124
1147
Additionaliy,
1125
1148
for compatibility (see [[#webkit-line-clamp]] ),
1126
- when the [=computed value=] of the 'continue' property is ''discard ''
1149
+ when the [=computed value=] of the 'continue' property is ''collapse'' or ''-webkit-collapse ''
1127
1150
and the [=computed value=] of the '-webkit-box-orient' property is ''vertical'' :
1128
1151
* If the [=specified value=] of the 'display' property is ''-webkit-box'' ,
1129
- the [=computed value=] is becomes ''flow-root'' and
1152
+ the [=computed value=] becomes ''flow-root'' and
1130
1153
the box establishes a [=BFC=] .
1131
- * If the [=specified value=] of the 'display property is ''-webkit-inline-box' ',
1132
- the [=computed value=] is becomes ''inline-block'' and
1154
+ * If the [=specified value=] of the 'display' property is ''-webkit-inline-box'' ,
1155
+ the [=computed value=] becomes ''inline-block'' and
1133
1156
the box establishes a [=BFC=] .
1134
1157
1135
1158
Note: This means that 'line-clamp' will work
@@ -1140,6 +1163,46 @@ Fragmentation of Overflow: the 'continue' property</h3>
1140
1163
as the box would be a [=flex container=] rather than a [=block container=] ,
1141
1164
and thus the 'continue' property would not apply.
1142
1165
1166
+ <h4 id=line-clamp-containers>Line-clamp containers</h4>
1167
+
1168
+ A <dfn>line-clamp container</dfn> is an [=independent formatting context|independent=] [=block formatting context=] that
1169
+ additionally follows the rules in this section. All line-clamp containers contain a
1170
+ <dfn>clamp point</dfn> , which is one of the following positions inside it:
1171
+
1172
+ - The start of the line-clamp container.
1173
+ - A point between two [=in-flow=] sibling boxes in the line-clamp
1174
+ container's [=block formatting context=] .
1175
+ - A point between two [=line boxes=] in an in-flow [=inline formatting
1176
+ context=] inside the line-clamp container's [=block formatting context=] .
1177
+ - The end of the line-clamp container.
1178
+
1179
+ Note: The [=clamp point=] can never be before a parent box's first child, or
1180
+ after a parent box's last child, unless that parent box is the line-clamp
1181
+ container. Similarly, the clamp point can never be before the first line or
1182
+ after the first line of an [=inline formatting context=] . It can also never
1183
+ be in [=out-of-flow=] content, or inside an [=independent formatting
1184
+ context=] .
1185
+
1186
+ If the [=line-clamp container=] 's [=block formatting context root=] has a [=computed value=] of
1187
+ 'max-lines' other than ''max-lines/none'' , then that property will determine the [=clamp point=] .
1188
+ Otherwise, the clamp point will be set to the last possible clamp point such that, for it and
1189
+ all previous possible clamp points, the line-clamp container's [=automatic block size=] (as
1190
+ determined below) is not greater than the [=block size=] the box would have if its automatic
1191
+ block size were infinite.
1192
+
1193
+ Any boxes in a [=line-clamp container=] that follow its [=clamp point=] in the box tree, as well
1194
+ as any [=line boxes=] that follow it inside an [=inline formatting context=] , will be invisible
1195
+ (behaving like ''visibility: hidden'' ). This includes [=independent formatting contexts=] as
1196
+ well as [=out-of-flow=] boxes, and all of their descendants. Any overflow such boxes and line
1197
+ boxes might have is always counted as [=ink overflow=] rather than [=scrollable overflow=] .
1198
+
1199
+ NOTE: This differs from the ''display: none'' -like behavior of not rendered content with
1200
+ ''continue: discard'' .
1201
+
1202
+ If a [=block container=] contains a [=clamp point=] , within itself or in any of its descendants,
1203
+ its [=automatic block size=] will not take into account any of its children after the clamp point.
1204
+ This also applies for the [=line-clamp container=] itself.
1205
+
1143
1206
<h2 id=sbg-ext class=nonum>
1144
1207
Appendix A: Possible extensions for ''scrollbar-gutter''</h2>
1145
1208
0 commit comments