Skip to content

Commit b3fbc24

Browse files
committed
[css-text-decor] Undefine text-decoration positions, since this is still an issue.
--HG-- extra : rebase_source : 070c78d35fcfd5a9ce6eca7c4c3132b0c209c979
1 parent 820988d commit b3fbc24

File tree

2 files changed

+90
-150
lines changed

2 files changed

+90
-150
lines changed

css-text-decor/Overview.html

Lines changed: 84 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
rel=dcterms.rights>
1111
<meta content="CSS Text Decoration Module Level 3" name=dcterms.title>
1212
<meta content=text name=dcterms.type>
13-
<meta content=2013-05-13 name=dcterms.date>
13+
<meta content=2013-06-10 name=dcterms.date>
1414
<meta content="Elika J. Etemad" name=dcterms.creator>
1515
<meta content="Koji Ishii" name=dcterms.creator>
1616
<meta content=W3C name=dcterms.publisher>
@@ -30,13 +30,13 @@
3030
<h1 class=p-name>CSS Text Decoration Module Level 3</h1>
3131

3232
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft <span
33-
class=dt-updated><span class=value-title title=20130513>13 May
33+
class=dt-updated><span class=value-title title=20130610>10 June
3434
2013</span></span></h2>
3535

3636
<dl>
3737
<dt>This version:</dt>
3838
<!--
39-
<dd><a class="u-url" href="http://www.w3.org/TR/2013/WD-css-text-decor-3-20130513/">http://www.w3.org/TR/2013/WD-css-text-decor-3-20130513/</a></dd>
39+
<dd><a class="u-url" href="http://www.w3.org/TR/2013/WD-css-text-decor-3-20130610/">http://www.w3.org/TR/2013/WD-css-text-decor-3-20130610/</a></dd>
4040
-->
4141

4242
<dd><a class=u-url
@@ -207,9 +207,6 @@ <h2 class="no-num no-toc" id=contents> Table of Contents</h2>
207207
<li><a href="#text-underline-position-property"><span class=secno>2.6.
208208
</span> Text Underline Position: the ‘<code
209209
class=property>text-underline-position</code>’ property</a>
210-
211-
<li><a href="#line-position"><span class=secno>2.7. </span> Determining
212-
the Position and Thickness of Line Decorations</a>
213210
</ul>
214211

215212
<li><a href="#emphasis-marks"><span class=secno>3. </span> Emphasis
@@ -1041,136 +1038,101 @@ <h3 id=text-underline-position-property><span class=secno>2.6. </span> Text
10411038
modes, both values are treated as ‘<code class=css>under</code>’.)
10421039
</div>
10431040

1044-
<h3 id=line-position><span class=secno>2.7. </span> Determining the
1045-
Position and Thickness of Line Decorations</h3>
1046-
<!--
1041+
<p>The exact position and thickness of line decorations is UA-defined in
1042+
this level. However, the UA must use a single thickness and position on
1043+
each line for the decorations deriving from a single <a
1044+
href="#decorating-box"><i>decorating box</i></a>. <!--
1045+
<h3 id="line-position">
1046+
Determining the Position and Thickness of Line Decorations</h3>
1047+
10471048
<p>Since line decorations can span elements with varying font sizes and
10481049
vertical alignments, the best position for a line decoration is not
10491050
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>).
1051+
Instead, it's calculated, per line, from all text decorated by the <i>decorating box</i> on that line,
1052+
the <dfn>considered text</dfn>.
10551053
However, descendants of the <i>decorating box</i>
10561054
that are skipped due to 'text-decoration-skip',
10571055
descendant inlines with ''text-decoration-skip: ink'',
10581056
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>.
1057+
are excluded from the set of <i>considered text</i>.
10601058
10611059
<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-
-->
1072-
1073-
<p>Since line decorations can span elements with varying font sizes and
1074-
vertical alignments, the best position for a line decoration is not
1075-
necessarily the ideal position dictated by the <a
1076-
href="#decorating-box"><i>decorating box</i></a>. Instead, it's
1077-
calculated, per line, from all text decorated by 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
1080-
href="#decorating-box"><i>decorating box</i></a> that are skipped due to
1081-
<a href="#text-decoration-skip"><code
1082-
class=property>text-decoration-skip</code></a>’, descendant inlines with
1083-
<code class=css>text-decoration-skip: ink</code>’, and any
1084-
descendants that do not participate in the <a
1085-
href="#decorating-box"><i>decorating box</i></a>’s inline formatting
1086-
context are excluded from the set of <a
1087-
href="#considered-text"><i>considered text</i></a>.
1088-
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
1092-
overlines</a> as <i>under</i> lines):
1060+
The line decoration positions are then calculated
1061+
per line
1062+
as follows
1063+
(treating <a href="#underline-left"><i>over</i>-positioned underlines</a> as <i>over</i> lines
1064+
and <a href="#underline-left"><i>under</i>-positioned overlines</a> as <i>under</i> lines):
10931065
10941066
<dl>
1095-
<dt><a href="http://www.w3.org/TR/css-writing-modes/#over"><i>over</i></a>
1096-
lines
1097-
1098-
<dd> Align the line decoration with respect to the highest
1099-
<!-- <i>text-over</i> baseline of the considered fragments. --> <a
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>.
1102-
1103-
<dt><a href="#underline-alphabetic"><i>alphabetic</i></a> underlines
1104-
1105-
<dd>
1106-
<p>The alphabetic underline position is calculated by taking the ideal
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.
1116-
1117-
<dt>non-alphabetic <a
1118-
href="http://www.w3.org/TR/css-writing-modes/#under"><i>under</i></a>
1119-
lines
1120-
1121-
<dd> Position the line decoration with respect to the lowest
1122-
<!-- <i>text-under</i> baseline of the considered fragments. --> <a
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>.
1125-
1126-
<dt>line-throughs
1127-
1128-
<dd> Line-throughs essentially use the same sort of averaging as for
1129-
alphabetic underlines, but recompute the position when drawing across a
1130-
descendant with a different computed ‘<code
1131-
class=property>font-size</code>’. (This ensures that the text remains
1132-
effectively “crossed out” despite any font size changes.) For each
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>?
1067+
<dt><a href="http://www.w3.org/TR/css-writing-modes/#over"><i>over</i></a> lines
1068+
<dd>
1069+
Align the line decoration with respect to the highest
1070+
<a href="http://www.w3.org/TR/css-writing-modes/#over"><i>over</i></a> EM-box edge
1071+
of the <i>considered text</i>.
1072+
1073+
<dt><a href="#underline-alphabetic"><i>alphabetic</i></a> underlines
1074+
<dd>
1075+
<p>The alphabetic underline position is calculated by taking
1076+
the ideal offset (from the alphabetic baseline) of each run of <i>considered text</i>,
1077+
averaging those, and then using the lowest alphabetic baseline to actually position the line.
1078+
(Alphabetic baselines can differ between ''baseline''-aligned boxes
1079+
if the dominant baseline is non-alphabetic.)
1080+
To prevent superscripts and subscripts from throwing this position off-kilter,
1081+
an inline with a non-initial computed 'vertical-align'
1082+
is treated as having the ideal underline position of its parent.
1083+
1084+
<dt>non-alphabetic <a href="http://www.w3.org/TR/css-writing-modes/#under"><i>under</i></a> lines
1085+
<dd>
1086+
Position the line decoration with respect to the lowest
1087+
<a href="http://www.w3.org/TR/css-writing-modes/#under"><i>under</i></a> EM-box edge
1088+
of the <i>considered text</i>.
1089+
1090+
<dt>line-throughs
1091+
<dd>
1092+
Line-throughs essentially use the same sort of averaging as for alphabetic underlines,
1093+
but recompute the position when drawing across a descendant with a different computed 'font-size'.
1094+
(This ensures that the text remains effectively “crossed out” despite any font size changes.)
1095+
For each run of <i>considered text</i> with the same 'font-size',
1096+
compute an ideal position averaged from its font metrics.
1097+
To prevent superscripts and subscripts from throwing this position off-kilter,
1098+
an inline with a non-initial computed 'vertical-align'
1099+
is treated as having the ideal underline position of its parent.
1100+
Position the portion of the line across each decorated fragment at that position.
1101+
1102+
<p class='issue'>
1103+
For simplicity, line-throughs should draw over each element at that element's preferred/averaged position.
1104+
This can produce some undesirable jumpiness,
1105+
but there doesn't appear to be any way to avoid that which is correct in all instances,
1106+
and all attempts are worryingly complex.
1107+
What position should line-throughts adopt over elements that have a different font-size,
1108+
but no <i>considered text</i>?
11471109
</dl>
11481110
1149-
<p> CSS does not define the thickness of line decorations. In determining
1150-
the thickness of text decoration lines, user agents may consider the font
1151-
sizes, faces, and weights of descendants to provide an appropriately
1152-
averaged thickness.
1153-
1154-
<div class=example>
1155-
<p>The following figure shows the averaging for underline:
1156-
1157-
<p><img
1158-
alt="In the first rendering of the underlined text '1st a' with 'st' as a superscript, both the '1st' and the 'a' are rendered in a small font. In the second rendering, the 'a' is rendered in a larger font. In the third, both '1st' and 'a' are large."
1159-
height=105 src=underline-averaging.gif width=326>
1160-
1161-
<p>In the three fragments of underlined text, the underline is drawn
1162-
consecutively lower and thicker as the ratio of large text to small text
1163-
increases.
1164-
1165-
<p>Using the same example, a line-through would in the second fragment,
1166-
instead of averaging the two font sizes, split the line-through into two
1167-
segments:
1168-
1169-
<p><img alt="" src=linethrough-averaging.gif>
1170-
1171-
<p>In both cases, however, the superscript, due to the vertical-alignment
1172-
shift, has no effect on the position of the line.
1111+
<p>
1112+
CSS does not define the thickness of line decorations.
1113+
In determining the thickness of text decoration lines,
1114+
user agents may consider the font sizes, faces, and weights of descendants
1115+
to provide an appropriately averaged thickness.
1116+
1117+
<div class="example">
1118+
<p>The following figure shows the averaging for underline:
1119+
<p><img alt="In the first rendering of the underlined text '1st a'
1120+
with 'st' as a superscript, both the '1st' and the 'a'
1121+
are rendered in a small font. In the second rendering,
1122+
the 'a' is rendered in a larger font. In the third, both
1123+
'1st' and 'a' are large."
1124+
height="105" src="underline-averaging.gif" width="326">
1125+
<p>In the three fragments of underlined text, the underline is drawn
1126+
consecutively lower and thicker as the ratio of large text to small
1127+
text increases.</p>
1128+
<p>Using the same example, a line-through would in the second fragment,
1129+
instead of averaging the two font sizes,
1130+
split the line-through into two segments:
1131+
<p><img alt="" src="linethrough-averaging.gif">
1132+
<p>In both cases, however, the superscript, due to the vertical-alignment shift,
1133+
has no effect on the position of the line.
11731134
</div>
1135+
-->
11741136

11751137
<p>Some font formats (such as OpenType) can offer information about the
11761138
appropriate position of an underline. The UA should use such information

css-text-decor/Overview.src.html

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -680,35 +680,15 @@ <h3 id="text-underline-position-property">
680680
side of the text. (In horizontal writing modes, both values are
681681
treated as ''under''.)</p>
682682
</div>
683+
684+
<p>The exact position and thickness of line decorations is UA-defined in this level.
685+
However, the UA must use a single thickness and position on each line
686+
for the decorations deriving from a single <i>decorating box</i>.
683687

688+
<!--
684689
<h3 id="line-position">
685690
Determining the Position and Thickness of Line Decorations</h3>
686-
<!--
687-
<p>Since line decorations can span elements with varying font sizes and
688-
vertical alignments, the best position for a line decoration is not
689-
necessarily the ideal position dictated by the <i>decorating box</i>.
690-
In determining the position of text decoration lines within a given line box,
691-
user agents must consider, for each <i>decorating box</i> on that line,
692-
the “ideal” positions of such line decorations of each
693-
run of text decorated by that <i>decorating box</i>
694-
(each <dfn>considered run</dfn>).
695-
However, descendants of the <i>decorating box</i>
696-
that are skipped due to 'text-decoration-skip',
697-
descendant inlines with ''text-decoration-skip: ink'',
698-
and any descendants that do not participate in the <i>decorating box</i>’s inline formatting context
699-
are excluded from the set of <i>considered fragments</i>.
700691
701-
<p>
702-
<dfn>Decoration-affecting text</dfn> is any text decorated by a <i>decorating box</i>
703-
that can affect the size and position of the decoration;
704-
descendants that are skipped due to 'text-decoration-skip',
705-
descendant inlines with ''text-decoration-skip: ink'',
706-
and any descendants that do not participate in the <i>decorating box</i>’s inline formatting context
707-
are not <i>considered fragments</i>.
708-
The position and thickness of decorations on <i>considered fragments</i> are calculated by looking at sets of <i>considered fragments</i>:
709-
each set is composed of all the <i>considered fragments</i> in a single line box
710-
and decorated by the same <i>decorating box</i>.
711-
-->
712692
<p>Since line decorations can span elements with varying font sizes and
713693
vertical alignments, the best position for a line decoration is not
714694
necessarily the ideal position dictated by the <i>decorating box</i>.
@@ -731,7 +711,6 @@ <h3 id="line-position">
731711
<dt><a href="http://www.w3.org/TR/css-writing-modes/#over"><i>over</i></a> lines
732712
<dd>
733713
Align the line decoration with respect to the highest
734-
<!-- <i>text-over</i> baseline of the considered fragments. -->
735714
<a href="http://www.w3.org/TR/css-writing-modes/#over"><i>over</i></a> EM-box edge
736715
of the <i>considered text</i>.
737716
@@ -749,7 +728,6 @@ <h3 id="line-position">
749728
<dt>non-alphabetic <a href="http://www.w3.org/TR/css-writing-modes/#under"><i>under</i></a> lines
750729
<dd>
751730
Position the line decoration with respect to the lowest
752-
<!-- <i>text-under</i> baseline of the considered fragments. -->
753731
<a href="http://www.w3.org/TR/css-writing-modes/#under"><i>under</i></a> EM-box edge
754732
of the <i>considered text</i>.
755733
@@ -798,7 +776,7 @@ <h3 id="line-position">
798776
<p>In both cases, however, the superscript, due to the vertical-alignment shift,
799777
has no effect on the position of the line.
800778
</div>
801-
779+
-->
802780
<p>Some font formats (such as OpenType) can offer information
803781
about the appropriate position of an underline.
804782
The UA should use such information (such as the underline thickness,

0 commit comments

Comments
 (0)