Skip to content

Commit f7fcb0e

Browse files
committed
[css-text-decor-3] Clarifications to line position rules.
1 parent f5f74e8 commit f7fcb0e

2 files changed

Lines changed: 31 additions & 26 deletions

File tree

css-text-decor-3/Overview.html

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -971,37 +971,39 @@ <h3 id=line-position><span class=secno>2.7. </span> Determining the
971971
Position and Thickness of Line Decorations</h3>
972972

973973
<p>In determining the position of text decoration lines, user agents must
974-
first determine, per line, an "ideal" position for every fragment of a
975-
single <a href="#decorating-box"><i>decorating box</i></a>, then position
976-
the decoration as follows:
974+
consider, per line box, the "ideal" positions of all fragments of in-flow
975+
inline descendants of the <a href="#decorating-box"><i>decorating
976+
box</i></a> on that line as follows:
977977

978978
<dl>
979979
<dt>overlines (and <i>over</i>-positioned underlines)
980980

981-
<dd> Position the line with respect to the highest <i>over</i> content
982-
edge of the decorated fragments.
981+
<dd> Align the line decoration with respect to the highest
982+
<i>text-over</i> edge of the considered fragments.
983983

984984
<dt><a href="#alphabetic"><i>alphabetic</i></a> underlines
985985

986-
<dd> Position the line to an average of the ideal underlines of the
987-
decorated fragments, assigning any fragment with non-initial ‘<code
986+
<dd> Align the line decoration to an average of the ideal underlines of
987+
the considered fragments, assigning any inline with non-initial ‘<code
988988
class=property>vertical-align</code>’ the ideal position of its parent,
989-
but below the lowest alphabetic baseline considered.
989+
but keeping the line decoration below the lowest alphabetic baseline
990+
considered. (A considered alphabetic baseline can be above the averaged
991+
position if the dominant baseline is non-alphabetic.)
990992

991993
<dt>non-alphabetic underlines (and <a
992994
href="#under"><i>under</i></a>-positioned overlines)
993995

994-
<dd> Position the line with respect to the lowest <a
995-
href="#under"><i>under</i></a> content edge of the decorated fragments.
996+
<dd> Position the line decoration with respect to the lowest
997+
<i>text-under</i> edge of the considered fragments.
996998

997999
<dt>line-throughs
9981000

999-
<dd> For each set of decorated fragments with the same ‘<code
1001+
<dd> For each set of considered fragments with the same ‘<code
10001002
class=property>font-size</code>’, compute an ideal position averaged
10011003
from their direct contents and font metrics, assigning any fragment with
1002-
non-initial ‘<code class=property>vertical-align</code>’the ideal
1004+
non-initial ‘<code class=property>vertical-align</code> the ideal
10031005
position of its parent. Position the portion of the line across each
1004-
decorated fragment at the fragment's ideal position. (Essentially, this
1006+
decorated fragment at that fragment's ideal position. (Essentially, this
10051007
performs the same sort of averaging as for alphabetic underlines, but
10061008
recomputes the position when drawing across a descendant with a different
10071009
computed ‘<code class=property>font-size</code>’.) <span
@@ -1853,7 +1855,7 @@ <h3 class=no-num id=recent-changes> Changes since the <a
18531855
<li>Clarified and corrected the definitions for <a
18541856
href="#line-decoration">line decoration propagation</a>
18551857

1856-
<li>Changed the definitions for averaging <a href="#line-positions">line
1858+
<li>Changed the definitions for averaging <a href="#line-position">line
18571859
decoration positions</a> to better accommodate changes in font size.
18581860

18591861
<li>Changed ‘<code class=css>above</code>’ and ‘<code

css-text-decor-3/Overview.src.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -636,31 +636,34 @@ <h3 id="line-position">
636636
Determining the Position and Thickness of Line Decorations</h3>
637637

638638
<p>In determining the position of text decoration lines,
639-
user agents must first determine, per line,
640-
an "ideal" position for every fragment of a single <i>decorating box</i>,
641-
then position the decoration as follows:
639+
user agents must consider, per line box, the "ideal" positions of all fragments
640+
of in-flow inline descendants of the <i>decorating box</i> on that line
641+
as follows:
642642

643643
<dl>
644644
<dt>overlines (and <i>over</i>-positioned underlines)
645645
<dd>
646-
Position the line with respect to the highest <i>over</i> content edge of the decorated fragments.
646+
Align the line decoration with respect to the highest
647+
<i>text-over</i> edge of the considered fragments.
647648

648649
<dt><i>alphabetic</i> underlines
649650
<dd>
650-
Position the line to an average of the ideal underlines of the decorated fragments,
651-
assigning any fragment with non-initial 'vertical-align' the ideal position of its parent,
652-
but below the lowest alphabetic baseline considered.
651+
Align the line decoration to an average of the ideal underlines of the considered fragments,
652+
assigning any inline with non-initial 'vertical-align' the ideal position of its parent,
653+
but keeping the line decoration below the lowest alphabetic baseline considered.
654+
(A considered alphabetic baseline can be above the averaged position if the dominant baseline is non-alphabetic.)
653655

654656
<dt>non-alphabetic underlines (and <i>under</i>-positioned overlines)
655657
<dd>
656-
Position the line with respect to the lowest <i>under</i> content edge of the decorated fragments.
658+
Position the line decoration with respect to the lowest
659+
<i>text-under</i> edge of the considered fragments.
657660

658661
<dt>line-throughs
659662
<dd>
660-
For each set of decorated fragments with the same 'font-size',
663+
For each set of considered fragments with the same 'font-size',
661664
compute an ideal position averaged from their direct contents and font metrics,
662-
assigning any fragment with non-initial 'vertical-align'the ideal position of its parent.
663-
Position the portion of the line across each decorated fragment at the fragment's ideal position.
665+
assigning any fragment with non-initial 'vertical-align' the ideal position of its parent.
666+
Position the portion of the line across each decorated fragment at that fragment's ideal position.
664667
(Essentially, this performs the same sort of averaging as for alphabetic underlines,
665668
but recomputes the position when drawing across a descendant with a different computed 'font-size'.)
666669
<span class="issue">Need an example here</span>
@@ -1270,7 +1273,7 @@ <h3 class="no-num" id="recent-changes">
12701273
<ul>
12711274
<li>Changed line decorations to not skip margins/padding/borders of descendents' inline boxes.
12721275
<li>Clarified and corrected the definitions for <a href="#line-decoration">line decoration propagation</a>
1273-
<li>Changed the definitions for averaging <a href="#line-positions">line decoration positions</a>
1276+
<li>Changed the definitions for averaging <a href="#line-position">line decoration positions</a>
12741277
to better accommodate changes in font size.
12751278
<li>Changed ''above'' and ''below'' values of 'text-emphasis-position' and 'text-underline-position'
12761279
to ''over'' and ''under'' to match terminology in 'text-decoration-line'.

0 commit comments

Comments
 (0)