@@ -707,12 +707,14 @@ 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
716
+ if it immediately precedes eiher a [=region break=]
717
+ or a [=clamp point=] in the [=block formatting context=] .
716
718
717
719
Note: See [[css-overflow-4#fragmentation]] for a way to generate boxes with such a [=region break=] .
718
720
@@ -777,10 +779,13 @@ Indicating Block-Axis Overflow: the 'block-ellipsis' property</h3>
777
779
The [=block overflow ellipsis=] must not be included
778
780
in either the ''::first-letter'' nor the ''::first-line'' pseudo-elements.
779
781
780
- If there is a subsequent <a>fragmentation container</a> in the [=fragmentation context=]
782
+ If the [=block overflow ellipsis=] is placed before a [=region break=] and
783
+ there is a subsequent <a>fragmentation container</a> in the [=fragmentation context=]
781
784
that would receive subsequent content,
782
785
then the content displaced by the <a>block overflow ellipsis</a>
783
786
must be pushed to that <a>fragmentation container</a> .
787
+ 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,
@@ -810,7 +815,7 @@ Limiting Visible Lines: the 'line-clamp' shorthand property</h3>
810
815
811
816
<pre class="propdef shorthand">
812
817
Name : line-clamp
813
- Value : none | <<integer [1,∞]>> || <<'block-ellipsis'>>
818
+ Value : none | [ <<integer [1,∞]>> || <<'block-ellipsis'>>] ''-webkit-legacy''?
814
819
Initial : none
815
820
Percentages : N/A
816
821
</pre>
@@ -844,14 +849,21 @@ 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''
848
- if either or both values ares specified.
852
+
853
+ Issue(7708): Whether this should imply ''discard'' or ''collapse'' is an unresolved question.
854
+
855
+ Sets 'continue' to ''collapse''
856
+ if either or both values are specified,
857
+ unless the ''line-clamp/-webkit-legacy'' keyword is also specified.
849
858
850
859
Sets 'max-lines' to the specified <<integer>>
851
860
or to ''max-lines/none'' if omitted,
852
861
and 'block-ellipsis' to other component of the value if specified
853
862
or to ''block-ellipsis/auto'' if omitted.
854
863
864
+ <dt> <dfn>-webkit-legacy</dfn>
865
+ <dd> Sets 'continue' to ''continue/-webkit-legacy'' .
866
+
855
867
</dl>
856
868
857
869
See the corresponding longhand properties for details
@@ -901,7 +913,7 @@ Legacy compatibility</h4>
901
913
902
914
For compatibility with legacy content,
903
915
UAs that support 'line-clamp' must also support the '-webkit-line-clamp' property
904
- and the additional ''-webkit-discard '' value for the 'continue' property.
916
+ and the additional ''continue/ -webkit-legacy '' value for the 'continue' property.
905
917
906
918
<pre class="propdef shorthand">
907
919
Name : -webkit-line-clamp
@@ -912,17 +924,18 @@ Legacy compatibility</h4>
912
924
913
925
<pre class="propdef partial">
914
926
Name : continue
915
- New Values : -webkit-discard
927
+ New Values : -webkit-legacy
916
928
</pre>
917
929
918
930
Like 'line-clamp' , '-webkit-line-clamp' is a shorthand of 'max-lines' , 'continue' , and 'block-ellipsis' ,
919
931
except that:
920
932
921
933
* its syntax is ''line-clamp/none'' | <<integer [1,∞]>>
922
- * it sets 'continue' to ''-webkit-discard'' instead of ''discard''
934
+ * it sets 'continue' to ''continue/-webkit-legacy'' instead of ''collapse''
935
+ (as if the ''line-clamp/-webkit-legacy'' keyword was set on 'line-clamp' )
923
936
* it unconditionally sets 'block-ellipsis' to ''block-ellipsis/auto''
924
937
925
- The <dfn value for=continue>-webkit-discard </dfn> value behaves identically to ''discard '' ,
938
+ The <dfn value for=continue>-webkit-legacy </dfn> value behaves identically to ''collapse '' ,
926
939
except that it only takes effect
927
940
if the [=specified value=] of the 'display' property
928
941
is ''-webkit-box'' or ''-webkit-inline-box''
@@ -947,28 +960,37 @@ Forcing a Break After a Set Number of Lines: the 'max-lines' property</h3>
947
960
Name : max-lines
948
961
Value : ''none'' | <<integer [1,∞]>>
949
962
Initial : ''none''
950
- Applies to : <a>block containers</a> which are also [=fragmentation containers=] that capture [=region breaks=]
963
+ Applies to : <a>block containers</a> which are also either [=fragmentation containers=] that capture [=region breaks=] or [=line-clamp containers =]
951
964
Inherited : no
952
965
Percentages : N/A
953
966
Computed value : the keyword ''max-lines/none'' or an integer
954
967
Animation type : by computed value type
955
968
</pre>
956
969
957
- This property only has an effect on boxes that are [=fragmentation containers=] that capture [=region breaks=] .
958
-
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>
970
+ If the value of 'max-lines' is not <dfn for=max-lines dfn-type=value>none</dfn> ,
971
+ then, given a [=computed value=] of <var> N</var> :
972
+
973
+ - If the box is a [=fragmentation container=] that captures [=region breaks=] ,
974
+ a <a>region break</a>
975
+ is forced after its <var> N</var> th
976
+ descendant <a>in-flow</a> <a>line box</a> .
977
+ If fewer than <var> N</var> line boxes exist,
978
+ then 'max-lines' introduces no <a>region break</a> .
979
+ - If the box is a [=line-clamp container=] ,
980
+ its [=clamp point=] is set
981
+ to the first possible clamp point after
982
+ its <var> N</var> th
983
+ descendant <a>in-flow</a> <a>line box</a> .
984
+ If fewer than <var> N</var> line boxes exist,
985
+ or if there are no clamp points after it,
986
+ then that line-clamp container has no clamp point.
987
+
988
+
989
+ Only line boxes in the same <a>block formatting context</a>
965
990
are counted:
966
991
the contents of descendants that establish <a>independent formatting contexts</a>
967
992
are skipped over while counting line boxes.
968
993
969
- If fewer than <var> N</var> line boxes exist,
970
- then 'max-lines' introduces no <a>region break</a> .
971
-
972
994
Note: This implies that 'max-lines' has no effect when applied to [=multi-column containers=] ,
973
995
since any line box they contain are nested into [=independent formatting contexts=] .
974
996
@@ -1004,7 +1026,7 @@ Fragmentation of Overflow: the 'continue' property</h3>
1004
1026
1005
1027
<pre class=propdef>
1006
1028
Name : continue
1007
- Value : auto | discard
1029
+ Value : auto | discard | collapse
1008
1030
Initial : ''continue/auto''
1009
1031
Applies to : [=block containers=] and [=multicol containers=]
1010
1032
Inherited : no
@@ -1014,10 +1036,12 @@ Fragmentation of Overflow: the 'continue' property</h3>
1014
1036
</pre>
1015
1037
1016
1038
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.
1039
+ to truncate/interrupt the content inside a box,
1040
+ either by visually hiding the remaining content,
1041
+ or by turning the box into a [=fragmentation container=] (see [[!CSS-BREAK-3]] )
1042
+ and discarding the content after the [=fragmentation break=] .
1019
1043
1020
- Issue: This property is meant to generalize and replace the <code> region-fragment</code> property from [[CSS-REGIONS-1]] .
1044
+ Issue: ''continue: discard'' is meant to generalize and replace the <code> region-fragment</code> property from [[CSS-REGIONS-1]] .
1021
1045
Once it is sufficiently stable in this specification,
1022
1046
<code> region-fragment</code> should be removed from the regions specification in favor of this.
1023
1047
@@ -1048,6 +1072,15 @@ Fragmentation of Overflow: the 'continue' property</h3>
1048
1072
Breaks applying to other [=fragmentation contexts=]
1049
1073
(such as pagination of this box itself)
1050
1074
do not cause any content to be discarded.
1075
+
1076
+ <dt> <dfn>collapse</dfn>
1077
+ <dd>
1078
+ If the box is a [=block container=] , then it must
1079
+ [=establish an independent formatting context=] that also becomes a [=line-clamp container=] .
1080
+ This causes all content after the [=clamp point=] to be visually hidden, and to not be
1081
+ taken into account for the box's [=automatic block size=] .
1082
+
1083
+ This keyword has no effect on [=multicol containers=] .
1051
1084
</dl>
1052
1085
1053
1086
<div class=example>
@@ -1114,6 +1147,9 @@ Fragmentation of Overflow: the 'continue' property</h3>
1114
1147
would cause intrinsic sizes to depend on layout, which would cause circularities.
1115
1148
-->
1116
1149
1150
+ Note: This differs from the ''visibility: hidden'' -like behavior
1151
+ of content after the [=clamp point=] with ''continue: collapse'' .
1152
+
1117
1153
Note: In the case of <a href="https://www.w3.org/TR/css-break-3/#parallel-flows">parallel fragmentation flows</a> ,
1118
1154
content occurring after the <a>fragmentation break</a> in the box tree
1119
1155
could still be rendered,
@@ -1122,7 +1158,7 @@ Fragmentation of Overflow: the 'continue' property</h3>
1122
1158
1123
1159
Additionaliy,
1124
1160
for compatibility (see [[#webkit-line-clamp]] ),
1125
- when the [=computed value=] of the 'continue' property is ''discard''
1161
+ when the [=computed value=] of the 'continue' property is ''collapse'' , ''continue/-webkit-legacy'' , or '' discard''
1126
1162
and the [=computed value=] of the '-webkit-box-orient' property is ''vertical'' :
1127
1163
* If the [=specified value=] of the 'display' property is ''-webkit-box'' ,
1128
1164
the [=computed value=] becomes ''flow-root'' and
@@ -1139,6 +1175,63 @@ Fragmentation of Overflow: the 'continue' property</h3>
1139
1175
as the box would be a [=flex container=] rather than a [=block container=] ,
1140
1176
and thus the 'continue' property would not apply.
1141
1177
1178
+ <h4 id=line-clamp-containers>Line-clamp containers</h4>
1179
+
1180
+ A <dfn export>line-clamp container</dfn> is an [=independent formatting context|independent=] [=block formatting context=]
1181
+ that additionally follows the rules in this section.
1182
+ Line-clamp containers can have a <dfn>clamp point</dfn> ,
1183
+ which is one of the following block-axis positions inside it:
1184
+
1185
+ - The start of the [=line-clamp container=] .
1186
+ - A point between two consecutive [=line boxes=]
1187
+ in an [=inline formatting context=]
1188
+ contained by the line-clamp container's [=block formatting context=] .
1189
+ - A point between two [=in-flow=] [=block-level=] sibling boxes
1190
+ in the line-clamp container's [=block formatting context=] .
1191
+
1192
+ If the [=line-clamp container=] 's [=block formatting context root=]
1193
+ has a [=computed value=] of 'max-lines' other than ''max-lines/none'' ,
1194
+ then that property will determine the [=clamp point=] .
1195
+ Otherwise, the clamp point will be set to the last possible clamp point
1196
+ such that, for it and all previous possible clamp points,
1197
+ the line-clamp container's [=automatic block size=]
1198
+ (as determined below)
1199
+ is not greater than the [=block size=] the box would have
1200
+ if its automatic block size were infinite.
1201
+ If the [=block size=] would be infinite,
1202
+ then there is no clamp point.
1203
+
1204
+ Within a [=line-clamp container=] ,
1205
+ the following boxes and line boxes become [=invisible boxes=] :
1206
+
1207
+ - Any [=in-flow=] or floating boxes
1208
+ that follow the [=clamp point=] in the box tree.
1209
+ This includes [=independent formatting contexts=]
1210
+ and all of their descendants.
1211
+ - Any [=line boxes=] that follow the [=clamp point=]
1212
+ inside an [=inline formatting context=] .
1213
+ - Any [=absolutely positioned box=]
1214
+ which has an invisible box within its [=containing block chain=] ,
1215
+ and all of its descendants.
1216
+
1217
+ Any overflow such invisible boxes and line boxes might have
1218
+ is always counted as [=ink overflow=] rather than [=scrollable overflow=] .
1219
+
1220
+ NOTE: This differs from the ''display: none'' -like behavior
1221
+ of not rendered content with ''continue: discard'' .
1222
+
1223
+ If a [=block container=] contains a [=clamp point=] ,
1224
+ within itself or in any of its descendants,
1225
+ its [=automatic block size=] will not take into account any invisible boxes.
1226
+ This also applies for the [=line-clamp container=] itself.
1227
+
1228
+ NOTE: If there are any floats before the [=clamp point=] ,
1229
+ the [=line-clamp container=] 's automatic size must grow to encompass the clearance,
1230
+ just like it would if it were a regular [=block formatting context=] root
1231
+ that only contained its contents before the [=clamp point=] .
1232
+ This is regardless of whether this would cause any content after the [=clamp point=]
1233
+ to be within the container's bounds.
1234
+
1142
1235
<h2 id=sbg-ext class=nonum>
1143
1236
Appendix A: Possible extensions for ''scrollbar-gutter''</h2>
1144
1237
0 commit comments