@@ -467,17 +467,16 @@ Text Underline Position: the 'text-underline-position' property</h3>
467
467
468
468
<pre class="propdef">
469
469
Name : text-underline-position
470
- Value : auto | [ under || [ left | right ] ]
470
+ Value : auto | [ from-font | under ] || [ left | right ]
471
471
Initial : auto
472
472
Inherited : yes
473
473
Computed value : specified keyword(s)
474
474
Animation type : discrete
475
475
</pre>
476
476
477
- This property sets the position of an underline with respect to the element.
478
- (It does not affect underlines specified by ancestor elements.)
479
- The exact position of the underline can be further adjusted
480
- with 'text-underline-position' .
477
+ This property sets the position of an underline with respect to the element,
478
+ and sets its [=zero position=] for further adjustment by 'text-underline-offset' .
479
+ It does not affect underlines specified by ancestor elements.
481
480
482
481
<div class="example">
483
482
The following example styles modern Chinese, Japanese, and Korean
@@ -519,6 +518,13 @@ Text Underline Position: the 'text-underline-position' property</h3>
519
518
<p class="caption"> A typical “alphabetic” underline is positioned just below the alphabetic baseline
520
519
</div>
521
520
521
+ <dt> <dfn>from-font</dfn>
522
+ <dd>
523
+ If the <a>first available font</a> has
524
+ metrics indicating a preferred underline offset,
525
+ use that offset,
526
+ otherwise behaves as ''text-underline-offset/auto'' .
527
+
522
528
<dt> <dfn id="underline-under">under</dfn>
523
529
<dd>
524
530
The underline is positioned <i> under</i> the element's text content.
@@ -596,7 +602,7 @@ Text Underline Offset: the 'text-underline-offset' property</h3>
596
602
597
603
<pre class="propdef">
598
604
Name : text-underline-offset
599
- Value : auto | from-font | <<length>>
605
+ Value : auto | <<length>>
600
606
Initial : auto
601
607
Applies to : all elements
602
608
Inherited : yes
@@ -606,29 +612,28 @@ Text Underline Offset: the 'text-underline-offset' property</h3>
606
612
</pre>
607
613
608
614
This property, which is <em> not</em> a <a>sub-property</a> of the 'text-decoration' shorthand,
609
- sets the offset of underlines from their initial position.
615
+ sets the offset of underlines from their [=zero position=] .
616
+ Positive offsets represent distances outward from the text;
617
+ negative offsets inward.
610
618
611
619
Values have the following meanings:
612
620
613
621
<dl dfn-for=text-underline-offset dfn-type=value>
614
622
<dt> <dfn>auto</dfn>
615
623
<dd>
616
- The UA chooses an appropriate offset for underlines.
624
+ <p> The UA chooses an appropriate offset for underlines.
617
625
618
- <dt> <dfn>from-font</dfn>
619
- <dd>
620
- If the <a>first available font</a> has
621
- metrics indicating a preferred underline offset,
622
- use that offset,
623
- otherwise behaves as ''text-underline-offset/auto'' .
626
+ However, this offset must be zero
627
+ if ''text-underline-position/from-font'' was specified
628
+ and the UA was able to extract an appropriate metric to use
629
+ from the font.
624
630
625
631
<dt> <dfn><<length>>
626
632
<dd>
627
- Specifies the offset of underlines as a length.
628
- This replaces any information in the font
629
- or derived from glyph shapes / character ranges.
630
- Authors are strongly encouraged to use ''em'' units
631
- so that the offset scales with the font.
633
+ <p>Specifies the offset of underlines as a fixed length.
634
+
635
+ Note: A length will inherit as a fixed value,
636
+ and will not scale with the font.
632
637
</dl>
633
638
634
639
When the value of the 'text-decoration-line' property is either
@@ -638,40 +643,45 @@ Text Underline Offset: the 'text-underline-offset' property</h3>
638
643
<h4 id="line-offset-zero">
639
644
Underline Offset Origin (Zero Position)</h4>
640
645
641
- The initial position of the underline depends on the value of 'text-underline-position'
646
+ The <dfn lt="underline zero position" local-lt="zero position">zero position</dfn> of the underline
647
+ depends on the value of 'text-underline-position'
642
648
as detailed below.
643
649
644
650
<table class="data">
645
651
<caption> Interaction of 'text-underline-position' and 'text-underline-offset'
646
652
<thead>
647
653
<tr>
648
654
<th> 'text-underline-position'
649
- <th>Initial Position
655
+ <th> Zero Position
650
656
<th> Positive Direction
651
657
<tbody>
652
658
<tr>
653
659
<td> ''text-underline-position/auto''
654
660
<td> alphabetic baseline
655
- <td><a>over</a>
661
+ <td> <a>under</a>
662
+ <tr>
663
+ <td> ''text-underline-position/from-font''
664
+ <td> position specified by the font metrics, falling back to alphabetic baseline
665
+ <td> <a>under</a>
656
666
<tr>
657
667
<td> ''text-underline-position/under''
658
668
<td> text-under edge
659
- <td><a>over </a>
669
+ <td> <a>under </a>
660
670
<tr>
661
- <td>''text-underline-position/over ''
662
- <td>text-over edge
671
+ <td> ''text-underline-position/left ''
672
+ <td> text-under (left) edge
663
673
<td> <a>under</a>
674
+ <tr>
675
+ <td> ''text-underline-position/right''
676
+ <td> text-over (right) edge
677
+ <td> <a>over</a>
664
678
</table>
665
679
666
- <ul>
667
- <li>The line is aligned to the outside of the specified position.
668
- (Below for ''text-underline-position/under''/''text-underline-position/auto'' positions,
669
- above for ''text-underline-position/over''.)
670
- <li>Positive lengths represent inward distances; negative lengths outward.
671
- <li>Automatic adjustments made to accommodate descendant content are maintained;
672
- the 'text-underline-offset' is in addition to those.
673
- <span class="issue">Should this be removed?</span>
674
- </ul>
680
+ The underline is aligned to the outside of the specified position
681
+ (extending its thickness in the positive direction only).
682
+
683
+ Any automatic adjustments made to accommodate descendant content are maintained;
684
+ the 'text-underline-offset' is in addition to those.
675
685
676
686
<h4 id="line-auto-offset">
677
687
Using Font Metrics for Automatic Positioning</h4>
@@ -680,7 +690,9 @@ Using Font Metrics for Automatic Positioning</h4>
680
690
about the appropriate position of a line decoration.
681
691
The UA should use such font-based information
682
692
in its choice of ''text-underline-offset/auto'' offset
683
- wherever appropriate.
693
+ wherever appropriate,
694
+ and must use such information
695
+ when ''text-underline-position/from-font'' is specified for 'text-underline-position' .
684
696
685
697
Note: Typically, OpenType font metrics give the position
686
698
of an ''text-underline-position/alphabetic'' underline;
0 commit comments