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
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' propertyh4>
301+
<h3 id="line-height-property">
302+
Line Spacing: the 'line-height' propertyh3>
303303

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

327+

328+
Line Sizing Containment: the 'line-sizing' property
329+
330+
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+
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 Issue 3199, Hyatt's message, and dbaron's proposal.
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+
352+
quirks-behavior
353+
354+
Line boxes are sized, and content positioned within them,
355+
as defined in [[!CSS2]] except that
356+
357+
that has zero borders and padding and
358+
that does not directly contain text or preserved white space [[!CSS-TEXT-3]]
359+
is ignored for this purpose.
360+
361+
current-behavior
362+
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+
better-behavior
370+
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 root inline box.
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+
box-model-behavior
385+
386+
Line boxes are sized to fit the root inline box
387+
and its half-leading,
388+
as well as the outer edges of any inline-level descendants
389+
390+
Positive half-leading is not applied to any other inline box;
391+
negative half-leading is applied as negative margins
392+
to inline boxes 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+
absolute-behavior
403+
404+
Line boxes are sized to fit the root inline box
405+
and its half-leading;
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+
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

328422
Drawing Inline Boxes
329423

0 commit comments

Comments
 (0)