@@ -1043,59 +1043,85 @@ <h3 id=text-underline-position-property><span class=secno>2.6. </span> Text
10431043
10441044 < h3 id =line-position > < span class =secno > 2.7. </ span > Determining the
10451045 Position and Thickness of Line Decorations</ h3 >
1046+ <!--
1047+ <p>Since line decorations can span elements with varying font sizes and
1048+ vertical alignments, the best position for a line decoration is not
1049+ necessarily the ideal position dictated by the <i>decorating box</i>.
1050+ In determining the position of text decoration lines within a given line box,
1051+ user agents must consider, for each <i>decorating box</i> on that line,
1052+ the “ideal” positions of such line decorations of each
1053+ run of text decorated by that <i>decorating box</i>
1054+ (each <dfn>considered run</dfn>).
1055+ However, descendants of the <i>decorating box</i>
1056+ that are skipped due to 'text-decoration-skip',
1057+ descendant inlines with ''text-decoration-skip: ink'',
1058+ and any descendants that do not participate in the <i>decorating box</i>’s inline formatting context
1059+ are excluded from the set of <i>considered fragments</i>.
1060+
1061+ <p>
1062+ <dfn>Decoration-affecting text</dfn> is any text decorated by a <i>decorating box</i>
1063+ that can affect the size and position of the decoration;
1064+ descendants that are skipped due to 'text-decoration-skip',
1065+ descendant inlines with ''text-decoration-skip: ink'',
1066+ and any descendants that do not participate in the <i>decorating box</i>’s inline formatting context
1067+ are not <i>considered fragments</i>.
1068+ The position and thickness of decorations on <i>considered fragments</i> are calculated by looking at sets of <i>considered fragments</i>:
1069+ each set is composed of all the <i>considered fragments</i> in a single line box
1070+ and decorated by the same <i>decorating box</i>.
1071+ -->
10461072
10471073 < p > Since line decorations can span elements with varying font sizes and
10481074 vertical alignments, the best position for a line decoration is not
10491075 necessarily the ideal position dictated by the < a
10501076 href ="#decorating-box "> < i > decorating box</ i > </ a > . Instead, it's
10511077 calculated, per line, from all text decorated by the < a
1052- href ="#decorating-box "> < i > decorating box</ i > </ a > on that line, the
1053- < i > considered text</ i > . However, descendants of the < a
1078+ href ="#decorating-box "> < i > decorating box</ i > </ a > on that line, the < dfn
1079+ id = considered-text > considered text</ dfn > . However, descendants of the < a
10541080 href ="#decorating-box "> < i > decorating box</ i > </ a > that are skipped due to
10551081 ‘< a href ="#text-decoration-skip "> < code
10561082 class =property > text-decoration-skip</ code > </ a > ’, descendant inlines with
10571083 ‘< code class =css > text-decoration-skip: ink</ code > ’, and any
10581084 descendants that do not participate in the < a
10591085 href ="#decorating-box "> < i > decorating box</ i > </ a > ’s inline formatting
1060- context are excluded from the set of < i > considered text</ i > .
1086+ context are excluded from the set of < a
1087+ href ="#considered-text "> < i > considered text</ i > </ a > .
10611088
1062- < p > The line decoration positions are then calculated per set of
1063- < i > considered fragments</ i > as follows (treating < a
1064- href ="#underline-left "> < i > over</ i > -positioned underlines</ a > as
1065- < i > over</ i > lines and < a href ="#underline-left "> < i > under</ i > -positioned
1089+ < p > The line decoration positions are then calculated per line as follows
1090+ (treating < a href ="#underline-left "> < i > over</ i > -positioned underlines</ a >
1091+ as < i > over</ i > lines and < a href ="#underline-left "> < i > under</ i > -positioned
10661092 overlines</ a > as < i > under</ i > lines):
10671093
10681094 < dl >
1069- < dt > < a
1070- href ="http://www.w3.org/TR/css3-writing-modes/#over "> < i > over</ i > </ a >
1095+ < dt > < a href ="http://www.w3.org/TR/css-writing-modes/#over "> < i > over</ i > </ a >
10711096 lines
10721097
10731098 < dd > Align the line decoration with respect to the highest
10741099 <!-- <i>text-over</i> baseline of the considered fragments. --> < a
1075- href ="http://www.w3.org/TR/css3 -writing-modes/#over "> < i > over</ i > </ a > edge
1076- of the < i > considered fragments </ i > ’ content boxes .
1100+ href ="http://www.w3.org/TR/css -writing-modes/#over "> < i > over</ i > </ a >
1101+ EM-box edge of the < a href =" #considered-text " > < i > considered text </ i > </ a > .
10771102
10781103 < dt > < a href ="#underline-alphabetic "> < i > alphabetic</ i > </ a > underlines
10791104
10801105 < dd >
10811106 < p > The alphabetic underline position is calculated by taking the ideal
1082- offset (from the alphabetic baseline) of each < i > considered
1083- fragment</ i > , averaging those, and then using the lowest alphabetic
1084- baseline to actually position the line. (Alphabetic baselines can differ
1085- between ‘< code class =css > baseline</ code > ’-aligned boxes if the
1086- dominant baseline is non-alphabetic.) To prevent superscripts and
1087- subscripts from throwing this position off-kilter, an inline with a
1088- non-initial computed ‘< code class =property > vertical-align</ code > ’ is
1089- treated as having the ideal underline position of their parent.
1107+ offset (from the alphabetic baseline) of each run of < a
1108+ href ="#considered-text "> < i > considered text</ i > </ a > , averaging those, and
1109+ then using the lowest alphabetic baseline to actually position the line.
1110+ (Alphabetic baselines can differ between ‘< code
1111+ class =css > baseline</ code > ’-aligned boxes if the dominant baseline is
1112+ non-alphabetic.) To prevent superscripts and subscripts from throwing
1113+ this position off-kilter, an inline with a non-initial computed ‘< code
1114+ class =property > vertical-align</ code > ’ is treated as having the ideal
1115+ underline position of its parent.
10901116
10911117 < dt > non-alphabetic < a
1092- href ="http://www.w3.org/TR/css3 -writing-modes/#under "> < i > under</ i > </ a >
1118+ href ="http://www.w3.org/TR/css -writing-modes/#under "> < i > under</ i > </ a >
10931119 lines
10941120
10951121 < dd > Position the line decoration with respect to the lowest
10961122 <!-- <i>text-under</i> baseline of the considered fragments. --> < a
1097- href ="http://www.w3.org/TR/css3 -writing-modes/#under "> < i > under</ i > </ a >
1098- edge of the < i > considered fragments </ i > ’ content boxes .
1123+ href ="http://www.w3.org/TR/css -writing-modes/#under "> < i > under</ i > </ a >
1124+ EM-box edge of the < a href =" #considered-text " > < i > considered text </ i > </ a > .
10991125
11001126 < dt > line-throughs
11011127
@@ -1104,12 +1130,20 @@ <h3 id=line-position><span class=secno>2.7. </span> Determining the
11041130 descendant with a different computed ‘< code
11051131 class =property > font-size</ code > ’. (This ensures that the text remains
11061132 effectively “crossed out” despite any font size changes.) For each
1107- set of < i > considered fragments</ i > with the same ‘< code
1108- class =property > font-size</ code > ’, compute an ideal position averaged
1109- from their direct contents and font metrics (assigning any fragment with
1110- non-initial ‘< code class =property > vertical-align</ code > ’ the ideal
1111- position of its parent). Position the portion of the line across each
1112- decorated fragment at that position.
1133+ run of < a href ="#considered-text "> < i > considered text</ i > </ a > with the
1134+ same ‘< code class =property > font-size</ code > ’, compute an ideal
1135+ position averaged from its font metrics. To prevent superscripts and
1136+ subscripts from throwing this position off-kilter, an inline with a
1137+ non-initial computed ‘< code class =property > vertical-align</ code > ’ is
1138+ treated as having the ideal underline position of its parent. Position
1139+ the portion of the line across each decorated fragment at that position.
1140+ < p class =issue > For simplicity, line-throughs should draw over each
1141+ element at that element's preferred/averaged position. This can produce
1142+ some undesirable jumpiness, but there doesn't appear to be any way to
1143+ avoid that which is correct in all instances, and all attempts are
1144+ worryingly complex. What position should line-throughts adopt over
1145+ elements that have a different font-size, but no < a
1146+ href ="#considered-text "> < i > considered text</ i > </ a > ?
11131147 </ dl >
11141148
11151149 < p > CSS does not define the thickness of line decorations. In determining
0 commit comments