Skip to content

Commit d8931a4

Browse files
committed
[css-text-3] Undefine where letter-spacing is applied. #1518
1 parent b3bb0ed commit d8931a4

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

css-text-3/Overview.bs

+31-23
Original file line numberDiff line numberDiff line change
@@ -4463,7 +4463,7 @@ Expanding and Compressing Text</h4>
44634463
it is applied under the same rules as for 'word-spacing'.
44644464
Similarly, when space is distributed to an <a>justification opportunity</a> between
44654465
two <a>typographic character units</a>,
4466-
it is applied under the same rules as for 'letter-spacing'.
4466+
should be applied under the same rules as for 'letter-spacing'.
44674467

44684468

44694469
<p>A justification algorithm may divide <a>justification opportunities</a> into different priority levels.
@@ -4926,7 +4926,8 @@ Word Spacing: the 'word-spacing' property</h3>
49264926
letter-spacing/letter-spacing-204.html
49274927
</wpt>
49284928

4929-
<p>Letter-spacing must not be applied at the beginning or at the end of a line.
4929+
<p>Letter-spacing must not be applied at the beginning of a line.
4930+
Whether letter-spacing is applied at the end of a line is undefined in this level.
49304931

49314932
<wpt>
49324933
letter-spacing/letter-spacing-end-of-line-001.html
@@ -4937,7 +4938,7 @@ Word Spacing: the 'word-spacing' property</h3>
49374938
</wpt>
49384939

49394940
<div class="example">
4940-
<p>Because letter-spacing is not applied at the beginning or end of a line,
4941+
<p>When letter-spacing is not applied at the beginning or end of a line,
49414942
text always fits flush with the edge of the block.
49424943
<pre>
49434944
p { letter-spacing: 1em; }
@@ -4947,7 +4948,8 @@ Word Spacing: the 'word-spacing' property</h3>
49474948
<p class="ls-ex good ls-fixed-width color-box" style="text-align: left">a&#x3000;b&#x3000;c</p>
49484949
<p class="ls-ex good ls-fixed-width color-box" style="text-align: right">a&#x3000;b&#x3000;c</p>
49494950

4950-
<p>UAs therefore must not append letter spacing to the right or trailing edge of a line:</p>
4951+
<p>UAs therefore <em>really should not</em> [[RFC6919]]
4952+
append letter spacing to the right or trailing edge of a line:
49514953

49524954
<p class="ls-ex bad ls-fixed-width color-box" style="text-align: right">a&#x3000;b&#x3000;c&#x3000;</p>
49534955
</div>
@@ -4957,6 +4959,12 @@ Word Spacing: the 'word-spacing' property</h3>
49574959
the total letter spacing between two adjacent <a>typographic character units</a> (after bidi reordering)
49584960
is specified by and rendered within
49594961
the innermost element that <em>contains</em> the boundary between the two <a>typographic character units</a>.
4962+
However, the UA may instead attach letter-spacing at element boundaries
4963+
to one or the other <a>typographic character unit</a>
4964+
using the letter-spacing value pertaining to its containing element.
4965+
4966+
Note: This secondary behavior is permitted in this level
4967+
due to Web-compat concerns.
49604968

49614969
<wpt>
49624970
letter-spacing/letter-spacing-bidi-002.html
@@ -4970,45 +4978,45 @@ Word Spacing: the 'word-spacing' property</h3>
49704978
</wpt>
49714979

49724980
<div class="example">
4973-
<p>A given value of 'letter-spacing' only affects the spacing
4974-
between characters completely contained within the element for which it is specified:
4981+
<p>An inline box is expected to only include
4982+
letter spacing between characters completely contained within that element,
4983+
thus excluding letter spacing on the right or trailing edge of the element:
49754984

49764985
<pre>
49774986
p { letter-spacing: 1em; }
4978-
span { letter-spacing: 2em; }
49794987

49804988
&lt;p>a&lt;span>bb&lt;/span>c&lt;/p></pre>
49814989

4982-
<p class="ls-ex">a&#x3000;<span class="color-box">b&#x3000;&#x3000;b</span>&#x3000;c</p>
4990+
<p class="ls-ex good">a&#x3000;<span class="color-box">b&#x3000;b</span>&#x3000;c</p>
49834991

4984-
<p>This also means that applying 'letter-spacing' to
4985-
an element containing only a single character
4986-
has no effect on the rendered result:
4992+
<p class="ls-ex bad">a&#x3000;<span class="color-box">b&#x3000;b&#x3000;</span>c</p>
4993+
4994+
<p>Consequently a given value of 'letter-spacing' is expected
4995+
to only affect the spacing between characters
4996+
completely contained within the element for which it is specified:
49874997

49884998
<pre>
49894999
p { letter-spacing: 1em; }
49905000
span { letter-spacing: 2em; }
49915001

4992-
&lt;p>a&lt;span>b&lt;/span>c&lt;/p></pre>
5002+
&lt;p>a&lt;span>bb&lt;/span>c&lt;/p></pre>
49935003

4994-
<p class="ls-ex">a&#x3000;<span class="color-box">b</span>&#X3000;c</p>
5004+
<p class="ls-ex">a&#x3000;<span class="color-box">b&#x3000;&#x3000;b</span>&#x3000;c</p>
49955005

4996-
<p>An inline box only includes
4997-
letter spacing between characters completely contained within that element:
5006+
<p>This further implies that applying 'letter-spacing' to
5007+
an element containing only a single character
5008+
has no effect on the rendered result:
49985009

49995010
<pre>
50005011
p { letter-spacing: 1em; }
5012+
span { letter-spacing: 2em; }
50015013

5002-
&lt;p>a&lt;span>bb&lt;/span>c&lt;/p></pre>
5003-
5004-
<p class="ls-ex good">a&#x3000;<span class="color-box">b&#x3000;b</span>&#x3000;c</p>
5005-
5006-
<p>It is incorrect to include the letter spacing on the right or trailing edge of the element:
5014+
&lt;p>a&lt;span>b&lt;/span>c&lt;/p></pre>
50075015

5008-
<p class="ls-ex bad">a&#x3000;<span class="color-box">b&#x3000;b&#x3000;</span>c</p>
5016+
<p class="ls-ex">a&#x3000;<span class="color-box">b</span>&#X3000;c</p>
50095017

5010-
<p>Letter spacing is inserted <strong>after</strong> RTL reordering,
5011-
so the letter spacing applied to the inner span below has no effect,
5018+
<p>Since letter spacing is inserted <strong>after</strong> RTL reordering,
5019+
the letter spacing applied to the inner span below likewise has no effect,
50125020
since after reordering the "c" doesn't end up next to "&#x5d0;":
50135021
<pre>
50145022
p { letter-spacing: 1em; }

0 commit comments

Comments
 (0)