@@ -125,6 +125,27 @@ spec:selectors-4; type:dfn; text:selector
125125 padding: 0.25em;
126126 display: table;
127127 }
128+
129+ .ls-ex .letter {
130+ position: relative;
131+ padding: 0 0.5em;
132+ display: inline-block;
133+ }
134+ .ls-ex .letter::before {
135+ content: "";
136+ position: absolute;
137+ border: 1px solid black;
138+ border-bottom: none;
139+ left: 0;
140+ right: 0;
141+ top: 0;
142+ height: 10px;
143+ margin: 0 0.5px;
144+ }
145+ .ls-ex .letter.ls1 { padding: 0 0.5em 0 0.5em; }
146+ .ls-ex .letter.ls2 { padding: 0 1em 0 1em; }
147+ .ls-ex .letter.first { padding-left: 0; }
148+ .ls-ex .letter.last { padding-right: 0; }
128149</style>
129150
130151<h2 id="intro">
@@ -10203,49 +10224,35 @@ Tracking: the 'letter-spacing' property</h3>
1020310224 letter-spacing/letter-spacing-205.html
1020410225 </wpt>
1020510226
10206- <!-- THIS EXAMPLE IS WRONG FIX IT
1020710227 <div class="example">
10208- An inline box is expected to only include
10209- letter spacing between characters completely contained within that element,
10210- thus excluding letter spacing on the right or trailing edge of the element:
10228+ As each letter with letter-spacing places
10229+ half of the space assigned to it before
10230+ and half after,
10231+ this adds up to the full amount of spacing between adjacent letters.
10232+ No spacing is added at the start or end of the line.
1021110233
1021210234 <pre highlight=css> p { letter-spacing: 1em; }</pre>
1021310235
10214- <xmp highlight=html><p> a<span> bb</span> c</p></xmp>
10215-
10216- <p class="ls-ex good"> a <span class="color-box"> b b</span>  c</p>
10236+ <xmp highlight=html><p> aa<span> bb</span> cc</p></xmp>
1021710237
10218- <p class="ls-ex bad"> a  < span class="color-box"> b b  </span> c </p>
10238+ <p class="ls-ex"><span class="letter first ls1"> a </ span><span class="letter ls1"> a </span><span><span class="letter ls1"> b </span><span class="letter ls1"> b </span></span><span class="letter ls1"> c </span><span class="letter ls1 last"> c </span> </p>
1021910239
10220- Consequently a given value of 'letter-spacing' is expected
10221- to only affect the spacing between characters
10222- completely contained within the element for which it is specified:
10240+ When the value varies between adjacent inlines,
10241+ the effective spacing between adjacent letters of different inlines
10242+ amounts to the average between the two.
1022310243
1022410244 <pre highlight=css>
1022510245 p { letter-spacing: 1em; }
1022610246 span { letter-spacing: 2em; }
1022710247 </pre>
1022810248
10229- <xmp highlight=html><p> a <span> bb</span> c </p></xmp>
10249+ <xmp highlight=html><p> aa <span> bb</span> cc </p></xmp>
1023010250
10231- <p class="ls-ex"> a  < span class="color-box"> b   b</span>  c </p>
10251+ <p class="ls-ex"><span class="letter first ls1"> a </ span><span class="letter ls1"> a </span><span><span class="letter ls2"> b </span><span class="letter ls2"> b</span></span><span class="letter ls1"> c </span><span class="letter ls1 last"> c </span> </p>
1023210252
10233- <p> This further implies that applying 'letter-spacing' to
10234- an element containing only a single character
10235- has no effect on the rendered result:
10236-
10237- <pre highlight=css>
10238- p { letter-spacing: 1em; }
10239- span { letter-spacing: 2em; }
10240- </pre>
10241-
10242- <xmp highlight=html><p> a<span> b</span> c</p></xmp>
10243-
10244- <p class="ls-ex"> a <span class="color-box"> b</span>  c</p>
10245-
10246- Since letter spacing is inserted <strong> after</strong> RTL reordering,
10247- the letter spacing applied to the inner span below likewise has no effect,
10248- since after reordering the "c" doesn’t end up next to "א":
10253+ Letter spacing is inserted <strong> after</strong> RTL reordering.
10254+ This affects which letter has spacing suppressed on one side
10255+ due to being at the edge of the line.
1024910256
1025010257 <pre highlight=css>
1025110258 p { letter-spacing: 1em; }
@@ -10259,9 +10266,8 @@ Tracking: the 'letter-spacing' property</h3>
1025910266 <bdo dir=ltr> <p>ab<span>cא</span>בג</p></bdo>
1026010267 </pre>
1026110268
10262- <p class="ls-ex"> a b  < span class="color-box "> c</span>   < span class="color-box "> א</span>  &# x5d1; &# x5d2;</p>
10269+ <p class="ls-ex"><span class="letter first ls1"> a </span><span class="letter ls1"> b </ span><span class="letter ls2 "> c</span><bdi dir=rtl>< span class="letter ls2 last "> א</span><span class="letter ls1"> &# x5d1;</span><span class="letter ls1"> &# x5d2;</span></bdi> </p>
1026310270 </div>
10264- -->
1026510271
1026610272 For the purpose of 'letter-spacing' ,
1026710273 each consecutive run of [=atomic inlines=]
0 commit comments