You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-text-4/Overview.bs
+41-21Lines changed: 41 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -178,7 +178,7 @@ Text Wrap Settings: the 'text-wrap' property</h3>
178
178
179
179
<pre class="propdef">
180
180
Name: text-wrap
181
-
Value: wrap | nowrap | balance
181
+
Value: wrap | nowrap | balance | stable | pretty
182
182
Initial: wrap
183
183
Applies to: <a>inline boxes</a> and <a>block containers</a>
184
184
Inherited: yes
@@ -199,8 +199,13 @@ Text Wrap Settings: the 'text-wrap' property</h3>
199
199
in order to minimize <a>inline-axis</a> overflow.
200
200
201
201
The exact algorithm is UA-defined.
202
-
The algorithm may consider multiple lines when making break decisions.
203
-
The UA may bias for speed over best layout.
202
+
The algorithm <em>may</em> consider multiple lines
203
+
when making break decisions.
204
+
The UA <em>may</em> bias for speed over best layout.
205
+
The UA <em>must not</em> attempt to even out all lines
206
+
(including the last) as for ''text-wrap/balance''.
207
+
This value selects the UA’s preferred (or most Web-compatible)
208
+
wrapping algorithm.
204
209
205
210
<dt><dfn>nowrap</dfn>
206
211
<dd>
@@ -230,9 +235,26 @@ Text Wrap Settings: the 'text-wrap' property</h3>
230
235
The exact algorithm is UA-defined.
231
236
232
237
UAs may treat this value as ''text-wrap/wrap'' if there are more than ten lines to balance.
233
-
</dl>
234
238
235
-
ISSUE: There's some discussion about whether different wrapping algorithms (higher quality vs faster) need special keywords, see <a href="https://github.com/w3c/csswg-drafts/issues/672#issuecomment-379723243">Issue 672</a>.
239
+
<dt><dfn>stable</dfn>
240
+
<dd>
241
+
When applied to a <a>block container</a>
242
+
that establishes an <a>inline formatting context</a>,
243
+
specifies that content on subsequent lines
244
+
<em>should not</em> be considered when making break decisions
245
+
so that when editing text any content before the cursor
246
+
remains stable;
247
+
otherwise equivalent to ''text-wrap/wrap'',
248
+
249
+
<dt><dfn>pretty</dfn>
250
+
<dd>
251
+
When applied to a <a>block container</a>
252
+
that establishes an <a>inline formatting context</a>,
253
+
specifies the UA <em>should</em> bias for better layout over speed,
254
+
and is expected to consider multiple lines,
255
+
when making break decisions.
256
+
Otherwise equivalent to ''text-wrap/wrap'',
257
+
</dl>
236
258
237
259
Regardless of the 'text-wrap' value,
238
260
lines always break at forced breaks:
@@ -262,24 +284,22 @@ Text Wrap Settings: the 'text-wrap' property</h3>
262
284
263
285
<!-- add a sample prioritization algorithm -->
264
286
265
-
Note: The ''text-wrap/wrap'' value is intended
266
-
for speedy legacy line breaking,
267
-
which has so far used first-fit/greedy algorithms
287
+
Note: The ''text-wrap/wrap'' value is will typically map
288
+
to Web browsers’ speedy legacy line breaking,
289
+
which has so far used first-fit/greedy algorithms
268
290
that can often give sub-optimal results.
269
-
UAs could experiment with better line breaking algorithms
291
+
UAs can experiment with better line breaking algorithms
270
292
with this default value,
271
-
but optimal results will probably take more time.
272
-
The ''text-wrap/multi-line'' and ''text-wrap/balance'' values
273
-
are intended as opt-in choices to take more time for better results.
274
-
The ''text-wrap/balance'' value is intended for titles and captions,
275
-
and the ''text-wrap/multi-line'' is intended for body text.
276
-
277
-
Note: Some line breaking algorithms can interact unexpectedly with editing.
278
-
Changing upstream line breaks on user edits can be unsettling.
279
-
As UAs experiment with better line breaking algorithms,
280
-
we will likely need to add a property
281
-
to constrain upstream changes while editing.
282
-
293
+
but as optimal results often take more time,
294
+
''text-wrap/pretty'' is offered as an opt-in
295
+
to take more time for better results.
296
+
The ''text-wrap/pretty'' value is intended for body text,
297
+
where the last line is expected to be a bit shorter than the average line;
298
+
the ''text-wrap/balance'' value is intended for titles and captions,
299
+
where equal-length lines of text tend to be preferred;
300
+
and the ''text-wrap/stable'' is intended for sections that are,
301
+
or are likely become toggled as,
302
+
editable.
283
303
<h3 id="wrap-before">
284
304
Inline breaks between boxes: the 'wrap-before'/'wrap-after' properties</h3>
0 commit comments