Skip to content

Commit 389f75f

Browse files
committed
[css-display] Initial work to use flow/flow-root. Needs some more cleanup.
1 parent 8591225 commit 389f75f

File tree

1 file changed

+65
-56
lines changed

1 file changed

+65
-56
lines changed

css-display/Overview.bs

Lines changed: 65 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Controlling Layout Modes: the 'display' property</h2>
7171

7272
<pre class="propdef">
7373
Name: display
74-
Value: [ <<display-inside>> || <<display-outside>> || list-item ] | <<display-internal>> | <<display-legacy>>
74+
Value: [ <<display-inside>> || <<display-outside>> || list-item ] <<display-box>> | <<display-internal>> | <<display-legacy>>
7575
Initial: inline
7676
Applies to: all elements
7777
Inherited: no
@@ -81,10 +81,16 @@ Controlling Layout Modes: the 'display' property</h2>
8181
</pre>
8282

8383
<pre class='prod'>
84-
<dfn>&lt;display-inside></dfn> = auto | block | table | flex | grid | ruby ;
85-
<dfn>&lt;display-outside></dfn> = block-level | inline-level | run-in | contents | none ;
86-
<dfn>&lt;display-internal></dfn> = table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption | ruby-base | ruby-text | ruby-base-container | ruby-text-container ;
87-
<dfn>&lt;display-legacy></dfn> = inline | inline-list-item | inline-table | inline-flex | inline-grid ;
84+
<dfn>&lt;display-inside></dfn> = flow | flow-root | table | flex | grid | ruby ;
85+
<dfn>&lt;display-outside></dfn> = block | inline | run-in;
86+
<dfn>&lt;display-box></dfn> = contents | none ;
87+
<dfn>&lt;display-internal></dfn> = table-row-group | table-header-group |
88+
table-footer-group | table-row | table-cell |
89+
table-column-group | table-column | table-caption |
90+
ruby-base | ruby-text | ruby-base-container |
91+
ruby-text-container ;
92+
<dfn>&lt;display-legacy></dfn> = inline-block | inline-list-item |
93+
inline-table | inline-flex | inline-grid ;
8894
</pre>
8995

9096
The 'display' property defines how an element generates boxes,
@@ -100,86 +106,91 @@ Controlling Layout Modes: the 'display' property</h2>
100106
Additional, it controls some other box-generation details,
101107
such as whether an element is a <a>list item</a> that generates a ''::marker'' pseudo-element.
102108

109+
<h3>
110+
The Major Layout Modes</h3>
111+
112+
The most common values of display correspond directly to the major layout algorithms in CSS.
113+
103114
The <<display-inside>> keywords are defined as follows:
104115

105116
<dl dfn-type="value" dfn-for="display, <display-inside>">
106-
<dt><dfn>auto</dfn>
117+
<dt><dfn>flow</dfn>
107118
<dd>
108-
If the element's computed <a>outer display type</a> value is ''inline-level'',
109-
the element is an inline element,
110-
and lays out its contents using inline layout. [[!CSS21]]
111-
Otherwise, this value computes to ''block''.
119+
The element lays out its contents using flow layout.
120+
(Also known as "block" or "inline" layout.) [[!CSS21]]
112121

113-
Issue: No need for ''auto'' anymore;
114-
just remove it, add a value specifically for ''display: inline'',
115-
and rewrite the other things that currently depend on it.
116-
117-
<dt><dfn>block</dfn>
122+
<dt><dfn>flow-root</dfn>
118123
<dd>
119-
The element lays out its contents using block layout. [[!CSS21]]
120-
121-
If <<display-outside>> is unspecified, it defaults to ''block-level''.
124+
The element lays out its contents using flow layout,
125+
and establishes a <a>block formatting context</a>. [[!CSS21]]
122126

123127
<dt><dfn>table</dfn>
124128
<dd>
125129
The element lays out its contents using table layout. [[!CSS21]]
126130

127-
If <<display-outside>> is unspecified, it defaults to ''block-level''.
128-
129131
<dt><dfn>flex</dfn>
130132
<dd>
131133
The element lays out its contents using flex layout. [[!CSS3-FLEXBOX]]
132134

133-
If <<display-outside>> is unspecified, it defaults to ''block-level''.
134-
135135
<dt><dfn>grid</dfn>
136136
<dd>
137137
The element lays out its contents using grid layout. [[!CSS3-GRID-LAYOUT]]
138138

139-
If <<display-outside>> is unspecified, it defaults to ''block-level''.
140-
141139
<dt><dfn>ruby</dfn>
142140
<dd>
143141
The element lays out its contents using ruby layout. [[!CSS3RUBY]]
144-
145-
If <<display-outside>> is unspecified, it defaults to ''inline-level''.
146142
</dl>
147143

148144
The <<display-outside>> keywords are defined as follows:
149145

150146
<dl dfn-type="value" dfn-for="display, <display-outside>">
151-
<dt><dfn>block-level</dfn>
147+
<dt><dfn>block</dfn>
152148
<dd>
153149
The element generates a <dfn dfn>block-level box</dfn>,
154150
and participates in a block formatting context.
155151
Other formatting contexts,
156152
such as flex formatting contexts,
157153
may also work with block-level elements. [[!CSS21]]
158154

159-
If <<display-inside>> is unspecified, it defaults to ''block''.
160-
161-
<dt><dfn>inline-level</dfn>
155+
<dt><dfn>inline</dfn>
162156
<dd>
163-
The element generates an <dfn dfn>inline-level box</dfn>,
164-
and participates in an inline formatting context. [[!CSS21]]
165-
166-
If <<display-inside>> is unspecified, it defaults to ''inline''.
157+
The element generates an <dfn dfn>inline-level box</dfn>. [[!CSS21]]
167158

168159
<dt><dfn>run-in</dfn>
169160
<dd>
170161
The element generates a <a>run-in box</a>.
171162
Run-in elements act like inlines or blocks,
172163
depending on the surrounding elements.
173164
See [[#run-in]] for details.
165+
</dl>
174166

167+
If a <<display-inside>> is specified but <<display-outside>> is omitted,
168+
<<display-outside>> defaults to ''block'',
169+
except that ''ruby'' defaults to ''inline''.
170+
171+
If a <<display-outside>> is specified but <<display-inside>> is omitted,
172+
<<display-inside>> defaults to ''flow''.
173+
174+
The <dfn value for=display>list-item</dfn> keyword
175+
makes the element a <a>list item</a>.
176+
If <<display-inside>> is unspecified,
177+
it defaults to ''flow''.
178+
If <<display-outside>> is unspecified,
179+
it defaults to ''block''.
180+
181+
<h3>
182+
Box Generation</h3>
183+
184+
185+
<dl dfn-type=value dfn-for="display, <display-box>">
175186
<dt><dfn>contents</dfn>
176187
<dd>
177188
The element itself does not generate any boxes,
178189
but its children and pseudo-elements still generate boxes as normal.
179190
For the purposes of box generation and layout,
180191
the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.
181192

182-
Issue: ''display-outside/contents'' currently only has an effect on box generation and layout.
193+
Issue: ''contents'' currently only has an effect on box generation and layout.
183194
Other things that care about the document tree are unaffected, like counter scopes.
184195
Is this what we want?
185196

@@ -196,15 +207,8 @@ Controlling Layout Modes: the 'display' property</h2>
196207
for when it's no longer suppressed.
197208
</dl>
198209

199-
Issue: ''run-in'', ''contents'', and ''none'' shouldn't be <<display-outside>>,
200-
they should just be lone values.
201-
They were only in the display-outside property because it was the most appropriate of the two,
202-
but none of them actually use the <<display-inside>> value.
203-
204-
The <dfn value for=display>list-item</dfn> keyword
205-
makes the element a <a>list item</a>.
206-
If <<display-inside>> is unspecified, ???.
207-
If <<display-outside>> is unspecified, ???.
210+
<h3>
211+
Layout-Specific Display Types</h3>
208212

209213
The <<display-internal>> keywords are defined as follows:
210214

@@ -214,7 +218,7 @@ Controlling Layout Modes: the 'display' property</h2>
214218
The element is an <dfn dfn>internal table element</dfn>,
215219
and participates in a table layout context. [[!CSS21]]
216220

217-
''display-outside/table-cell'' and ''display-outside/table-caption'' are <a>layout-specific leaf types</a>;
221+
''table-cell'' and ''table-caption'' are <a>layout-specific leaf types</a>;
218222
the rest are <a>layout-specific internal types</a>.
219223

220224
<dt><dfn>ruby-base</dfn>, <dfn>ruby-text</dfn>, <dfn>ruby-base-container</dfn>, <dfn>ruby-text-container</dfn>
@@ -249,28 +253,31 @@ Controlling Layout Modes: the 'display' property</h2>
249253
when placed in an incompatible parent,
250254
as defined by their respective specifications.
251255

256+
<h3>
257+
Legacy Display Values</h3>
258+
252259
The <<display-legacy>> keywords are defined as follows:
253260

254261
<dl dfn-type=value dfn-for="display, <display-legacy>">
255-
<dt><dfn>inline</dfn>
262+
<dt><dfn>inline-block</dfn>
256263
<dd>
257-
Behaves as ''inline-level auto''.
264+
Behavas as ''inline flow-root''.
258265

259266
<dt><dfn>inline-list-item</dfn>
260267
<dd>
261-
Behaves as ''inline-level auto list-item''.
268+
Behaves as ''inline list-item''.
262269

263270
<dt><dfn>inline-table</dfn>
264271
<dd>
265-
Behaves as ''inline-level table''.
272+
Behaves as ''inline table''.
266273

267274
<dt><dfn>inline-flex</dfn>
268275
<dd>
269-
Behaves as ''inline-level flex''.
276+
Behaves as ''inline flex''.
270277

271278
<dt><dfn>inline-grid</dfn>
272279
<dd>
273-
Behaves as ''inline-level grid''.
280+
Behaves as ''inline grid''.
274281
</dl>
275282

276283
<h3 id='transformations'>
@@ -279,7 +286,7 @@ Automatic Box Type Transformations</h3>
279286
Some layout effects require <dfn export lt="blockify|blockification">blockification</dfn>
280287
or <dfn export lt="inlinify|inlinification">inlinification</dfn> of the box type,
281288
causing the box’s <a>outer display type</a>, if it is not ''none'' or ''contents'',
282-
to compute to ''block-level'' or ''inline-level'' (respectively).
289+
to compute to ''block'' or ''inline'' (respectively).
283290

284291
<div class='example'>
285292
Some examples of this include:
@@ -298,7 +305,7 @@ Automatic Box Type Transformations</h3>
298305
break up the inline formatting context in which it participates.
299306

300307
The root element’s display type is always <a>blockified</a>.
301-
Additionally, a 'display' of ''contents'' computes to ''block-level'' on the root element.
308+
Additionally, a 'display' of ''contents'' computes to ''block'' on the root element.
302309

303310

304311
<h2 id='box-suppress'>
@@ -419,7 +426,7 @@ Run-In Layout</h2>
419426
(up to, but not including, the next <a>run-in sequence</a>, if any).
420427

421428
<li>
422-
A <a>run-in box</a> with ''display: auto'' <a>inlinifies</a> its contents.
429+
A <a>run-in box</a> with ''display: flow'' <a>inlinifies</a> its contents.
423430
</ul>
424431

425432
A <dfn>run-in sequence</dfn> is a maximal sequence of consecutive sibling <a>run-in boxes</a>
@@ -504,13 +511,13 @@ Appendix B: Glossary</h2>
504511

505512
<dt><dfn lt="inline|inline box">inline</dfn>
506513
<dd>
507-
A non-replaced <a>inline-level</a> box whose 'display' is ''auto''.
514+
A non-replaced <a>inline-level</a> box whose 'display' is ''flow''.
508515
The contents of an inline box participate in the same inline formatting context as the inline box itself.
509516

510517
<dt><dfn lt="atomic inline|atomic inline box">atomic inline</dfn>
511518
<dd>
512519
An inline-level box that is replaced or that establishes a new formatting context.
513-
(An inline-level box whose 'display' is not ''auto'' establishes a new formatting context of the specified type.)
520+
(An inline-level box whose 'display' is not ''flow'' establishes a new formatting context of the specified type.)
514521

515522
<dt><dfn lt="block container|block container box">block container</dfn>
516523
<dd>
@@ -552,6 +559,8 @@ Appendix B: Glossary</h2>
552559

553560
Issue: wordsmith this.
554561

562+
<dt><dfn>block formatting context</dfn>
563+
<dd>
555564
Block and inline formatting contexts are defined in CSS 2.1 Section 9.4.
556565
</dl>
557566

0 commit comments

Comments
 (0)