Skip to content

Commit 92bbb8e

Browse files
committed
[css-inline] change applies-to definition based on w3c#2184
1 parent c07681b commit 92bbb8e

1 file changed

Lines changed: 50 additions & 4 deletions

File tree

css-inline-3/Overview.bs

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ Creating Initial Letters: the 'initial-letter' property</h3>
434434
Name: <dfn id="propdef-initial-letter">initial-letter</dfn>
435435
Value: normal | [<<number>> <<integer>>?]
436436
Initial: normal
437-
Applies to: <code>::first-letter</code> pseudo-elements and inline-level first child of a block container
437+
Applies to: <code>::first-letter</code> pseudo-elements and <a href="#first-most-inline-level">certain inline-level boxes</a> (see prose)
438438
Inherited: no
439439
Percentages: N/A
440440
Media: visual
@@ -512,9 +512,55 @@ Creating Initial Letters: the 'initial-letter' property</h3>
512512
The following code will create a 2-line dropped initial letter at the beginning of each paragraph:
513513
<pre>p::first-letter { initial-letter: 2; }</pre>
514514
</div>
515-
516-
The 'initial-letter' property does not apply to boxes
517-
that are not positioned at the start of the line due to bidi reordering.
515+
516+
<p id="first-most-inline-level">
517+
To give authors more control over which characters can be styled as an <a>initial letter</a>
518+
and to allow the possibility of multi-character <a>initial letters</a>
519+
(such as for first word or first phrase styling),
520+
the 'initial-letter' property applies not just
521+
to the CSS-defined ''::first-letter'' pseudo-element,
522+
but also to any
523+
“first-most inline-level descendant” of a block container--
524+
an inline-level box which is the first child of a block container
525+
is a “first-most inline-level descendant” of that block container,
526+
as is the first child of an inline box
527+
that is itself a “first-most inline-level descendant” of the block container.
528+
(Note, this definition is recursive.)
529+
However, the 'initial-letter' property does not apply to any box
530+
that is itself a descendant of an <a>initial letter box</a>.
531+
It also does not apply to a box
532+
that is not positioned at the start of the line due to bidi reordering.
533+
534+
<div class="example">
535+
For example,
536+
the <code>&lt;span></code>, <code>&lt;em></code>, and <code>&lt;b></code> elements
537+
in the following example are
538+
"first-most inline-level descendants" of the <code>&lt;p></code>,
539+
but the <code>&lt;strong></code> element
540+
is not:
541+
542+
<xmp>
543+
<p><span><em><b>This phrase</b> is styled</em> <strong>specially</strong>. &hellip;</span>
544+
</xmp>
545+
546+
If we apply the following rules:
547+
548+
<pre>
549+
em { initial-letter: 2; }
550+
b { initial-letter: 3; }
551+
</pre>
552+
553+
The result might be rendered as
554+
555+
<pre>
556+
[ADD RENDERING HERE]
557+
THIS PHRASE IS STYLED specially. &hellip;
558+
</pre>
559+
560+
(Note that the styling on <code>&lt;b></code>
561+
is ignored,
562+
as it has an ancestor already styled as an <a>initial letter</a>.)
563+
</div>
518564

519565
The 'initial-letter' property is undefined on children of <a>ruby</a> base container boxes
520566
and on <a>ruby</a> container boxes.

0 commit comments

Comments
 (0)