@@ -105,7 +105,12 @@ <h2 class="no-toc no-num">Status of this document</h2>
105105implementations. See the section < a href ="#exit "> “CR exit criteria”
106106</ a > for details.
107107
108- < p class =mtb > This module should eventually replace corresponding parts
108+ < p class =mtb > The terminology and the order of the sections is
109+ currently in flux. This working draft is published to show the
110+ features that are being discussed in the context of this module, but
111+ it is likely that some of the names of the features will change.
112+
113+ < p > This module should eventually replace corresponding parts
109114of the revised CSS level 2 specification [[!CSS21]]. But this is an
110115early draft and any differences to level 2 are most likely
111116unintentional, unless they concern new features, such as vertical text
@@ -228,6 +233,7 @@ <h2>Introduction & definitions</h2>
228233< p > [Define the box tree before pagination and then describe how
229234pagination can break one box into two?]
230235
236+ <!--
231237<ul>
232238<li>If the parent element is a list item, the boxes go into the
233239parent's block box, not the marker box.
@@ -244,6 +250,7 @@ <h2>Introduction & definitions</h2>
244250
245251<li>Note that 'flow' puts boxes into a named flow root.
246252</ul>
253+ -->
247254</ div >
248255
249256< p > When the specification says a box < var > A</ var > < dfn > contains</ dfn >
@@ -264,7 +271,8 @@ <h2>Introduction & definitions</h2>
264271inline).
265272
266273< div class =figure >
267- < p > < img src ="box-intro.png " alt ="Schematic representation of rel ">
274+ < p > < img src ="box-intro.png " alt ="Each generated box in the rendering
275+ has a link to the element that generated it. ">
268276
269277 < p class ="caption "> Relation between four displayed boxes in the
270278 rendered document (on the right) and the three corresponding
@@ -325,12 +333,12 @@ <h2>Introduction & definitions</h2>
325333anonymous boxes: inheritable properties on anonymous boxes have the
326334same value as the element, while non-inheritable properties have the
327335initial value. The only property that boxes do not have is the
328- 'display' property. < span class =issue > [Actually, boxes are just
329- rectangles with a border, a background, a position, a bunch of other
330- boxes inside, and a reference to the element they belong to. They
331- don't really have properties. But it is convenient to say the “the box
332- has a font < var > X </ var > ” rather than the verbose “the element that
333- generated the box has a font < var > X</ var > . ”</ span >
336+ 'display' property. < span class =issue > [Is this useful? Or is it better
337+ to say that boxes are just rectangles with a border, a background, a
338+ position, a bunch of other boxes inside, and a reference to the
339+ element they belong to? They don't really have properties then and it
340+ is only a convenience to say the “the box has a font
341+ < var > X. </ var > ”</ span >
334342
335343< p > Boxes do not have specified values [[!CSS3CASCADE]], but they do
336344have computed, used and actual values.
@@ -445,6 +453,11 @@ <h2>Introduction & definitions</h2>
445453for the edges of the children of a box and two terms (block dimension
446454and inline dimension) for the width and height of a box.
447455
456+ < p class =issue > The names head and foot are under discussion. There is
457+ an issue in [[!CSS3-WRITING-MODES]] that suggests some possible names:
458+ “head,” “before,” “before-block,” “foot,” “tail,” “after” and
459+ “after-block.”
460+
448461< p > The < dfn > head,</ dfn > < dfn > foot,</ dfn > < dfn > start</ dfn > and
449462< dfn > end</ dfn > edge of a box refer to the top, right, bottom and left
450463edges, depending on the 'writing-mode' and 'direction' properties of
@@ -587,7 +600,7 @@ <h2>The viewport and the canvas</h2>
587600
588601
589602
590- < h2 > Flows</ h2 >
603+ < h2 id = flows > Flows</ h2 >
591604
592605< p > The < dfn > flow</ dfn > (sometimes called < dfn > normal flow</ dfn > ) is
593606one of the two basic kinds of layout in CSS, together with line layout
@@ -604,6 +617,8 @@ <h2>Flows</h2>
604617href ="#construct-flow "> rules below.</ a > We say the flow is
605618< dfn > channeled</ dfn > by the flow root.
606619
620+ < p class =issue > Are there more intuitive names than flow root?
621+
607622< p > The < dfn title ="initial flow|flow!!initial " > initial flow</ dfn > is
608623the flow that contains the root of the box tree.
609624
@@ -849,6 +864,7 @@ <h2>Flows</h2>
849864-->
850865
851866
867+
852868< h2 > Types of boxes</ h2 >
853869
854870< p > The layout of boxes in the flow is in large part determined by the
@@ -959,60 +975,6 @@ <h3 id=display>The display property</h3>
959975an element to generate boxes that affect formatting but are not
960976visible themselves.
961977
962- < p class =note > Note that both 'clear-after' and ''container'' can be
963- used to force the next element after this one to start after any
964- floats inside this element, but the effect is not exactly the same.
965- E.g., 'display: container' also affects certain forms of margin
966- collapsing.
967-
968- < p class =note > Note that 'vertical-align' applies to ''container''
969- elements. The 'vertical-align' property doesn't apply
970- to other block-level elements, except ''table-cell'' elements.
971-
972- < p class =issue > Any sense in vertically spreading out the contents,
973- something like 'vertical-align: justify'?
974-
975- < p class =issue > Simpler to not use 'vertical-align', but creating
976- ''top-box'', ''middle-box'' and ''bottom-box''?
977-
978- < div class =example >
979- < p > The 'vertical-align' property applies to ''container''
980- elements < span class =issue > [check in [[!CSS3TEXT]]!]</ span > , and can
981- thus be used to create vertically centered content, without wrapping
982- the content in a table (which may not be always possible, and also
983- causes the 'width' property to behave differently).
984-
985- < pre >
986- div.slide {
987- display: container;
988- height: 15em;
989- vertical-align: middle;
990- border: thin solid }
991- </ pre >
992-
993- < p > with a document fragment like this:
994-
995- < pre >
996- <div class=slide>
997- <ul>
998- <li> Bullet lists are boring
999- <li> They distract from the speaker
1000- <li> Don't use them!
1001- </ul>
1002- </div>
1003- </ pre >
1004-
1005- < p > might look like this figure:
1006-
1007- < div class =figure >
1008- < p > < img src ="align-box.png " alt ="A 15 em high box with three bullet
1009- items in the center ">
1010-
1011- < p class =caption > The 'vertical-align: middle' causes the content of
1012- the ''container'' to be vertically centered.
1013- </ div >
1014- </ div >
1015-
1016978< p > The computed value of 'display' depends on 'position' [[CSS3POS]],
1017979'float' and 'overflow':
1018980
@@ -1045,34 +1007,13 @@ <h3 id=display>The display property</h3>
10451007
10461008
10471009
1048- < h3 > Mixing the box model with other formatting models</ h3 >
1049-
1050- < p > There may be documents that combine different layout models, such
1051- as documents that combine HTML (typically rendered with the CSS box
1052- model) and < span class =index > SVG</ span > (rendered with its own
1053- graphics model). If an element that is rendered according to the CSS
1054- box model has a child that is to be rendered with a different model,
1055- that child needs to have a 'display' property with a value that
1056- indicates that the child is not in the box model.
1057-
1058- < p > Such a child is treated as a < em > replaced element</ em > for the
1059- purposes of determining its size, position, margins, padding and
1060- border.
1061-
1062- < p class =issue > Should we allow a more complex model, where such a
1063- child may negotiate with the CSS environment to have several boxes and
1064- several baselines, so that it can take part in line breaking and page
1065- breaking?
1066-
1067- < p > This specification defines no value(s) for the 'display' property
1068- that indicate that an element is formatted according to a different
1069- model than the box model, but separate specifications may do so.
1070-
1071-
1072-
10731010< h3 > Block-level boxes, containing blocks, flows and anonymous
10741011boxes</ h3 >
10751012
1013+ < p class =issue > Split this section. Put the definition of containing
1014+ block in its own section and move it to right after the < a
1015+ href ="#flows " > Flows</ a > section above.
1016+
10761017< p > A < dfn > block-level</ dfn > box is a box that has a < span > computed
10771018value</ span > for 'display' of ''block'', ''container'', ''list-item'',
10781019''table'', ''table-*'' (i.e., all table boxes, see [[CSS3TBL]]),
@@ -1159,6 +1100,11 @@ <h3>Block-level boxes, containing blocks, flows and anonymous
11591100 </ ol >
11601101</ ul >
11611102
1103+
1104+ < p class =issue > Other modules may introduce other types of boxes with
1105+ other rules for how to find their containing block. E.g., the
1106+ containing block of an absolutely positioned element.
1107+
11621108< p > In the above, a < dfn > block container box</ dfn > is, informally, a
11631109box that can contain block boxes. More precisely: any box generated by
11641110a (pseudo-)element with a computed value for 'display' of ''block'',
@@ -1441,6 +1387,91 @@ <h3 id=compact-boxes>Compact boxes</h3>
14411387</ div >
14421388
14431389
1390+ < h3 > Container box < span class =issue > or: Align-box</ span > </ h3 >
1391+
1392+ < p class =issue > [C.f. the discussion of how to force an element to
1393+ contain floats.]
1394+
1395+ < p class =note > Note that both 'clear-after' and ''container'' can be
1396+ used to force the next element after this one to start after any
1397+ floats inside this element, but the effect is not exactly the same.
1398+ E.g., 'display: container' also affects certain forms of margin
1399+ collapsing.
1400+
1401+ < p class =note > Note that 'vertical-align' applies to ''container''
1402+ elements. The 'vertical-align' property doesn't apply
1403+ to other block-level elements, except ''table-cell'' elements.
1404+
1405+ < p class =issue > Any sense in vertically spreading out the contents,
1406+ something like 'vertical-align: justify'?
1407+
1408+ < p class =issue > Simpler to not use 'vertical-align', but creating
1409+ ''top-box'', ''middle-box'' and ''bottom-box''?
1410+
1411+ < div class =example >
1412+ < p > The 'vertical-align' property applies to ''container''
1413+ elements < span class =issue > [check in [[!CSS3TEXT]]!]</ span > , and can
1414+ thus be used to create vertically centered content, without wrapping
1415+ the content in a table (which may not be always possible, and also
1416+ causes the 'width' property to behave differently).
1417+
1418+ < pre >
1419+ div.slide {
1420+ display: container;
1421+ height: 15em;
1422+ vertical-align: middle;
1423+ border: thin solid }
1424+ </ pre >
1425+
1426+ < p > with a document fragment like this:
1427+
1428+ < pre >
1429+ <div class=slide>
1430+ <ul>
1431+ <li> Bullet lists are boring
1432+ <li> They distract from the speaker
1433+ <li> Don't use them!
1434+ </ul>
1435+ </div>
1436+ </ pre >
1437+
1438+ < p > might look like this figure:
1439+
1440+ < div class =figure >
1441+ < p > < img src ="align-box.png " alt ="A 15 em high box with three bullet
1442+ items in the center ">
1443+
1444+ < p class =caption > The 'vertical-align: middle' causes the content of
1445+ the ''container'' to be vertically centered.
1446+ </ div >
1447+ </ div >
1448+
1449+
1450+ < h3 > Mixing the box model with other formatting models</ h3 >
1451+
1452+ < p > There may be documents that combine different layout models, such
1453+ as documents that combine HTML (typically rendered with the CSS box
1454+ model) and < span class =index > SVG</ span > (rendered with its own
1455+ graphics model). If an element that is rendered according to the CSS
1456+ box model has a child that is to be rendered with a different model,
1457+ that child needs to have a 'display' property with a value that
1458+ indicates that the child is not in the box model.
1459+
1460+ < p > Such a child is treated as a < em > replaced element</ em > for the
1461+ purposes of determining its size, position, margins, padding and
1462+ border.
1463+
1464+ < p class =issue > Should we allow a more complex model, where such a
1465+ child may negotiate with the CSS environment to have several boxes and
1466+ several baselines, so that it can take part in line breaking and page
1467+ breaking?
1468+
1469+ < p > This specification defines no value(s) for the 'display' property
1470+ that indicate that an element is formatted according to a different
1471+ model than the box model, but separate specifications may do so.
1472+
1473+
1474+
14441475
14451476< h2 > The padding properties</ h2 >
14461477
@@ -1525,7 +1556,7 @@ <h2>The padding properties</h2>
15251556
15261557
15271558
1528- < h2 > The margin properties</ h3 >
1559+ < h2 > The margin properties</ h2 >
15291560
15301561< p > Margins in CSS serve to add both horizontal and vertical space
15311562between boxes.
@@ -2013,6 +2044,8 @@ <h2 id=intrinsic>Definition of min-content/max-content</h2>
20132044< p class =note > OVERFLOW is not necessarily monotonic in < var > w</ var >
20142045and a binary search for min-content and max-content may thus fail.
20152046
2047+ < p class =issue > Say something about acceptable near-optimal results?
2048+
20162049< p class =note > Note that the ''min-content'' width of a block may be
20172050larger than the ''min-content'' of all its children, because it may be
20182051impossible to break a line between two children.
@@ -2449,6 +2482,12 @@ <h3 id=collapsing-margins>Collapsing margins</h3>
24492482
24502483
24512484
2485+ < h2 > Inline-level formatting</ h2 >
2486+
2487+ < p > In an inline formatting context, inline-level boxes are laid out in
2488+ the manner of a run of words and sentences. Inline-level formatting,
2489+ and the behavior of inline-level boxes, is specified in the text
2490+ specification [[!CSS3TEXT]].
24522491
24532492
24542493
0 commit comments