@@ -15,10 +15,11 @@ Abstract: This module contains the features of CSS relating to text decoration,
1515</pre>
1616
1717<pre class="link-defaults">
18+ spec:css-backgrounds-3; type:property; text:box-shadow
1819spec:css-text-3; type:dfn; text:character
1920spec:fill-stroke-3; type:property;
20- text: fill
21- text: stroke
21+ text: fill
22+ text: stroke
2223</pre>
2324
2425<h2 id="intro">
@@ -153,7 +154,10 @@ Line Decoration: Underline, Overline, and Strike-Through</h2>
153154 which the underline is propagated. The final line of text is fuchsia,
154155 but the underline underneath it is still the blue underline from the
155156 anonymous inline element.
156- <img src="images/underline-example.png" alt="Sample rendering of the above underline example">
157+ <img src="images/underline-example.png"
158+ alt="Sample rendering of the above underline example"
159+ width="267"
160+ height="182">
157161 This diagram shows the boxes involved in the example above. The
158162 rounded aqua line represents the anonymous inline element wrapping
159163 the inline contents of the paragraph element, the rounded blue line
@@ -167,7 +171,7 @@ Line Decoration: Underline, Overline, and Strike-Through</h2>
167171 span { font-size: 20px; vertical-align: top; text-shadow: green 0px 100px 0px; }
168172 </pre>
169173 <pre>
170- <div>Help, help! <span>I am under a hat!</span></div>
174+ <div>Help, help! <span>I am under a hat!</span></div>
171175 </pre>
172176 ...the <div> is the [=decorating box=] for its underline (in black),
173177 which is rendered uninterrupted through both the <div> and the <span>.
@@ -177,7 +181,10 @@ Line Decoration: Underline, Overline, and Strike-Through</h2>
177181 overrides the blue text shadow on the <div>.
178182 As a result, when the shadows are painted,
179183 the shadow of the <div>’s underline is disjoint across the two elements.
180- <img src="images/underline-example-2.png" alt="Sample rendering of the above underline example">
184+ <img src="images/underline-example-2.png"
185+ alt="Sample rendering of the above underline example"
186+ width="380"
187+ height="165">
181188 </div>
182189
183190 Note: Line decorations are propagated through the box tree,
@@ -202,7 +209,7 @@ Text Decoration Lines: the 'text-decoration-line' property</h3>
202209 This property,
203210 which is a <a>sub-property</a> of the 'text-decoration' shorthand,
204211 specifies what line decorations, if any, are added by the element.
205- Values other than ''text-decoration-line''
212+ Values other than ''text-decoration-line/none ''
206213 cause the element to originate the indicated text decorations,
207214 and to apply and propagate it as described [[#line-decoration|above]] .
208215
@@ -396,8 +403,8 @@ Determining the Position and Thickness of Line Decorations</h3>
396403 The line decoration positions are then calculated
397404 per line
398405 as follows
399- (treating <a>over</a> -positioned underlines</a> as <a>over</a> lines
400- and <a>under</a> -positioned overlines</a> as <a>under</a> lines):
406+ (treating <a>over</a> -positioned underlines as <a>over</a> lines
407+ and <a>under</a> -positioned overlines as <a>under</a> lines):
401408
402409 <dl>
403410 <dt> <a>over</a> lines
@@ -465,7 +472,10 @@ Determining the Position and Thickness of Line Decorations</h3>
465472 Using the same example, a line-through would in the second fragment,
466473 instead of averaging the two font sizes,
467474 split the line-through into two segments:
468- <p><img alt="" src="images/linethrough-averaging.gif">
475+ <p><img alt=""
476+ src="images/linethrough-averaging.gif"
477+ width="354"
478+ height="105">
469479
470480 In both cases, however, the superscript, due to the vertical-alignment shift,
471481 has no effect on the position of the line.
@@ -559,11 +569,13 @@ Text Underline Position: the 'text-underline-position' property</h3>
559569
560570 <div class="figure">
561571 <img title="text-underline-position: alphabetic"
562- alt="In a typical Latin font, the underline is positioned slightly
563- below the alphabetic baseline, leaving a gap between the line
564- and the bottom of most Latin letters, but crossing through
565- descenders such as the stem of a 'p'."
566- src="images/underline-position-alphabetic.png" >
572+ alt="In a typical Latin font, the underline is positioned slightly
573+ below the alphabetic baseline, leaving a gap between the line
574+ and the bottom of most Latin letters, but crossing through
575+ descenders such as the stem of a 'p'."
576+ src="images/underline-position-alphabetic.png"
577+ width="231"
578+ height="61">
567579 <p class="caption"> A typical “alphabetic” underline is positioned just below the alphabetic baseline
568580 </div>
569581
@@ -585,7 +597,9 @@ Text Underline Position: the 'text-underline-position' property</h3>
585597 <img title="text-underline-position: under"
586598 alt="In a typical Latin font, the underline is far enough
587599 below the text that it does not cross the bottom of a 'g'."
588- src="images/underline-position-under.png">
600+ src="images/underline-position-under.png"
601+ width="405"
602+ height="68">
589603 <p class="caption"> ''text-underline-position: under''
590604 </div>
591605 <div class="example">
@@ -628,13 +642,17 @@ Text Underline Position: the 'text-underline-position' property</h3>
628642 <img alt="In mixed Japanese-Latin vertical text, 'text-underline-position: left'
629643 places the underline on the left side of the text."
630644 title="text-underline-position: left"
631- src="images/underline-position-left.png">
645+ src="images/underline-position-left.png"
646+ width="40"
647+ height="168">
632648
633649 <td>
634650 <img alt="In mixed Japanese-Latin vertical text, 'text-underline-position: right'
635651 places the underline on the right side of the text."
636652 title="text-underline-position: right"
637- src="images/underline-position-right.png">
653+ src="images/underline-position-right.png"
654+ width="40"
655+ height="168">
638656
639657 <tr>
640658 <td> ''text-underline-position/left''
@@ -774,10 +792,14 @@ Text Decoration Line Uniformity</h3>
774792
775793 <div class="figure">
776794 <img src="images/underline-single.png"
777- alt="A single underline drawn under varying font sizes and vertical positions must be a single line.">
795+ alt="A single underline drawn under varying font sizes and vertical positions must be a single line."
796+ width="125"
797+ height="81">
778798 vs.
779799 <img src="images/underline-broken.png"
780- alt="Drawing multiple line segments, each with the position and thickness appropriate to the decorated text, is incorrect.">
800+ alt="Drawing multiple line segments, each with the position and thickness appropriate to the decorated text, is incorrect."
801+ width="120"
802+ height="80">
781803 <p class="caption"> Correct and incorrect rendering of <code> <u>A<sup>B</sup><big>C</big>D</u></code>
782804 </div>
783805
@@ -794,8 +816,8 @@ Text Decoration Line Uniformity</h3>
794816 UA consideration of descendant content will therefore result in better typography.
795817
796818 <div class="figure">
797- <img src="images/leftline-cross.png" alt="">
798- <img src="images/leftline-under.png" alt="">
819+ <img src="images/leftline-cross.png" alt="" width="80" height="219" >
820+ <img src="images/leftline-under.png" alt="" width="80" height="219" >
799821 <p class="caption">
800822 Due to the central baseline alignment of vertical text,
801823 a left-side underline on small vertical text will cut through the text
@@ -821,8 +843,10 @@ Text Decoration Line Uniformity</h3>
821843
822844 <div class="figure">
823845 <img src="images/underline-superscript.png"
824- alt="An underline for just the superscript 'st' in '1st' is drawn just below the superscript,
825- whereas an underline for the entire text is drawn at the appropriate position for full-size text.">
846+ alt="An underline for just the superscript 'st' in '1st' is drawn just below the superscript,
847+ whereas an underline for the entire text is drawn at the appropriate position for full-size text."
848+ width="80"
849+ height="38">
826850 <p class="caption"> Example of underline applied to <abbr title="element with 'vertical-align' or 'font-variant-position' applied"> superscripted text</abbr>
827851 vs. underline applied to <abbr title="element containing an element with 'vertical-align' or 'font-variant-position' applied"> text containing a superscript</abbr>
828852 <!-- illustration code, for future alterations
@@ -885,7 +909,9 @@ Text Decoration Line Trimming and Extension: the 'text-decoration-trim' property
885909 <div class="figure">
886910 <p><img title="text-decoration-skip-inset: auto"
887911 alt="An underline below a series of Chinese characters has a gap between two adjacent underlining elements."
888- src="images/decoration-skip-inset.png">
912+ src="images/decoration-skip-inset.png"
913+ width="223"
914+ height="77">
889915 <p class="caption"> ''text-decoration-skip-inset: auto'' for <code> <u>石井</u><u>艾俐俐</u></code>
890916</p>
891917 </div>
@@ -942,7 +968,7 @@ Text Decoration Line Continuity: the 'text-decoration-skip' shorthand and its su
942968 <p class="note"> Note that these properties inherit
943969 and that descendant elements can have a different setting.</p>
944970
945- The following addition is made to the default UA stylesheet for HTML:
971+ The following addition is made to the default UA stylesheet for HTML:
946972 <pre><code class="lang-css">
947973 ins, del { text-decoration-skip: none; }
948974 </code></pre>
@@ -968,7 +994,7 @@ Skipping Spaces: the 'text-decoration-skip-self' property</h4>
968994 This property specifies whether
969995 any text decoration lines drawn by its ancestors
970996 are propagated to or drawn across the element.
971- Values have the following meanings:</p>
997+ Values have the following meanings:
972998
973999 <dl dfn-type=value dfn-for=text-decoration-skip-self>
9741000 <dt> <dfn>auto</dfn> </dt>
@@ -1034,7 +1060,7 @@ Skipping Spaces: the 'text-decoration-skip-box' property</h4>
10341060 This property specifies what parts of the element's box area
10351061 any text decoration affecting the element must skip over.
10361062 It controls only text decoration lines drawn by its ancestors.
1037- Values have the following meanings:</p>
1063+ Values have the following meanings:
10381064
10391065 <dl dfn-type=value dfn-for=text-decoration-skip-box>
10401066 <dt> <dfn>none</dfn> </dt>
@@ -1073,7 +1099,7 @@ Skipping Spaces: the 'text-decoration-skip-spaces' property</h4>
10731099 This property specifies whether text decoration skips any spaces.
10741100 It controls all text decoration lines drawn by the element
10751101 and also any text decoration lines drawn by its ancestors.
1076- Values have the following meanings:</p>
1102+ Values have the following meanings:
10771103
10781104 <dl dfn-type=value dfn-for=text-decoration-skip-spaces>
10791105 <dt> <dfn>none</dfn> </dt>
@@ -1132,7 +1158,9 @@ Skipping Glyphs: the 'text-decoration-skip-ink' property</h4>
11321158 <div class="figure">
11331159 <img title="Skipping Descenders When Drawing an Underline"
11341160 alt="An alphabetic underline through Myanmar text skips around descenders and the vertical strokes of combining characters that drop below the alphabetic baseline."
1135- src="images/decoration-skip-ink.png">
1161+ src="images/decoration-skip-ink.png"
1162+ width="223"
1163+ height="77">
11361164 <p class="caption"> Skipping Glyph Ink
11371165 </div>
11381166
@@ -1173,52 +1201,52 @@ Skipping Glyphs: the 'text-decoration-skip-ink' property</h4>
11731201 </dl>
11741202
11751203 <div class="note">
1176- Note: Implementation experience shows that ink-skipping behavior often
1177- produces undesirable results when underlined text includes ideographic characters,
1178- as the underline position (depending on the font and user agent involved)
1179- often clashes with almost all the glyphs,
1180- such that only occasional fragments of the line remain to be rendered.
1181-
1182- In principle, this could be resolved by authors using
1183- ''text-underline-position: under'' (or possibly 'text-underline-offset' )
1184- to move the underline to a lower position that does not clash with the glyphs,
1185- but this is not always feasible, even if the user agent supports these properties
1186- and the author is aware of their potential.
1187- In particular, when a page contains arbitrary user-generated content,
1188- the author responsible for the design may not know whether CJK content will be present.
1189- And with mixed-script content,
1190- an underline position designed to work well for CJK content
1191- may look bad if the majority of the text is non-CJK.
1192-
1193- Therefore, when ''text-decoration-skip-ink/auto'' is in effect,
1194- a UA that implements ink-skipping <em> should</em> refrain from doing so in CJK contexts.
1195- (Authors who <em> do</em> want ink-skipping applied to CJK content can use
1196- the ''text-decoration-skip-ink/always'' value to explicitly request this.)
1197-
1198- Primarily, this means <em> not</em> applying ink-skipping for characters whose
1199- Unicode <a href="http://unicode.org/Public/UCD/latest/ucd/Scripts.txt">Script property</a>
1200- is any of the CJK scripts Han, Hiragana, Katakana, Bopomofo, or Hangul,
1201- or for characters whose Script property is Inherited or Common,
1202- and whose <a href="http://unicode.org/Public/UCD/latest/ucd/ScriptExtensions.txt">ScriptExtensions property</a>
1203- includes one or more of the CJK scripts.
1204-
1205- In addition, characters with a Unicode script property of Common and Inherited
1206- (primarily generic punctuation and symbols) need to be considered,
1207- as these may be used as part of a run of CJK-script content,
1208- and it is desirable to treat all text within a given script run in a consistent way.
1209- Therefore, the UA <em> should</em> resolve the text into script runs
1210- as described in the <a href="https://www.unicode.org/reports/tr24/#Usage_Model">“Implementation Notes”</a>
1211- of [[!UAX24]] “Unicode Script Property”, in particular subsections 5.1 and 5.2.
1212- After applying the heuristics described there (or a similar analysis of scripts),
1213- the UA <em> should</em> disable ink-skipping for all ranges of text
1214- that are determined to be in a CJK script.
1215-
1216- Issue: Are there other (non-CJK) scripts where it would be preferable
1217- to disable ink-skipping by default
1218- (when ''text-decoration-skip-ink/auto'' is in effect)?
1219- Perhaps Yi? Arabic?
1220- (See also discussion in <a href="https://github.com/w3c/csswg-drafts/issues/1288">Issue 1288</a> .)
1221- </div>
1204+ Note: Implementation experience shows that ink-skipping behavior often
1205+ produces undesirable results when underlined text includes ideographic characters,
1206+ as the underline position (depending on the font and user agent involved)
1207+ often clashes with almost all the glyphs,
1208+ such that only occasional fragments of the line remain to be rendered.
1209+
1210+ In principle, this could be resolved by authors using
1211+ ''text-underline-position: under'' (or possibly 'text-underline-offset' )
1212+ to move the underline to a lower position that does not clash with the glyphs,
1213+ but this is not always feasible, even if the user agent supports these properties
1214+ and the author is aware of their potential.
1215+ In particular, when a page contains arbitrary user-generated content,
1216+ the author responsible for the design may not know whether CJK content will be present.
1217+ And with mixed-script content,
1218+ an underline position designed to work well for CJK content
1219+ may look bad if the majority of the text is non-CJK.
1220+
1221+ Therefore, when ''text-decoration-skip-ink/auto'' is in effect,
1222+ a UA that implements ink-skipping <em> should</em> refrain from doing so in CJK contexts.
1223+ (Authors who <em> do</em> want ink-skipping applied to CJK content can use
1224+ the ''text-decoration-skip-ink/always'' value to explicitly request this.)
1225+
1226+ Primarily, this means <em> not</em> applying ink-skipping for characters whose
1227+ Unicode <a href="http://unicode.org/Public/UCD/latest/ucd/Scripts.txt">Script property</a>
1228+ is any of the CJK scripts Han, Hiragana, Katakana, Bopomofo, or Hangul,
1229+ or for characters whose Script property is Inherited or Common,
1230+ and whose <a href="http://unicode.org/Public/UCD/latest/ucd/ScriptExtensions.txt">ScriptExtensions property</a>
1231+ includes one or more of the CJK scripts.
1232+
1233+ In addition, characters with a Unicode script property of Common and Inherited
1234+ (primarily generic punctuation and symbols) need to be considered,
1235+ as these may be used as part of a run of CJK-script content,
1236+ and it is desirable to treat all text within a given script run in a consistent way.
1237+ Therefore, the UA <em> should</em> resolve the text into script runs
1238+ as described in the <a href="https://www.unicode.org/reports/tr24/#Usage_Model">“Implementation Notes”</a>
1239+ of [[!UAX24]] “Unicode Script Property”, in particular subsections 5.1 and 5.2.
1240+ After applying the heuristics described there (or a similar analysis of scripts),
1241+ the UA <em> should</em> disable ink-skipping for all ranges of text
1242+ that are determined to be in a CJK script.
1243+
1244+ Issue: Are there other (non-CJK) scripts where it would be preferable
1245+ to disable ink-skipping by default
1246+ (when ''text-decoration-skip-ink/auto'' is in effect)?
1247+ Perhaps Yi? Arabic?
1248+ (See also discussion in <a href="https://github.com/w3c/csswg-drafts/issues/1288">Issue 1288</a> .)
1249+ </div>
12221250
12231251<h4 id="ink-skip-shape">
12241252Shaping Interruptions</h4>
@@ -1257,7 +1285,9 @@ Shaping Interruptions</h4>
12571285 filling it.
12581286 In the right pair the underline is slightly lower,
12591287 and thus the portion of the underline within the “g” can only show a partial thickness."
1260- src="images/skip-ink-wisp.png">
1288+ src="images/skip-ink-wisp.png"
1289+ width="600"
1290+ height="206">
12611291 <p class="caption">
12621292 Hiding the portion of the underline within the bowl gives a cleaner look to the type,
12631293 while the curved ends of the underline outside it
@@ -1609,7 +1639,7 @@ Emphasis Mark Skip: the 'text-emphasis-skip' property</h3>
16091639 <tr><td> ؉ <td> U+0609 <td> ARABIC-INDIC PER MILLE SIGN
16101640 <tr><td> ؊ <td> U+060A <td> ARABIC-INDIC PER TEN THOUSAND SIGN
16111641 <tr><td> & <td> U+0026 <td> AMPERSAND
1612- <tr><td> ⁊ <td> U+204A <td> TIRONIAN SIGN E[[
1642+ <tr><td> ⁊ <td> U+204A <td> TIRONIAN SIGN ET
16131643 <tr><td> @ <td> U+0040 <td> COMMERCIAL AT
16141644 <tr><td> § <td> U+00A7 <td> SECTION SIGN
16151645 <tr><td> ¶ <td> U+00B6 <td> PILCROW SIGN
0 commit comments