Skip to content

Commit 806cd4e

Browse files
committed
[css-text-3] hyphens:none does not suppress wrapping opportunities after U+002D or U+2010
See issue w3c#3434.
1 parent 2b7839c commit 806cd4e

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

css-text-3/Overview.bs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,9 @@ Line Breaking Details</h3>
21532153
or on text selection or searching.
21542154

21552155
<p>Hyphenation occurs when the line breaks at a valid <dfn>hyphenation opportunity</dfn>,
2156-
which creates a <a>soft wrap opportunity</a> within the word.
2156+
which creates a <a>soft wrap opportunity</a> within the word
2157+
where a visually indication of the split is made when actually wrapping,
2158+
as discussed above.
21572159
In CSS it is controlled with the 'hyphens' property.
21582160
CSS Text Level 3 does not define the exact rules for hyphenation,
21592161
however UAs are strongly encouraged to optimize their line-breaking implementation
@@ -2164,6 +2166,13 @@ Line Breaking Details</h3>
21642166
which is particularly important in long-word languages like German.
21652167
https://bugzilla.mozilla.org/show_bug.cgi?id=418975 -->
21662168

2169+
Note: The [=soft wrap opportunity=] introduced by
2170+
the U+002D HYPHEN-MINUS character
2171+
or the U+2010 HYPHEN character
2172+
is not a [=hyphenation opportunity=],
2173+
as no visual indication of the split is created <em>when wrapping</em>:
2174+
these characters are visible whether the line is wrapped at that point or not.
2175+
21672176
<pre class="propdef">
21682177
Name: hyphens
21692178
Value: none | manual | auto
@@ -2184,6 +2193,11 @@ Line Breaking Details</h3>
21842193
<dt><dfn>none</dfn>
21852194
<dd>Words are not hyphenated, even if characters inside
21862195
the word explicitly define <a>hyphenation opportunities</a>.
2196+
2197+
Note: This does not suppress existing the [=soft wrap opportunities=]
2198+
introduced by always visible characters such as
2199+
U+002D HYPHEN-MINUS
2200+
or U+2010 HYPHEN.
21872201
<dt><dfn>manual</dfn>
21882202
<dd>Words are only hyphenated where there are characters inside the word
21892203
that explicitly suggest <a>hyphenation opportunities</a>.

css-text-3/test-coverage.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ <h3 id="hyphenation-the-hyphens-property"><a href="https://drafts.csswg.org/css-
338338
<li>Affects intrinsic sizing
339339
<li>manual value
340340
<li>none value
341-
<li>basic behavior of auto when lang is declared and there’s no ­
341+
<li>none does not suppress wrapping after an actual hyphen
342+
<li>basic behavior of auto when lang is declared and there’s no soft hyphen
342343
<li>However, if, even after breaking at such opportunities, a portion of that word is is still too long to fit on one line, an automatic hyphenation opportunity may be used.
343344
<li>When shaping scripts such as Arabic are allowed to break within words due to hyphenation, the characters must still be shaped as if the word were not broken
344345
</ul>

0 commit comments

Comments
 (0)