Skip to content

Commit 67e47ef

Browse files
committed
[css-display] Rip apart Appendix A and turn it into the Introduction.
1 parent 37a095d commit 67e47ef

1 file changed

Lines changed: 66 additions & 78 deletions

File tree

css-display/Overview.bs

Lines changed: 66 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<h1>CSS Display Module Level 3</h1>
22

33
<pre class='metadata'>
4-
Status: WD
5-
Work Status: Exploring
4+
Status: ED
5+
Work Status: Revising
66
Date: 2014-09-11
77
ED: http://dev.w3.org/csswg/css-display/
88
Shortname: css-display
@@ -19,32 +19,71 @@ Ignored Terms: display-model, display-role, table row group box
1919
<h2 id="intro">
2020
Introduction</h2>
2121

22-
<p><em>This section is not normative.</em>
22+
<p><em>This section is normative.</em>
23+
24+
CSS takes a source document, organized as a tree of <dfn lt="element|element tree">elements</dfn>,
25+
and renders it onto a <a href="http://www.w3.org/TR/CSS21/intro.html#canvas">canvas</a> (such as your screen, a piece of paper, or an audio stream).
26+
To do this, it generates an intermediary structure,
27+
the <dfn>box tree</dfn>,
28+
which represents the formatting structure of the rendered document.
29+
Each <dfn>box</dfn> represents its corresponding <a>element</a> (or <a>pseudo-element</a>)
30+
in space and/or time on the canvas.
31+
32+
To create the <a>box tree</a>,
33+
CSS first uses <a href="http://www.w3.org/TR/css-cascade/">cascading and inheritance</a>,
34+
to assign a value for each CSS property
35+
to each element in the source tree.
36+
(See [[!CSS3-CASCADE]].)
37+
38+
Then, for each element, it generates zero or more boxes
39+
as specified by that element's 'display' and 'box-suppress' properties.
40+
Typically, an element generates a single <a>box</a>.
41+
However, some 'display' values
42+
(e.g. ''display: list-item'')
43+
generate more than one box
44+
(e.g. a <a href="http://www.w3.org/TR/CSS21/visuren.html#principal-box">principal block box</a> and a <a href="http://www.w3.org/TR/CSS21/generate.html#lists">marker box</a>).
45+
And some values
46+
(such as ''display:none'', ''display: contents'', and ''box-suppress: discard'')
47+
cause the <a>element</a> and/or its descendants to not generate any <a>boxes</a> at all.
48+
<a>Boxes</a> are assigned the same styles as their generating <a>element</a>, unless otherwise indicated.
49+
They're often referred to by their 'display' type--
50+
e.g. a <a>box</a> generated by an element with ''display: block'' is called a “block box” or just a “block”.
51+
52+
An <dfn lt="anonymous|anonymous box">anonymous box</dfn> is is a box that is not associated with any element.
53+
<a>Anonymous boxes</a> are generated in certain circumstances
54+
to fix up the <a>box tree</a> when it requires a particular nested structure
55+
that is not provided by the boxes generated from the <a>element tree</a>.
56+
For example, a <a href="http://www.w3.org/TR/CSS21/tables.html#table-display">table cell box</a>
57+
requires a particular type of parent box (the <a href="http://www.w3.org/TR/CSS21/tables.html#table-display">table row box</a>),
58+
and will generate an <a>anonymous</a> <a href="http://www.w3.org/TR/CSS21/tables.html#table-display">table row box</a> around itself
59+
if its parent is not a <a href="http://www.w3.org/TR/CSS21/tables.html#table-display">table row box</a>.
60+
(See [[CSS21]] &sect; <a href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes">17.2.1</a>.)
61+
Unlike element-generated boxes, whose styles inherit strictly through the element tree,
62+
anonymous boxes (which only exist in the <a>box tree</a>)
63+
<a href="http://www.w3.org/TR/css-cascade/#inheriting">inherit</a> through their <a>box tree</a> parentage.
64+
65+
In the course of layout,
66+
a <a>box</a> may be broken into multiple <a>fragments</a>.
67+
This happens, for example, when an inline box is broken across lines,
68+
or when a block box is broken across pages or columns.
69+
A <a>box</a> therefore consists of one or more <a>box fragments</a>.
70+
See [[CSS3-BREAK]] for more information on <a>fragmentation</a>.
2371

24-
The 'display' property, introduced in CSS 2.1,
25-
defines what kind of boxes an element generates
26-
(and whether it generates boxes at all),
27-
and how it lays out its contents.
28-
29-
These concepts are actually rather independent,
30-
though they're conflated by the 'display' property.
31-
This causes some pain when a property value intended to affect one aspect
32-
(such as setting an element to ''display:none'' to suppress box generation)
33-
affects another aspect
34-
(such as losing the memory of what it was <em>before</em> ''display:none'',
35-
so that it can be set back to that value later).
36-
37-
This specification subsumes the CSS 2.1 definition of the 'display' property,
38-
and redefines it to be a shorthand property for a small family of longhands,
39-
each controlling an independent aspect of an element's "display".
72+
Note: Many of the CSS specs were written before this terminology was ironed out,
73+
or refer to things incorrectly,
74+
so view older specs with caution when they're using these terms.
75+
It should be possible to infer from context which term they really mean.
76+
Please <a href="#status">report errors</a> in specs when you find them,
77+
so they can be corrected.
4078

79+
Note: Further information on the “aural” box tree
80+
and its interaction with the 'display' property
81+
can be found in the <a href="http://www.w3.org/TR/css3-speech/#aural-model">CSS Speech Module</a>.
82+
[[!CSS3-SPEECH]]
4183

4284
<h3 id="placement">
4385
Module interactions</h3>
4486

45-
This specification transforms the 'display' property into a shorthand property,
46-
and defines several longhand properties that it expands into or effects.
47-
4887
This module replaces and extends the definition of the 'display' property defined in [[!CSS21]] section 9.2.4.
4988

5089
None of the properties in this module apply to the <code>::first-line</code> or <code>::first-letter</code> pseudo-elements.
@@ -81,6 +120,11 @@ Controlling Layout Modes: the 'display' property</h2>
81120
Media: all
82121
</pre>
83122

123+
The 'display' property, introduced in CSS 2.1,
124+
defines what kind of boxes an element generates
125+
(and whether it generates boxes at all),
126+
and how it lays out its contents.
127+
84128
<pre class='prod'>
85129
<dfn>&lt;display-inside></dfn> = flow | flow-root | table | flex | grid | ruby ;
86130
<dfn>&lt;display-outside></dfn> = block | inline | run-in ;
@@ -495,62 +539,6 @@ Run-In Layout</h2>
495539

496540
Note: This run-in model is slightly different from the one proposed in earlier revisions of [[!CSS21]].
497541

498-
<h2 id='element-box-fragment'>
499-
Appendix A: Elements, Boxes, and Fragments</h2>
500-
501-
CSS operates on several different types of objects,
502-
depending on the stage of processing and what is being done:
503-
the <a>element</a>, the <a>box</a>, and the <a>fragment</a>.
504-
505-
Note: Many of the CSS specs were written before this terminology was ironed out,
506-
or refer to things incorrectly,
507-
so view older specs with caution when they're using these terms.
508-
It should be possible to infer from context which term they really mean.
509-
Please report errors in specs when you find them,
510-
so they can be corrected.
511-
512-
An <dfn>element</dfn> is an object in the DOM tree returned by the host element.
513-
The purpose of an <a>element</a> is to receive styling,
514-
so the multiple declarations from the document's style sheets
515-
are converted into values for each property on each element.
516-
(The DOM tree also contains text,
517-
which is identical to <a>elements</a>
518-
except that it can't be styled directly,
519-
only through inheritance.)
520-
521-
<a>Elements</a> generate <a>boxes</a>.
522-
Typically, an <a>element</a> generates a single <a>box</a>.
523-
Some properties (such as ''display:none'') cause an <a>element</a> and/or its descendants to not generate any <a>boxes</a> at all.
524-
Some properties (such as ''columns: 2'') cause an <a>element</a> to generate multiple <a>boxes</a>s.
525-
Some combinations of properties (such as an element with ''display:table-cell'' and a parent element with anything but ''display:table-row'')
526-
trigger the creation of <a>anonymous boxes</a> to keep the <a>box tree</a> reasonable.
527-
528-
A <dfn>box</dfn> is an object generated from an <a>element</a> according to the 'display' property
529-
and other layout-affecting properties,
530-
organized into a <dfn>box tree</dfn>.
531-
The purpose of a <a>box</a> is to organize the document into a structure that is suitable for layout.
532-
<a>Boxes</a> have the same styles as their generating <a>element</a>, unless otherwise indicated.
533-
They're referred by their type, typically determined by the 'display' value--
534-
a <a>box</a> generated by an element with ''display: block'' is called a “block box” or just a “block”.
535-
536-
An <dfn>anonymous box</dfn> is generated in certain circumstances
537-
where a type of <a>box</a> (such as a table cell box)
538-
requires a particular type of parent box (such as a table row box)
539-
but the document structure is not written to produce that--
540-
<a>anonymous boxes</a> are then generated between the parent and child to provide the required structures.
541-
Anonymous boxes are styled as if they inherited from their nearest non-anonymous parent <a>box</a>,
542-
unless otherwise specified.
543-
544-
The process of layout generates <a>fragments</a> from <a>boxes</a>.
545-
546-
A <dfn>fragment</dfn> is an object representing the result of layout,
547-
organized into a <dfn>fragment tree</dfn>.
548-
<a>Fragments</a> have a size and position,
549-
and the same styles as their generating <a>boxes</a>
550-
unless otherwise specified.
551-
552-
553-
554542
<h2 id='glossary'>
555543
Appendix B: Glossary</h2>
556544

0 commit comments

Comments
 (0)