Skip to content

Commit c588376

Browse files
committed
[css-display] Edit in Seattle F2F resolutions:
* Remove issue about root being out-of-flow; file against CSS2.1 to make it in-flow * Make table-caption and table-cell use flow-root for their inner display type * Drop box-suppress/display-or-not property * Make replaced elements and form controls with 'display: contents' behave as 'display: inline' * Remove issue about 'display: contents' and counters; to be filed against Lists * Clarify that ::before and ::after still exist for a 'display: contents' element * Clarify that p::first-letter selects the first letter of the first run-in inside the <p> (if any) * Clarify that events are not affected by 'display: contents' * Mark two-keyword display values at-risk
1 parent df4dd80 commit c588376

File tree

1 file changed

+55
-30
lines changed

1 file changed

+55
-30
lines changed

css-display/Overview.bs

+55-30
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ Previous Version: https://www.w3.org/TR/2015/WD-css-display-3-20150721/
1313
Previous Version: https://www.w3.org/TR/2014/WD-css-display-3-20140911/
1414
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/
1515
Editor: Elika J. Etemad / fantasai, Invited Expert, http://fantasai.inkedblade.net/contact
16-
Abstract: This module describes how the CSS formatting box tree is generated from the document element tree and defines the 'display' and 'display-or-not' properties that control it.
16+
Abstract: This module describes how the CSS formatting box tree is generated from the document element tree and defines the 'display' property that controls it.
1717
Ignored Terms: display-model, display-role, table row group box, absolutely positioned
18+
At Risk: Application of ''::first-letter'' in the presence of run-ins
19+
At Risk: ''display: run-in''
20+
At Risk: All two-keyword values of 'display' and ''display: inline-list-item''
1821
</pre>
1922
<pre class="link-defaults">
2023
spec:css-break-3; type:dfn; text:fragment;
@@ -40,14 +43,14 @@ Introduction</h2>
4043
(See [[!CSS3-CASCADE]].)
4144

4245
Then, for each element, it generates zero or more boxes
43-
as specified by that element's 'display' and 'display-or-not' properties.
46+
as specified by that element's 'display' property.
4447
Typically, an element generates a single <a>box</a>.
4548
However, some 'display' values
4649
(e.g. ''display: list-item'')
4750
generate more than one box
4851
(e.g. a <a href="https://www.w3.org/TR/CSS2/visuren.html#principal-box">principal block box</a> and a <a href="https://www.w3.org/TR/CSS2/generate.html#lists">marker box</a>).
4952
And some values
50-
(such as ''display:none'', ''display: contents'', and ''display-or-not: discard'')
53+
(such as ''display/none'' or ''display/contents'')
5154
cause the <a>element</a> and/or its descendants to not generate any <a>boxes</a> at all.
5255
<a>Boxes</a> are assigned the same styles as their generating <a>element</a>, unless otherwise indicated.
5356
They're often referred to by their 'display' type--
@@ -130,7 +133,7 @@ Box Layout Modes: the 'display' property</h2>
130133

131134
Some 'display' values have additional side-effects:
132135
such as ''list-item'', which also generates a ''::marker'' pseudo-element,
133-
and ''none'', which causes the element's entire subtree to be left out of the box tree.
136+
and ''display/none'', which causes the element's entire subtree to be left out of the box tree.
134137

135138
Values are defined as follows:
136139

@@ -162,11 +165,11 @@ Box Layout Modes: the 'display' property</h2>
162165
<th>Generated box
163166
<tbody title="Box Suppression Display Types">
164167
<tr>
165-
<td>''none''
168+
<td>''display/none''
166169
<td>&#x3003;
167170
<td>subtree omitted from <a>box tree</a>
168171
<tr>
169-
<td>''contents''
172+
<td>''display/contents''
170173
<td>&#x3003;
171174
<td>element replaced by contents in <a>box tree</a>
172175
<tbody title="Flow Layout Display Types">
@@ -238,11 +241,11 @@ Box Layout Modes: the 'display' property</h2>
238241
<tbody title="Layout-internal display types">
239242
<tr>
240243
<td>''table-cell''
241-
<td>''table-cell flow''
244+
<td>''table-cell flow-root''
242245
<td>table cell <a>block container</a>
243246
<tr>
244247
<td>''table-caption''
245-
<td>''table-caption flow''
248+
<td>''table-caption flow-root''
246249
<td>table cell <a>block container</a>
247250
<tr>
248251
<td>''ruby-base''
@@ -393,7 +396,7 @@ Layout-Internal Display Types: the ''table-*'' and ''ruby-*'' keywords</h3>
393396
The element is an <dfn dfn>internal table element</dfn>,
394397
and participates in a table layout context. [[!CSS2]]
395398

396-
''table-cell'' and ''table-caption'' have a ''flow'' <a>inner display type</a>.
399+
''table-cell'' and ''table-caption'' have a ''flow-root'' <a>inner display type</a>.
397400

398401
<dt><dfn>ruby-base</dfn>, <dfn>ruby-text</dfn>, <dfn>ruby-base-container</dfn>, <dfn>ruby-text-container</dfn>
399402
<dd>
@@ -456,7 +459,7 @@ Layout-Internal Display Types: the ''table-*'' and ''ruby-*'' keywords</h3>
456459
</div>
457460

458461
<h3 id="box-generation">
459-
Box Generation: the ''none'' and ''contents'' keywords</h3>
462+
Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
460463

461464
While 'display' can control the <em>types</em> of boxes an element will generate,
462465
it can also control whether an element will generate any boxes at all.
@@ -470,18 +473,21 @@ Box Generation: the ''none'' and ''contents'' keywords</h3>
470473
but its children and pseudo-elements still generate boxes as normal.
471474
For the purposes of box generation and layout,
472475
the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.
476+
However, its ''::before'' and ''::after'' pseudo-elements still exist,
477+
and are parented by the element's parent's principal box along with the rest of the element's box-generating contents.
473478

474-
Issue: ''contents'' currently only has an effect on box generation and layout.
475-
Other things that care about the document tree are unaffected, like counter scopes.
476-
Is this what we want?
479+
Note: As only the box tree is affected,
480+
any semantics based on the document tree,
481+
such as selector-matching and event handling,
482+
are not affected.
483+
484+
This value has no effect on replaced elements and form controls;
485+
it computes to ''inline'' exactly as if the UA style sheet had specified
486+
''display: inline !important'' on such elements.
477487

478488
<dt><dfn>none</dfn>
479489
<dd>
480490
The element and its descendants generates no boxes.
481-
482-
Advisement: It is recommended that 'display-or-not' be used instead of ''display: none'',
483-
so that the element's display type is automatically preserved
484-
for when it's no longer suppressed.
485491
</dl>
486492

487493
Elements with either of these values do not have <a>inner</a> or <a>outer display types</a>,
@@ -528,7 +534,8 @@ Automatic Box Type Transformations</h3>
528534

529535
Some layout effects require <dfn export lt="blockify|blockification">blockification</dfn>
530536
or <dfn export lt="inlinify|inlinification">inlinification</dfn> of the box type,
531-
which sets the box’s <a>outer display type</a>, if it is not ''none'' or ''contents'',
537+
which sets the box’s <a>outer display type</a>,
538+
if it is not ''display/none'' or ''display/contents'',
532539
to ''block'' or ''inline'' (respectively).
533540

534541
<div class='example'>
@@ -549,8 +556,9 @@ Automatic Box Type Transformations</h3>
549556
break up the inline formatting context in which it participates.
550557

551558
The root element’s display type is always <a>blockified</a>.
552-
Additionally, a 'display' of ''contents'' computes to ''block'' on the root element.
559+
Additionally, a 'display' of ''display/contents'' computes to ''block'' on the root element.
553560

561+
<!--
554562

555563
<h2 id='box-suppress'>
556564
Toggling Box Generation: the 'display-or-not' property</h2>
@@ -569,15 +577,15 @@ Toggling Box Generation: the 'display-or-not' property</h2>
569577
The ''display: none'' value was historically used as a "toggle"
570578
to switch between showing and hiding an element.
571579
Making this reversible requires either setting up the CSS <a>cascade</a> carefully,
572-
or remembering what the 'display' value was before it was set to ''none''.
580+
or remembering what the 'display' value was before it was set to ''display/none''.
573581
To make this common use-case easier,
574582
this module introduces the separate 'display-or-not' property to do the same thing,
575583
so that toggling whether or not an element appears in the formatting tree
576584
can now be done without affecting its display type when it <em>is</em> displayed.
577585

578586
Issue: This property (which needs a better name)
579587
along with a <css>display-type</css> (or possibly <css>display-as</css>) longhand
580-
which takes all values of 'display' other than ''none'',
588+
which takes all values of 'display' other than ''display/none'',
581589
are intended to be longhands of 'display'.
582590
This has not yet been edited in, as this split feature is likely to be deferred to the next level
583591
in order to have time to thoroughly work through and accommodate the
@@ -619,6 +627,8 @@ Toggling Box Generation: the 'display-or-not' property</h2>
619627
Issue: Please send use cases (examples of where this property or something close to it is useful and necessary)
620628
<a href="mailto:www-style@w3.org?subject=%5Bcss-display%5D%20box-suppres%20use%20cases">to the CSSWG</a> so that we can be sure we're designing the details of its behavior correctly.
621629

630+
-->
631+
622632
<h2 id='run-in-layout'>
623633
Run-In Layout</h2>
624634

@@ -693,12 +703,18 @@ Run-In Layout</h2>
693703
A <dfn>run-in sequence</dfn> is a maximal sequence of consecutive sibling <a>run-in boxes</a>
694704
and intervening white space and/or out-of-flow boxes.
695705

696-
Issue: Should out-of-flow elements get reparented, left behind, or break apart the sequence?
697-
<a href="http://lists.w3.org/Archives/Public/www-style/2012Aug/0257.html">See thread.</a>
706+
Note: This statement implies that out-of-flow boxes are reparented
707+
if they are between two run-in boxes.
708+
Another alternative would be to leave behind the intervening out-of-flow boxes,
709+
or to have out-of-flow boxes impede the running-in of earlier boxes.
710+
Implementers and authors are encouraged to contact the CSSWG if they have a preferred behavior, as this one was picked somewhat at random.
698711

699-
Note: This run-in model is slightly different from the one proposed in earlier revisions of [[!CSS2]].
712+
Note: As the earliest run-in represents the first text on the <a>first formatted line</a> of its containing block,
713+
a ''::first-letter'' pseudo-element applied to that block element
714+
selects the first letter of the run-in,
715+
rather than the first letter of its own contents.
700716

701-
Issue: <a href="http://www.w3.org/mid/B81F7808-D972-458D-970F-3900E82A0F27@rivoal.net">Interaction of run-in and ::first-letter</a>
717+
Note: This run-in model is slightly different from the one proposed in earlier revisions of [[!CSS2]].
702718

703719
<h2 id='glossary'>
704720
Appendix A: Glossary</h2>
@@ -833,11 +849,6 @@ Appendix A: Glossary</h2>
833849

834850
Note: some formatting contexts inhibit floating,
835851
so that an element with ''float: left'' is not necessarily <a>out-of-flow</a>.
836-
837-
Issue: CSS2.1 defines the root element as out-of-flow.
838-
This <a href="https://lists.w3.org/Archives/Public/www-style/2015Aug/0332.html">seems to me</a>
839-
to be more likely to cause problems in our specs than not.
840-
Should we change that definition or copy it over?
841852
</dl>
842853

843854
See [[!CSS2]] <a href="https://www.w3.org/TR/CSS2/visuren.html">Chapter 9</a> for a fuller definition of these terms.
@@ -852,13 +863,27 @@ Acknowledgments</h2>
852863
and Anton Prowse,
853864
whose relentless assault on CSS2.1 Chapter 9 forced some order out of the chaos.
854865

866+
<!--
855867
We would also like to thank the many JavaScript libraries such as jQuery
856868
which have hacked around the "what 'display' should I give it when you call .show()?" problem,
857869
making it extremely clear that something needed to be done on our part.
870+
-->
858871

859872
<h2 class=no-num id="changes">
860873
Changes</h2>
861874

875+
Changes since the ??? Working Draft include:
876+
<ul>
877+
<li>Deferred the <css>box-suppress/display-or-not</css> property to the next level of Display,
878+
in order to provide time for futher discussion of use cases.
879+
<li>Specified that ''display: contents'' computes to ''display: inline'' on replaced elements and form controls.
880+
<li>Clarified that an element’s ''::before'' and ''::after'' pseudo-elements still exist if its own box is not generated due to ''display: contents''.
881+
<li>Clarified that event bubbling is not affected by ''display: contents''.
882+
<li>Clarified interaction of run-ins with out-of-flow elements and ''::first-letter''.
883+
<li>Switched ''table-caption'' and ''table-cell'' to use ''flow'' as their <a>inner display type</a>, since they always form a formatting context root.
884+
<li>Closed off remaining issues and added at-risk list.
885+
</ul>
886+
862887
Changes since the <a href="https://www.w3.org/TR/2015/WD-css-display-3-20150721/">21 July 2015 Working Draft</a> include:
863888

864889
<ul>

0 commit comments

Comments
 (0)