Skip to content

Commit f8dcaca

Browse files
committed
[css-inline-3] Draft up some kind of line-sizing proposal so we have something to talk about. #3199
1 parent bbed734 commit f8dcaca

File tree

1 file changed

+97
-3
lines changed

1 file changed

+97
-3
lines changed

css-inline-3/Overview.bs

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Title: CSS Inline Layout Module Level 3
88
Shortname: css-inline
99
Level: 3
10-
Status: WD
10+
Status: ED
1111
Work Status: Revising
1212
Group: csswg
1313
TR: https://www.w3.org/TR/css-inline-3/
@@ -298,8 +298,8 @@ Alignment Shift: the 'baseline-shift' longhand</h4>
298298

299299
Issue: We would prefer to remove this, and are looking for feedback from SVG user agents as to whether it's necessary.
300300

301-
<h4 id="line-height-property">
302-
Line Spacing: the 'line-height' property</h4>
301+
<h3 id="line-height-property">
302+
Line Spacing: the 'line-height' property</h3>
303303

304304
<pre class="propdef">
305305
Name: line-height
@@ -324,6 +324,100 @@ Line Spacing: the 'line-height' property</h4>
324324
See also href="https://github.com/w3c/csswg-drafts/issues/3118">Issue 3118</a>
325325
and <a href="https://github.com/w3c/csswg-drafts/issues/2165">Issue 2165</a>.
326326

327+
<h3 id="line-sizing-property">
328+
Line Sizing Containment: the 'line-sizing' property</h3>
329+
330+
<pre class="propdef">
331+
Name: line-sizing
332+
Value: quirks-behavior | current-behavior | better-behavior | box-model-behavior | absolute-behavior
333+
Initial: current-behavior
334+
Applies to: block containers? inline boxes?
335+
Inherited: yes
336+
Percentages: N/A
337+
Computed value: the specified keyword
338+
</pre>
339+
340+
ISSUE: This is a rought draft of a proposal, and has not yet been approved by the CSSWG.
341+
Many variants have been included to promote discussion of possible behaviors;
342+
not all of them are expected to be kept.
343+
See discussion in <a href="https://github.com/w3c/csswg-drafts/issues/3199">Issue 3199</a>, <a href="https://lists.w3.org/Archives/Public/www-style/2011Mar/0364.html">Hyatt's message</a>, and <a href="https://dev.w3.org/cvsweb/~checkout~/csswg/css3-linebox/Attic/Overview.html?rev=1.5;content-type=text%2Fhtml#LineStacking">dbaron's proposal</a>.
344+
Also all the keywords are expected to be renamed.
345+
346+
This property controls the method by which line boxes are sized,
347+
and thus the spacing between lines of text.
348+
349+
Values have the following meanings:
350+
351+
<dl dfn-for=line-sizing dfn-type=value>
352+
<dt><dfn>quirks-behavior</dfn>
353+
<dd>
354+
Line boxes are sized, and content positioned within them,
355+
as defined in [[!CSS2]] except that
356+
any <a>inline box</a> <a lt="box fragment">fragment</a>
357+
that has zero borders and padding and
358+
that does not directly contain text or <a>preserved white space</a> [[!CSS-TEXT-3]]
359+
is ignored for this purpose.
360+
361+
<dt><dfn>current-behavior</dfn>
362+
<dd>
363+
Line boxes are sized, and content positioned within them,
364+
as defined in [[!CSS2]].
365+
366+
Note: In this model, vertical rhythm is broken
367+
any time there is a change in font metrics within a paragraph.
368+
369+
<dt><dfn>better-behavior</dfn>
370+
<dd>
371+
Line boxes are sized, and content positioned within them,
372+
as defined in [[!CSS2]],
373+
except that positive half-leading is not applied
374+
to any box other than the <a>root inline box</a>.
375+
376+
Note: This will give consistent line spacing
377+
as long as there is some amount of leading added,
378+
such that the half-leading on the root inline
379+
is large enough to accommodate the unleaded ascent of its descendants.
380+
The line box will grow to accommodate
381+
content that would otherwise overflow,
382+
avoiding overlap between lines.
383+
384+
<dt><dfn>box-model-behavior</dfn>
385+
<dd>
386+
Line boxes are sized to fit the <a>root inline box</a>
387+
and its <a>half-leading</a>,
388+
as well as the <a>outer edges</a> of any <a>inline-level descendants</a>
389+
in the same <a>inline formatting context</a>.
390+
Positive half-leading is not applied to any other <a>inline box</a>;
391+
negative half-leading is applied as negative margins
392+
to <a>inline boxes</a> whose block-axis margins, borders, and padding
393+
are zero.
394+
395+
Note: This mode is similar to ''better-behavior'',
396+
but re-uses the familiar margin/border/padding box model
397+
of controlling spacing.
398+
However to ensure that 'line-height' < 1 behaves as expected,
399+
the default case (no margin/border/padding)
400+
needs to apply negative leading to such inlines.
401+
402+
<dt><dfn>absolute-behavior</dfn>
403+
<dd>
404+
Line boxes are sized to fit the <a>root inline box</a>
405+
and its <a>half-leading</a>;
406+
no other boxes are considered.
407+
Inline-level content may overflow the line box
408+
and overlap adjacent lines
409+
if it extends higher or lower
410+
than the edges of the root inline box’s leading.
411+
</dl>
412+
413+
ISSUE: Should this property apply to block containers or to inline boxes?
414+
In the latter case, an individual inline could say "pay attention to me"
415+
or "don't pay attention to me".
416+
417+
ISSUE: Need better names. Maybe `loose | normal | strict | absolute`?
418+
Maybe `quirks | legacy | normal | absolute`?
419+
Something else?
420+
327421
<h2 id="inline-box-dimensions">
328422
Drawing Inline Boxes</h2>
329423

0 commit comments

Comments
 (0)