Skip to content

Commit ce97d1e

Browse files
committed
[css-inline-3] Define interaction of 'text-align' and 'initial-letters'. #884
1 parent beb3887 commit ce97d1e

1 file changed

Lines changed: 51 additions & 6 deletions

File tree

css-inline-3/Overview.bs

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ Creating Initial Letters: the 'initial-letters' property</h3>
462462
<dt><dfn><<integer>></dfn>
463463
<dd>
464464
This optional second argument
465-
defines the number of lines the initial letter should sink.
465+
defines the number of lines the initial letter should <dfn>sink</dfn>.
466466
Values less than one are invalid.
467467
If omitted, it duplicates the first argument,
468468
floored to the nearest positive whole number.
@@ -513,8 +513,10 @@ Creating Initial Letters: the 'initial-letters' property</h3>
513513
The following code will create a 2-line dropped initial letter at the beginning of each paragraph:
514514
<pre>p::first-letter { initial-letters: 2; }</pre>
515515
</div>
516-
517-
<p id="first-most-inline-level">
516+
517+
<h4 id="first-most-inline-leve">
518+
Applicability</h4>
519+
518520
To give authors more control over which characters can be styled as an <a>initial letter</a>
519521
and to allow the possibility of multi-character <a>initial letters</a>
520522
(such as for first word or first phrase styling),
@@ -570,7 +572,8 @@ Creating Initial Letters: the 'initial-letters' property</h3>
570572
its <a>used value</a> is ''initial-letters/normal'',
571573
and it is not formatted as an <a>initial letter</a>.
572574

573-
The 'initial-letters' property is undefined on children of <a>ruby</a> base container boxes
575+
The effect of the 'initial-letters' property is undefined
576+
on children of <a>ruby</a> base container boxes
574577
and on <a>ruby</a> container boxes.
575578

576579
<h4 id="initial-letter-properties">
@@ -1133,7 +1136,46 @@ Initial Letter Wrapping: the 'initial-letters-wrap' property</h3>
11331136
</div>
11341137

11351138
<h3 id="initial-letter-indentation">
1136-
Indentation and Multi-line Effects</h3>
1139+
Line Layout</h3>
1140+
1141+
An <a>initial letter box</a> is considered in-flow in its <a>block formatting context</a>,
1142+
and is part of the contents of the <a>line box</a> in which it originates.
1143+
Aside from vertical alignment,
1144+
its interaction with the rest of the contents of the line is as normal,
1145+
except in a few specific circumstances&hellip;
1146+
1147+
<h4 id="initial-letter-inline-flow">
1148+
Inline Flow Layout: Alignment and Justification</h4>
1149+
1150+
For a raised <a>initial letter box</a> (<a>sink</a> of ''1'')
1151+
no special consideration is given for alignment and justification:
1152+
it is treated similar to any other inline-level content.
1153+
1154+
However, if the <a>initial letter box</a> is sunk by more than ''1'',
1155+
then its inline-start edge is anchored to the inline-start edge
1156+
of the line box (after indentation)
1157+
and text alignment affects the remaining content of the line
1158+
in the remaining space,
1159+
without moving the <a>initial letter box</a> itself.
1160+
1161+
Note: The CSSWG was not aware of any reasonable use cases
1162+
for mixing non-start text alignment with dropped initial letters,
1163+
and this was the most sensible behavior proposed.
1164+
This behavior may be reconsidered if use cases require otherwise.
1165+
1166+
In addition, to ensure consistent alignment of all the impacted lines,
1167+
any 'letter-spacing' or <a>justification opportunity</a>
1168+
that would normally be introduced by
1169+
the juxtaposition of the contents of a sunken <a>initial letter</a>
1170+
and the subsequent contents of the line
1171+
is suppressed.
1172+
(Note that this does not affect 'word-spacing' or
1173+
the <a>justification opportunity</a> introduced by a <a>word separator</a>
1174+
because that space is provided by the <a>typographic character unit</a> alone
1175+
and not by its juxtaposition with an adjacent character.)
1176+
1177+
<h4 id="initial-letter-indentation">
1178+
Edge Effects: Indentation and Hanging Punctuation</h4>
11371179

11381180
'text-indent' and 'hanging-punctuation'
11391181
apply to the first line of text as normal in the presence of initial letters.
@@ -1144,7 +1186,10 @@ Indentation and Multi-line Effects</h3>
11441186
<img src="images/InitialLetterWithTextIndent.png" width="300"
11451187
alt="initial letter with text indent">
11461188
<figcaption>Initial letter with text indent. </figcaption>
1147-
</figure>
1189+
</figure>b
1190+
1191+
<h4 id="initial-letter-multi-line">
1192+
Multi-line Initial Letters</h4
11481193
11491194
If an initial letter is too long to fit on one line,
11501195
it wraps (according to the usual text-wrapping rules),

0 commit comments

Comments
 (0)