Skip to content

Commit 0b796c5

Browse files
committed
[css-overflow-4] Refactor text
Move continue:collapse to be before continue:discard, and move details of continue:discard to subsection. See also #12795
1 parent 26cd52b commit 0b796c5

File tree

1 file changed

+136
-132
lines changed

1 file changed

+136
-132
lines changed

css-overflow-4/Overview.bs

Lines changed: 136 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,14 +1051,24 @@ Fragmentation of Overflow: the 'continue' property</h3>
10511051
If the box has more content than can fit,
10521052
the excess content is handled according to the usual rules.
10531053

1054+
<dt><dfn>collapse</dfn>
1055+
<dd>
1056+
If the box is a [=block container=], then it must
1057+
[=establish an independent formatting context=] that also becomes a [=line-clamp container=].
1058+
This causes all content after the [=clamp point=] to be visually hidden, and to not be
1059+
taken into account for the box's [=automatic block size=].
1060+
1061+
If the box is a [=multicol container=],
1062+
the behavior is the same as 'continue/auto'.
1063+
10541064
<dt><dfn>discard</dfn>
10551065
<dd>
10561066
The box must [=establish an independent formatting context=]
10571067
and becomes a [=fragmentation container=]
10581068
that captures <a>region breaks</a>,
10591069
if it is not already.
10601070
[[!CSS-BREAK-3]]
1061-
Content after the first [=region break=] is not rendered (see below).
1071+
Content after the first [=region break=] is not rendered.
10621072

10631073
Note: This [=region break=] might be <a lt="forced break">forced</a>
10641074
(e.g. imposed by 'max-lines' or by another mechanism,
@@ -1070,103 +1080,7 @@ Fragmentation of Overflow: the 'continue' property</h3>
10701080
(such as pagination of this box itself)
10711081
do not cause any content to be discarded.
10721082

1073-
Additionally,
1074-
if the box is a [=multi-column container=],
1075-
any [=overflow columns=] are also not rendered,
1076-
nor is any subsequent content--
1077-
including any [=out of flow=] content
1078-
whose static position is in or after overflow columns,
1079-
nor is any additional [=multicol line=] or [=multicol row=]
1080-
that would be generated to hold such content.
1081-
1082-
<div class=example id=discard-overflow-column>
1083-
In the absence of the 'continue' property,
1084-
based on [[css-multicol-1 inline]],
1085-
the following markup and associated CSS would be expected
1086-
to render as follows.
1087-
1088-
<xmp highlight=markup>
1089-
<div class="multicol">
1090-
<p>Column 1</p>
1091-
<p>Column 2</p>
1092-
<p>Column 3</p>
1093-
<p>Overflow column
1094-
<div class="spanner">Spanner 1</div>
1095-
</p>
1096-
<div class="spanner">Spanner 2</div>
1097-
<p>Following 1</p>
1098-
<p>Following 2</p>
1099-
<p>Following 3</p>
1100-
<div class="spanner">Spanner 3</div>
1101-
<p>Following 4</p>
1102-
<p>Following 5</p>
1103-
<p>Following 6</p>
1104-
</div>
1105-
</xmp>
1106-
<pre><code highlight=css>
1107-
.multicol {
1108-
columns: 3;
1109-
border: solid 1px;
1110-
}
1111-
.multicol p {
1112-
break-after: column;
1113-
break-inside: avoid;
1114-
}
1115-
.spanner {
1116-
column-span: all;
1117-
text-align: center;
1118-
}
1119-
</code></pre>
1120-
<!--
1121-
ommitted because incidental to the example, but needed for an exact rendering:
1122-
p { margin: 0; }
1123-
.multicol {
1124-
width: 47ch;
1125-
font-family: monospace;
1126-
gap: 1ch;
1127-
}
1128-
-->
1129-
<figure>
1130-
<pre id=sample-rendering-overflow-multicolumn-1 style="width: 63ch">
1131-
<div style="border:solid 1px; width: 47ch;">Column 1 Column 2 Column 3 Overflow column
1132-
Spanner 1
1133-
Spanner 2
1134-
Following 1 Following 2 Following 3
1135-
Spanner 3
1136-
Following 4 Following 5 Following 6
1137-
</div></pre>
1138-
</figure>
1139-
1140-
There is one overflow column,
1141-
a spanner whose static position is within that overflow column,
1142-
another spanner whose static position is after the overflow column,
1143-
inflow content after the spanners and the overflow column,
1144-
and another spanner whose static position is in this subsequent inflow content.
1145-
1146-
If we additionally apply the following style,
1147-
everything starting from and including the overflow column is discarded.
1148-
1149-
<pre><code highlight=css>
1150-
.multicol {
1151-
continue: discard;
1152-
block-ellipsis: auto;
1153-
}
1154-
</code></pre>
1155-
<figure>
1156-
<pre id=sample-rendering-overflow-multicolumn-2>
1157-
<div style="border:solid 1px; width: 47ch;">Column 1 Column 2 Column 3…</div></pre>
1158-
</figure>
1159-
1160-
</div>
1161-
<dt><dfn>collapse</dfn>
1162-
<dd>
1163-
If the box is a [=block container=], then it must
1164-
[=establish an independent formatting context=] that also becomes a [=line-clamp container=].
1165-
This causes all content after the [=clamp point=] to be visually hidden, and to not be
1166-
taken into account for the box's [=automatic block size=].
1167-
1168-
If the box is a [=multicol container=],
1169-
the behavior is the same as 'continue/auto'.
1083+
See [[#discarding-content]] for further details.
11701084
</dl>
11711085

11721086
<div class=example id=ex-continue-overflow>
@@ -1217,40 +1131,6 @@ Fragmentation of Overflow: the 'continue' property</h3>
12171131

12181132
</div>
12191133

1220-
Content that is “not rendered” due to ''continue: discard''
1221-
is discarded, similar to ''display: none'':
1222-
* It is not rendered.
1223-
* It is also not made available for speech rendering.
1224-
* It does not allow user interaction.
1225-
* Issue(2970): Make sure effects on OM are well defined
1226-
* Issue(2971): What about [=positioned=] elements whose static position is in the discarded content are not rendered?
1227-
See also discussions in the <a href="https://lists.w3.org/Archives/Public/www-style/2018Jul/0030.html">Sydney F2F meeting</a>.
1228-
1229-
However, since intrinsic sizes are calculated across <a>fragmentation containers</a>,
1230-
this content <em>is</em> taken into account
1231-
for the purpose of finding the box’s
1232-
<a lt="min-content inline size">min-content</a> and <a>max-content</a> <a>inline sizes</a>
1233-
(see [[css-break-3#varying-size-boxes]]).
1234-
<a lt="min-content inline size">Min-content</a> and <a>max-content</a> <a>block sizes</a>
1235-
are calculated based on the content
1236-
from the start of the [=fragmented flow=]
1237-
to the first [=forced break=] if any,
1238-
or to the end of the [=fragmented flow=] if there is no forced break.
1239-
1240-
<!--
1241-
Calculating intrinsic block sizes to the first forced <em>or unforced</em> break
1242-
would cause intrinsic sizes to depend on layout, which would cause circularities.
1243-
-->
1244-
1245-
Note: This differs from the ''visibility: hidden''-like behavior
1246-
of content after the [=clamp point=] with ''continue: collapse''.
1247-
1248-
Note: In the case of <a href="https://www.w3.org/TR/css-break-3/#parallel-flows">parallel fragmentation flows</a>,
1249-
content occurring after the <a>fragmentation break</a> in the box tree
1250-
could still be rendered,
1251-
if it is laid out above the position
1252-
representing the end of this <a>fragmentation container</a>.
1253-
12541134
Additionaliy,
12551135
for compatibility (see [[#webkit-line-clamp]]),
12561136
when the [=computed value=] of the 'continue' property is ''collapse'', ''continue/-webkit-legacy'', or ''discard''
@@ -1331,6 +1211,130 @@ Fragmentation of Overflow: the 'continue' property</h3>
13311211
This is regardless of whether this would cause any content after the [=clamp point=]
13321212
to be within the container's bounds.
13331213

1214+
<h4 id=discarding-content>Discarding Content</h4>
1215+
1216+
Content that is “not rendered” due to ''continue: discard''
1217+
is discarded, similar to ''display: none'':
1218+
* It is not rendered.
1219+
* It is also not made available for speech rendering.
1220+
* It does not allow user interaction.
1221+
* Issue(2970): Make sure effects on OM are well defined
1222+
* Issue(2971): What about [=positioned=] elements whose static position is in the discarded content are not rendered?
1223+
See also discussions in the <a href="https://lists.w3.org/Archives/Public/www-style/2018Jul/0030.html">Sydney F2F meeting</a>.
1224+
1225+
However, since intrinsic sizes are calculated across <a>fragmentation containers</a>,
1226+
this content <em>is</em> taken into account
1227+
for the purpose of finding the box’s
1228+
<a lt="min-content inline size">min-content</a> and <a>max-content</a> <a>inline sizes</a>
1229+
(see [[css-break-3#varying-size-boxes]]).
1230+
<a lt="min-content inline size">Min-content</a> and <a>max-content</a> <a>block sizes</a>
1231+
are calculated based on the content
1232+
from the start of the [=fragmented flow=]
1233+
to the first [=forced break=] if any,
1234+
or to the end of the [=fragmented flow=] if there is no forced break.
1235+
1236+
<!--
1237+
Calculating intrinsic block sizes to the first forced <em>or unforced</em> break
1238+
would cause intrinsic sizes to depend on layout, which would cause circularities.
1239+
-->
1240+
1241+
Note: This differs from the ''visibility: hidden''-like behavior
1242+
of content after the [=clamp point=] with ''continue: collapse''.
1243+
1244+
Note: In the case of <a href="https://www.w3.org/TR/css-break-3/#parallel-flows">parallel fragmentation flows</a>,
1245+
content occurring after the <a>fragmentation break</a> in the box tree
1246+
could still be rendered,
1247+
if it is laid out above the position
1248+
representing the end of this <a>fragmentation container</a>.
1249+
1250+
Additionally,
1251+
if the box is a [=multi-column container=],
1252+
any [=overflow columns=] are also not rendered,
1253+
nor is any subsequent content--
1254+
including any [=out of flow=] content
1255+
whose static position is in or after overflow columns,
1256+
nor is any additional [=multi-column line=] or [=multi-column row=]
1257+
that would be generated to hold such content.
1258+
1259+
<div class=example id=discard-overflow-column>
1260+
In the absence of the 'continue' property,
1261+
based on [[css-multicol-1 inline]],
1262+
the following markup and associated CSS would be expected
1263+
to render as follows.
1264+
1265+
<xmp highlight=markup>
1266+
<div class="multicol">
1267+
<p>Column 1</p>
1268+
<p>Column 2</p>
1269+
<p>Column 3</p>
1270+
<p>Overflow column
1271+
<div class="spanner">Spanner 1</div>
1272+
</p>
1273+
<div class="spanner">Spanner 2</div>
1274+
<p>Following 1</p>
1275+
<p>Following 2</p>
1276+
<p>Following 3</p>
1277+
<div class="spanner">Spanner 3</div>
1278+
<p>Following 4</p>
1279+
<p>Following 5</p>
1280+
<p>Following 6</p>
1281+
</div>
1282+
</xmp>
1283+
<pre><code highlight=css>
1284+
.multicol {
1285+
columns: 3;
1286+
border: solid 1px;
1287+
}
1288+
.multicol p {
1289+
break-after: column;
1290+
break-inside: avoid;
1291+
}
1292+
.spanner {
1293+
column-span: all;
1294+
text-align: center;
1295+
}
1296+
</code></pre>
1297+
<!--
1298+
ommitted because incidental to the example, but needed for an exact rendering:
1299+
p { margin: 0; }
1300+
.multicol {
1301+
width: 47ch;
1302+
font-family: monospace;
1303+
gap: 1ch;
1304+
}
1305+
-->
1306+
<figure>
1307+
<pre id=sample-rendering-overflow-multicolumn-1 style="width: 63ch">
1308+
<div style="border:solid 1px; width: 47ch;">Column 1 Column 2 Column 3 Overflow column
1309+
Spanner 1
1310+
Spanner 2
1311+
Following 1 Following 2 Following 3
1312+
Spanner 3
1313+
Following 4 Following 5 Following 6
1314+
</div></pre>
1315+
</figure>
1316+
1317+
There is one overflow column,
1318+
a spanner whose static position is within that overflow column,
1319+
another spanner whose static position is after the overflow column,
1320+
inflow content after the spanners and the overflow column,
1321+
and another spanner whose static position is in this subsequent inflow content.
1322+
1323+
If we additionally apply the following style,
1324+
everything starting from and including the overflow column is discarded.
1325+
1326+
<pre><code highlight=css>
1327+
.multicol {
1328+
continue: discard;
1329+
block-ellipsis: auto;
1330+
}
1331+
</code></pre>
1332+
<figure>
1333+
<pre id=sample-rendering-overflow-multicolumn-2>
1334+
<div style="border:solid 1px; width: 47ch;">Column 1 Column 2 Column 3…</div></pre>
1335+
</figure>
1336+
</div>
1337+
13341338
<h2 id=sbg-ext class=nonum>
13351339
Appendix A: Possible extensions for ''scrollbar-gutter''</h2>
13361340

0 commit comments

Comments
 (0)