|
10 | 10 | rel=dcterms.rights> |
11 | 11 | <meta content="CSS Text Decoration Module Level 3" name=dcterms.title> |
12 | 12 | <meta content=text name=dcterms.type> |
13 | | - <meta content=2013-05-13 name=dcterms.date> |
| 13 | + <meta content=2013-06-10 name=dcterms.date> |
14 | 14 | <meta content="Elika J. Etemad" name=dcterms.creator> |
15 | 15 | <meta content="Koji Ishii" name=dcterms.creator> |
16 | 16 | <meta content=W3C name=dcterms.publisher> |
|
30 | 30 | <h1 class=p-name>CSS Text Decoration Module Level 3</h1> |
31 | 31 |
|
32 | 32 | <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 |
34 | 34 | 2013</span></span></h2> |
35 | 35 |
|
36 | 36 | <dl> |
37 | 37 | <dt>This version:</dt> |
38 | 38 | <!-- |
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> |
40 | 40 | --> |
41 | 41 |
|
42 | 42 | <dd><a class=u-url |
@@ -207,9 +207,6 @@ <h2 class="no-num no-toc" id=contents> Table of Contents</h2> |
207 | 207 | <li><a href="#text-underline-position-property"><span class=secno>2.6. |
208 | 208 | </span> Text Underline Position: the ‘<code |
209 | 209 | 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> |
213 | 210 | </ul> |
214 | 211 |
|
215 | 212 | <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 |
1041 | 1038 | modes, both values are treated as ‘<code class=css>under</code>’.) |
1042 | 1039 | </div> |
1043 | 1040 |
|
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 | +
|
1047 | 1048 | <p>Since line decorations can span elements with varying font sizes and |
1048 | 1049 | vertical alignments, the best position for a line decoration is not |
1049 | 1050 | 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>. |
1055 | 1053 | However, descendants of the <i>decorating box</i> |
1056 | 1054 | that are skipped due to 'text-decoration-skip', |
1057 | 1055 | descendant inlines with ''text-decoration-skip: ink'', |
1058 | 1056 | 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>. |
1060 | 1058 |
|
1061 | 1059 | <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): |
1093 | 1065 |
|
1094 | 1066 | <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>? |
1147 | 1109 | </dl> |
1148 | 1110 |
|
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. |
1173 | 1134 | </div> |
| 1135 | +--> |
1174 | 1136 |
|
1175 | 1137 | <p>Some font formats (such as OpenType) can offer information about the |
1176 | 1138 | appropriate position of an underline. The UA should use such information |
|
0 commit comments