Skip to content

Commit 043a420

Browse files
committed
[css-text-3] Provide an overview of the line-breaking properties in the section intro. Clean up some text about interactions. w3c#2559
1 parent 1c3b517 commit 043a420

File tree

1 file changed

+51
-20
lines changed

1 file changed

+51
-20
lines changed

css-text-3/Overview.bs

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,8 @@ Characters and Letters</h3>
861861

862862
<p>When inline-level content is laid out into lines, it is broken across line boxes.
863863
Such a break is called a <dfn>line break</dfn>.
864-
When a line is broken due to explicit line-breaking controls,
864+
When a line is broken due to explicit line-breaking controls
865+
(such as a <a>preserved</a> newline character),
865866
or due to the start or end of a block,
866867
it is a <dfn>forced line break</dfn>.
867868
When a line is broken due to content <dfn lt="wrapping|wrap">wrapping</dfn>
@@ -899,17 +900,37 @@ Characters and Letters</h3>
899900
Additionally the level of strictness in these restrictions
900901
varies with the typesetting style.
901902

902-
<p>CSS does not fully define where <a>soft wrap opportunities</a> occur;
903-
however some controls are provided to distinguish common variations.
903+
<p>While CSS does not fully define where <a>soft wrap opportunities</a> occur,
904+
some controls are provided to distinguish common variations:
905+
906+
<ul>
907+
<li>
908+
The 'line-break' property allows choosing various levels of “strictness”
909+
for line breaking restrictions.
910+
<li>
911+
The 'word-break' property controls what types of letters
912+
are glommed together to form unbreakable “words”,
913+
causing CJK characters to behave like non-CJK text or vice versa.
914+
<li>
915+
The 'hyphens' property controls whether automatic hyphenation
916+
is allowed to break words in scripts that hyphenate.
917+
<li>
918+
The 'overflow-wrap' property allows the UA to take a break anywhere
919+
in otherwise-unbreakable strings that would otherwise overflow.
920+
</ul>
904921

905922
<div class="note">
906923
<p>Note: Further information on line breaking conventions can be found in
907924
[[JLREQ]] and [[JIS4051]] for Japanese,
908-
[[ZHMARK]] for Chinese, and
925+
[[CLREQ]] and [[ZHMARK]] for Chinese, and
909926
in [[!UAX14]] for all scripts in Unicode.
927+
See also the
928+
<a href="https://www.w3.org/International/">Internationalization Working Group</a>’s
929+
<a href="https://www.w3.org/TR/typography/#blocks_paragraphs">Typography Index</a> [[TYPOGRAPHY]]
930+
which includes more information on additional languages.
910931

911-
<p class="feedback issue">Any guidance for appropriate references here would be
912-
much appreciated.
932+
<p class="feedback issue">Any guidance for additional appropriate references
933+
would be much appreciated.
913934
</div>
914935

915936
<h3 id="line-break-details">
@@ -919,20 +940,24 @@ Line Breaking Details</h3>
919940
<ul>
920941
<li>Regardless of the 'white-space' value,
921942
lines always break at each <a>preserved</a> forced break character:
943+
thus
922944
for all values, line-breaking behavior defined for
923945
the BK, CR, LF, CM, NL, and SG line breaking classes in [[!UAX14]]
924946
must be honored.
925-
<li>When 'white-space' allows wrapping,
926-
line breaking behavior defined for the WJ, ZW, and GL line-breaking classes in [[!UAX14]]
947+
<li>Except where explicitly defined otherwise
948+
(e.g. for ''line-break: anywhere'' or ''overflow-wrap: anywhere'')
949+
line breaking behavior defined for
950+
the WJ, ZW, and GL line-breaking classes in [[!UAX14]]
927951
must be honored.
928952
<li>UAs that allow wrapping at punctuation other than spaces should prioritize breakpoints.
929-
For example, if breaks after slashes are given a lower priority than spaces,
930-
the sequence "check /etc" will never break between the "/" and the "e".
953+
(For example, if breaks after slashes are given a lower priority than spaces,
954+
the sequence "check /etc" will never break between the "/" and the "e".)
931955
As long as care is taken to avoid such awkward breaks, allowing breaks at
932956
appropriate punctuation other than spaces is recommended, as it results
933957
in more even-looking margins, particularly in narrow measures.
934958
The UA may use the width of the containing block, the text's language,
935-
and other factors in assigning priorities.
959+
and other factors in assigning priorities:
960+
CSS does not define prioritization of line breaking opportunities.
936961
<li>Out-of-flow elements do not introduce a <a>forced line break</a>
937962
or <a>soft wrap opportunity</a> in the flow.
938963
<li>The line breaking behavior of a replaced element or other atomic inline
@@ -967,7 +992,8 @@ Line Breaking Details</h3>
967992

968993
<p>This property specifies <a>soft wrap opportunities</a> between letters,
969994
i.e. where it is “normal” and permissible to break lines of text.
970-
Specifically it controls whether a <a>soft wrap opportunity</a> exists
995+
Specifically it controls whether a <a>soft wrap opportunity</a>
996+
generally exists
971997
between adjacent <a>typographic letter units</a>
972998
(and/or non-<a>letter</a> <a>typographic character units</a>
973999
belonging to the
@@ -1014,18 +1040,23 @@ Line Breaking Details</h3>
10141040

10151041
<dt><dfn>break-all</dfn></dt>
10161042
<dd>Breaking is allowed within “words”:
1017-
in addition to ''word-break/normal'' <a>soft wrap opportunities</a>:
1018-
specifically, any <a>typographic character units</a> resolving to the
1043+
specifically,
1044+
in addition to <a>soft wrap opportunities</a> allowed for ''word-break/normal'',
1045+
any <a>typographic character units</a> resolving to the
10191046
<code>NU</code> (“numeric”), <code>AL</code> (“alphabetic”), or <code>SA</code> (“Southeast Asian”)
10201047
line breaking classes [[!UAX14]]
10211048
are instead treated as <code>ID</code> (“ideographic characters”)
10221049
for the purpose of line-breaking.
1023-
Hyphenation is not applied. This option is used mostly in a context where
1024-
the text consists predominantly of CJK characters with only short non-CJK excerpts,
1025-
and it is desired that the text be better distributed on each line.</dd>
1026-
1027-
Note: This value does not affect whether there are <a>soft wrap opportunities</a> around punctuation characters.
1028-
To allow breaks anywhere, see ''line-break: anywhere''.
1050+
Hyphenation is not applied.
1051+
This option is used mostly in a context where
1052+
the text consists predominantly of CJK characters
1053+
with only short non-CJK excerpts,
1054+
and it is desired that the text be better distributed on each line.
1055+
1056+
Note: This value does not affect
1057+
whether there are <a>soft wrap opportunities</a>
1058+
around punctuation characters.
1059+
To allow breaks anywhere, see ''line-break: anywhere''.
10291060

10301061
<dt><dfn>keep-all</dfn></dt>
10311062
<dd>Breaking is forbidden within “words”:

0 commit comments

Comments
 (0)