Skip to content

Commit 48d6b6c

Browse files
committed
[css-text-decor-3] Define 'decorating box', fix up element/box confusion.
1 parent 8fc4dfb commit 48d6b6c

2 files changed

Lines changed: 71 additions & 69 deletions

File tree

css-text-decor-3/Overview.html

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -330,33 +330,36 @@ <h3 id=terms><span class=secno>1.3. </span>Terminology</h3>
330330
<h2 id=line-decoration><span class=secno>2. </span> Line Decoration:
331331
Underline, Overline, and Strike-Through</h2>
332332

333-
<p>The following properties describe line decorations that are added to the
334-
content of an element. When specified on or propagated to an inline box,
335-
such decoration affects all the boxes generated by that element, and is
336-
further propagated to any in-flow block-level boxes that split the inline
337-
(see <a
333+
<p> The following properties describe line decorations that are added to
334+
the content of an element. When specified on or propagated to an inline
335+
box, that box becomes a <dfn id=decorating-box>decorating box</dfn> for
336+
that decoration, applying the decoration to all its fragments. The
337+
decoration is then further propagated to any in-flow block-level boxes
338+
that split the inline (see <a
338339
href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level">CSS2.1
339-
section 9.2.1.1</a>) When specified on or propagated to a ruby box, the
340-
decorations are further propagated only to the ruby base. When specified
341-
on or propagated to a a block container that establishes an inline
342-
formatting context, the decorations are propagated to an anonymous inline
343-
element that wraps all the in-flow inline-level children of the block
344-
container. For all other elements, the decorations are propagated to any
340+
section 9.2.1.1</a>). When specified on or propagated to a block container
341+
that establishes an inline formatting context, the decorations are
342+
propagated to an anonymous inline box that wraps all the in-flow
343+
inline-level children of the block container. When specified on or
344+
propagated to a ruby box, the decorations are propagated only to the ruby
345+
base. For all other box types, the decorations are propagated to all
345346
in-flow children.
346347

347-
<p class=note>Note that text decorations are not propagated to any
348+
<p class=note> Note that text decorations are not propagated to any
348349
out-of-flow descendants, nor to the contents of atomic inline-level
349-
descendants such as inline blocks and inline tables.
350+
descendants such as inline blocks and inline tables. They are also not
351+
propagated to inline children of inline boxes, although the decoration is
352+
<em>applied</em> to such boxes.
350353

351354
<p> By default underlines, overlines, and line-throughs are applied only to
352355
non-replaced inline boxes, and are drawn over all text (including white
353-
space, letter spacing, and word spacing). Elements containing no text,
354-
such as images, are not decorated. The ‘<a
355-
href="#text-decoration-skip"><code
356+
space, letter spacing, and word spacing). Atomic inlines, such as images,
357+
are not decorated. The ‘<a href="#text-decoration-skip"><code
356358
class=property>text-decoration-skip</code></a>’ property can be used to
357-
modify this behavior, for example allowing inline replaced elements to be
358-
underlined or requiring that white space be skipped. Margins, borders, and
359-
padding of the element originating the decoration are always skipped.
359+
modify this behavior, for example allowing atomic inlines to be underlined
360+
or requiring that white space be skipped. Margins, borders, and padding of
361+
the <a href="#decorating-box"><i>decorating box</i></a> are always
362+
skipped.
360363

361364
<p>In determining the position and thickness of text decoration lines, user
362365
agents may consider the font sizes and dominant baselines of descendants,
@@ -365,7 +368,7 @@ <h2 id=line-decoration><span class=secno>2. </span> Line Decoration:
365368
href="#text-decoration-color">color</a> and <a
366369
href="#text-decoration-style">line style</a> of decorations must remain
367370
the same on all decorations applied by a given element, even if descendant
368-
elements have different color or line style values.
371+
boxes have different color or line style values.
369372

370373
<div class=example>
371374
<p>The following figure shows the averaging for underline:
@@ -379,25 +382,24 @@ <h2 id=line-decoration><span class=secno>2. </span> Line Decoration:
379382
increases.
380383
</div>
381384

382-
<p>Relatively positioning a descendant moves all text decorations affecting
383-
it along with the descendant's text; it does not affect calculation of the
384-
decoration's initial position on that line. The ‘<code
385+
<p>Relatively positioning a descendant moves all text decorations applied
386+
to it along with the descendant's text; it does not affect calculation of
387+
the decoration's initial position on that line. The ‘<code
385388
class=property>visibility</code>’ property, ‘<a
386389
href="#text-shadow"><code class=property>text-shadow</code></a>’,
387390
filters, and other graphical transformations likewise affect text
388391
decorations as part of the text they're drawn on, even if the decorations
389-
were specified on an ancestor element.
392+
were specified on an ancestor box.
390393

391394
<div class=example>
392395
<p>In the following style sheet and document fragment:
393396

394-
<pre><code class=css>
397+
<pre>
395398
<!-- --> blockquote { text-decoration: underline; color: blue; }
396399
<!-- --> em { display: block; }
397-
<!-- --> cite { color: fuchsia; }
398-
<!----></code></pre>
400+
<!-- --> cite { color: fuchsia; }</pre>
399401

400-
<pre class=html><code>
402+
<pre>
401403
<!-- --> &lt;blockquote&gt;
402404
<!-- --> &lt;p&gt;
403405
<!-- --> &lt;span&gt;
@@ -407,15 +409,14 @@ <h2 id=line-decoration><span class=secno>2. </span> Line Decoration:
407409
<!-- --> &lt;cite&gt; —GwieF &lt;/cite&gt;
408410
<!-- --> &lt;/span&gt;
409411
<!-- --> &lt;/p&gt;
410-
<!-- --> &lt;/blockquote&gt;
411-
<!----></code></pre>
412+
<!-- --> &lt;/blockquote&gt;</pre>
412413

413414
<p>...the underlining for the blockquote element is propagated to an
414-
anonymous inline element that surrounds the span element, causing the
415-
text "Help, help!" to be blue, with the blue underlining from the
416-
anonymous inline underneath it, the color being taken from the blockquote
417-
element. The <code>&lt;em&gt;text&lt;/em&gt;</code> in the em block is
418-
also underlined, as it is in an in-flow block to which the underline is
415+
anonymous inline box that surrounds the span element, causing the text
416+
"Help, help!" to be blue, with the blue underlining from the anonymous
417+
inline underneath it, the color being taken from the blockquote element.
418+
The <code>&lt;em&gt;text&lt;/em&gt;</code> in the em block is also
419+
underlined, as it is in an in-flow block to which the underline is
419420
propagated. The final line of text is fuchsia, but the underline
420421
underneath it is still the blue underline from the anonymous inline
421422
element.
@@ -783,9 +784,10 @@ <h3 id=text-decoration-skip-property><span class=secno>2.5. </span> Text
783784
class=css>edges</code></dfn>
784785

785786
<dd>The UA should place the start and end of the line inwards from the
786-
content edge of the decorating element so that, e.g. two underlined
787-
elements side-by-side do not appear to have a single underline. (This is
788-
important in Chinese, where underlining is a form of punctuation.)
787+
content edge of the <i>decorating element</i> so that, e.g. two
788+
underlined elements side-by-side do not appear to have a single
789+
underline. (This is important in Chinese, where underlining is a form of
790+
punctuation.)
789791

790792
<dt><dfn id=box-decoration
791793
title="text-decoration-skip:box-decoration"><code

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

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -167,32 +167,34 @@ <h3 id="terms">Terminology</h3>
167167
<h2 id="line-decoration">
168168
Line Decoration: Underline, Overline, and Strike-Through</h2>
169169

170-
<p>The following properties describe line decorations that are added
171-
to the content of an element. When specified on or propagated to
172-
an inline box, such decoration affects all the boxes generated
173-
by that element, and is further propagated to any in-flow block-level
174-
boxes that split the inline
175-
(see <a href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level">CSS2.1 section 9.2.1.1</a>)
176-
When specified on or propagated to a ruby box, the decorations are
177-
further propagated only to the ruby base.
178-
When specified on or propagated to a a block container that establishes
179-
an inline formatting context, the decorations are propagated to an
180-
anonymous inline element that wraps all the in-flow inline-level children
181-
of the block container. For all other elements, the decorations are
182-
propagated to any in-flow children.
183-
184-
<p class="note">Note that text decorations are not propagated to any
185-
out-of-flow descendants, nor to the contents of atomic inline-level
186-
descendants such as inline blocks and inline tables.
170+
<p>
171+
The following properties describe line decorations that are added to the content of an element.
172+
When specified on or propagated to an inline box,
173+
that box becomes a <dfn>decorating box</dfn> for that decoration,
174+
applying the decoration to all its fragments.
175+
The decoration is then further propagated to any in-flow block-level boxes that split the inline
176+
(see <a href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level">CSS2.1 section 9.2.1.1</a>).
177+
When specified on or propagated to a block container that establishes an inline formatting context,
178+
the decorations are propagated to an anonymous inline box that wraps all the in-flow inline-level children of the block container.
179+
When specified on or propagated to a ruby box,
180+
the decorations are propagated only to the ruby base.
181+
For all other box types,
182+
the decorations are propagated to all in-flow children.
183+
184+
<p class="note">
185+
Note that text decorations are not propagated to any out-of-flow descendants,
186+
nor to the contents of atomic inline-level descendants such as inline blocks and inline tables.
187+
They are also not propagated to inline children of inline boxes,
188+
although the decoration is <em>applied</em> to such boxes.
187189

188190
<p>
189191
By default underlines, overlines, and line-throughs are applied only to non-replaced inline boxes,
190192
and are drawn over all text (including white space, letter spacing, and word spacing).
191-
Elements containing no text, such as images, are not decorated.
193+
Atomic inlines, such as images, are not decorated.
192194
The 'text-decoration-skip' property can be used to modify this behavior,
193-
for example allowing inline replaced elements to be underlined
195+
for example allowing atomic inlines to be underlined
194196
or requiring that white space be skipped.
195-
Margins, borders, and padding of the element originating the decoration are always skipped.
197+
Margins, borders, and padding of the <i>decorating box</i> are always skipped.
196198

197199
<p>In determining the position and thickness of text decoration lines,
198200
user agents may consider the font sizes and dominant baselines of
@@ -201,7 +203,7 @@ <h2 id="line-decoration">
201203
<a href="#text-decoration-color">color</a> and
202204
<a href="#text-decoration-style">line style</a> of decorations must
203205
remain the same on all decorations applied by a given element, even
204-
if descendant elements have different color or line style values.</p>
206+
if descendant boxes have different color or line style values.</p>
205207

206208
<div class="example">
207209
<p>The following figure shows the averaging for underline:
@@ -217,20 +219,19 @@ <h2 id="line-decoration">
217219
</div>
218220

219221
<p>Relatively positioning a descendant moves all text decorations
220-
affecting it along with the descendant's text; it does not affect
222+
applied to it along with the descendant's text; it does not affect
221223
calculation of the decoration's initial position on that line.
222224
The 'visibility' property, 'text-shadow', filters, and other graphical transformations
223225
likewise affect text decorations as part of the text they're drawn on,
224-
even if the decorations were specified on an ancestor element.
226+
even if the decorations were specified on an ancestor box.
225227

226228
<div class="example">
227229
<p>In the following style sheet and document fragment:</p>
228-
<pre><code class="css">
230+
<pre>
229231
<!-- --> blockquote { text-decoration: underline; color: blue; }
230232
<!-- --> em { display: block; }
231-
<!-- --> cite { color: fuchsia; }
232-
<!----></code></pre>
233-
<pre class="html"><code>
233+
<!-- --> cite { color: fuchsia; }</pre>
234+
<pre>
234235
<!-- --> &lt;blockquote&gt;
235236
<!-- --> &lt;p&gt;
236237
<!-- --> &lt;span&gt;
@@ -240,10 +241,9 @@ <h2 id="line-decoration">
240241
<!-- --> &lt;cite&gt; &mdash;GwieF &lt;/cite&gt;
241242
<!-- --> &lt;/span&gt;
242243
<!-- --> &lt;/p&gt;
243-
<!-- --> &lt;/blockquote&gt;
244-
<!----></code></pre>
244+
<!-- --> &lt;/blockquote&gt;</pre>
245245
<p>...the underlining for the blockquote element is propagated to an
246-
anonymous inline element that surrounds the span element, causing
246+
anonymous inline box that surrounds the span element, causing
247247
the text "Help, help!" to be blue, with the blue underlining from
248248
the anonymous inline underneath it, the color being taken from the
249249
blockquote element. The <code>&lt;em&gt;text&lt;/em&gt;</code>
@@ -492,7 +492,7 @@ <h3 id="text-decoration-skip-property">
492492
distance to either side of the glyph outline.</dd>
493493
<dt><dfn title="text-decoration-skip:edges">''edges''</dfn></dt>
494494
<dd>The UA should place the start and end of the line inwards from
495-
the content edge of the decorating element so that, e.g. two
495+
the content edge of the <i>decorating element</i> so that, e.g. two
496496
underlined elements side-by-side do not appear to have a single
497497
underline. (This is important in Chinese, where underlining is a
498498
form of punctuation.)</dd>

0 commit comments

Comments
 (0)