Skip to content

Commit 8e8d8c6

Browse files
committed
[css-inline-3] Align 'line-sizing' property to latest WG discussions. #3199
1 parent 1880f77 commit 8e8d8c6

File tree

1 file changed

+37
-59
lines changed

1 file changed

+37
-59
lines changed

css-inline-3/Overview.bs

Lines changed: 37 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -329,95 +329,62 @@ Line Sizing Containment: the 'line-sizing' property
329329

330330
331331
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?
332+
Value: legacy | normal
333+
Initial: legacy
334+
Applies to: inline boxes
335335
Inherited: yes
336336
Percentages: N/A
337337
Computed value: the specified keyword
338338
339339

340340
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.
343341
See discussion in Issue 3199, Hyatt's message, and dbaron's proposal.
344-
Also all the keywords are expected to be renamed.
345342

346343
This property controls the method by which line boxes are sized,
347344
and thus the spacing between lines of text.
348345

349346
Values have the following meanings:
350347

351348
352-
quirks-behavior
349+
legacy
353350
354-
Line boxes are sized, and content positioned within them,
355-
as defined in [[!CSS2]] except that
351+
The inline box contributes to the sizing of its line box
352+
based on its 'line-height',
353+
rather than based on its box edges,
354+
as defined in [[!CSS2]].
355+
In Quirks Mode [[!QUIRKS]],
356356
357357
that has zero borders and padding and
358358
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]].
359+
is ignored when sizing the line box.
365360

366361
Note: In this model, vertical rhythm is broken
367362
any time there is a change in font metrics within a paragraph.
368363

369-
better-behavior
364+
normal
370365
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.
366+
The inline box contributes to the sizing of its line box
367+
based on its margin box,
368+
rather than its 'line-height'.
369+
Half-leading is inserted inside the content box edges,
370+
rather than overlapping the padding/border/margin areas.
371+
However, positive half-leading is only applied to the root inline box.
372+
Negative half-leading is applied to all inline boxes,-
373+
reducing the size of the content box as needed.
375374

376375
Note: This will give consistent line spacing
377376
as long as there is some amount of leading added,
378377
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
378+
is large enough to accommodate the unleaded ascent/descent of its descendants.
379+
The line box will grow, however, to accommodate
381380
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.
381+
to avoid overlap between lines.
411382
412383

413384
ISSUE: Should this property apply to block containers or to inline boxes?
414385
In the latter case, an individual inline could say "pay attention to me"
415386
or "don't pay attention to me".
416387

417-
ISSUE: Need better names. Maybe `loose | normal | strict | absolute`?
418-
Maybe `quirks | legacy | normal | absolute`?
419-
Something else?
420-
421388

422389
Drawing Inline Boxes
423390

@@ -451,10 +418,11 @@ Inline Box Heights: the 'inline-sizing' property
451418

452419
stretch
453420
454-
421+
Once the line box has been sized,
422+
the final logical height of the inline box’s content area
455423
is calculated as the stretch fit
456-
into the line box.
457-
The box is then positioned such that its margin edges
424+
into the line box,
425+
and it is positioned such that its margin edges
458426
coincide with the line box’s edges.
459427
460428

@@ -1841,13 +1809,23 @@ A.2: Synthesizing Baselines for Replaced Content
18411809

18421810
Changes
18431811

1812+
Changes since the
1813+
1814+
include:
1815+
1816+
    1817+
  • 1818+
    Added 'line-sizing' property to control how inter-line spacing is calculated.
    1819+
    1820+
    1821+
    18441822
    Changes since the
    18451823
    18461824
    include:
    18471825

    18481826
      18491827
    • 1850-
      Added outline of property to control the logical height of inline boxes.
      1828+
      Sketched out property to control the logical height of inline boxes.
      18511829
      18521830
    • 18531831
      Better defined handling of initial letters

      0 commit comments

      Comments
       (0)