Skip to content

Commit f573eaa

Browse files
committed
[css-text-3] word-break: break-word
1 parent 86d0002 commit f573eaa

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

css-text/Overview.bs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ Line Breaking Details</h3>
815815

816816
<pre class="propdef">
817817
Name: word-break
818-
Value: normal | keep-all | break-all
818+
Value: normal | keep-all | break-all | break-word
819819
Initial: normal
820820
Inherited: yes
821821
Canonical order: n/a
@@ -878,6 +878,19 @@ Line Breaking Details</h3>
878878
the text consists predominantly of CJK characters with only short non-CJK excerpts,
879879
and it is desired that the text be better distributed on each line.</dd>
880880

881+
<dt><dfn>break-word</dfn></dt>
882+
<dd>An otherwise unbreakable sequence of <a>characters</a>
883+
may be broken at an arbitrary point if
884+
there are no otherwise-acceptable break points in the line.
885+
Shaping characters are still shaped as if the word were not
886+
broken, and grapheme clusters must stay together as one unit.
887+
No hyphenation character is inserted at the break point.
888+
889+
The behavior is the same as 'word-wrap'/''overflow-wrap: break-word'',
890+
except that this value is taken into account
891+
when computing <a>min-content inline size</a>
892+
as other values of this property are.
893+
881894
<dt><dfn>keep-all</dfn></dt>
882895
<dd>Breaking is forbidden within “words”:
883896
implicit <a>soft wrap opportunities</a> between <a>typographic letter units</a> are suppressed,
@@ -920,7 +933,7 @@ Line Breaking Details</h3>
920933
</div>
921934

922935
<p>When shaping scripts such as Arabic
923-
are allowed to break within words due to ''break-all'',
936+
are allowed to break within words due to ''break-all'' or ''break-word'',
924937
the characters must still be shaped
925938
as if the word were <a href="#word-break-shaping">not broken</a>.
926939

@@ -1167,7 +1180,7 @@ Line Breaking Details</h3>
11671180
that would otherwise overflow the line and <a>hang</a> as per <a href="#white-space-phase-2">Trimming and Positioning</a>
11681181
must be broken after the last white space character that would fit the line,
11691182
or after the first white space in the sequence if none would fit,
1170-
or before the first space in the sequence if none would fit and both ''break-word'' and ''break-spaces'' are specified.
1183+
or before the first space in the sequence if none would fit and both ''overflow-wrap/break-word'' and ''break-spaces'' are specified.
11711184

11721185
<p class="note">This last clause is due to the fact that
11731186
'overflow-wrap: break-words'' allows breaks between any two characters
@@ -1200,6 +1213,7 @@ Shaping Across Intra-word Breaks</h3>
12001213
at unforced <a>soft wrap opportunities</a> within words
12011214
(such as when breaking due to
12021215
''word-break: break-all'',
1216+
''word-break: break-word'',
12031217
''overflow-wrap: break-word'',
12041218
or when <a>hyphenating</a>)
12051219
the characters must still be shaped

0 commit comments

Comments
 (0)