You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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
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.
17
17
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''
18
21
</pre>
19
22
<pre class="link-defaults">
20
23
spec:css-break-3; type:dfn; text:fragment;
@@ -40,14 +43,14 @@ Introduction</h2>
40
43
(See [[!CSS3-CASCADE]].)
41
44
42
45
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.
44
47
Typically, an element generates a single <a>box</a>.
45
48
However, some 'display' values
46
49
(e.g. ''display: list-item'')
47
50
generate more than one box
48
51
(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>).
49
52
And some values
50
-
(such as ''display:none'', ''display: contents'', and ''display-or-not: discard'')
53
+
(such as ''display/none'' or ''display/contents'')
51
54
cause the <a>element</a> and/or its descendants to not generate any <a>boxes</a> at all.
52
55
<a>Boxes</a> are assigned the same styles as their generating <a>element</a>, unless otherwise indicated.
53
56
They're often referred to by their 'display' type--
@@ -130,7 +133,7 @@ Box Layout Modes: the 'display' property</h2>
130
133
131
134
Some 'display' values have additional side-effects:
132
135
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.
134
137
135
138
Values are defined as follows:
136
139
@@ -162,11 +165,11 @@ Box Layout Modes: the 'display' property</h2>
162
165
<th>Generated box
163
166
<tbody title="Box Suppression Display Types">
164
167
<tr>
165
-
<td>''none''
168
+
<td>''display/none''
166
169
<td>〃
167
170
<td>subtree omitted from <a>box tree</a>
168
171
<tr>
169
-
<td>''contents''
172
+
<td>''display/contents''
170
173
<td>〃
171
174
<td>element replaced by contents in <a>box tree</a>
172
175
<tbody title="Flow Layout Display Types">
@@ -238,11 +241,11 @@ Box Layout Modes: the 'display' property</h2>
238
241
<tbody title="Layout-internal display types">
239
242
<tr>
240
243
<td>''table-cell''
241
-
<td>''table-cell flow''
244
+
<td>''table-cell flow-root''
242
245
<td>table cell <a>block container</a>
243
246
<tr>
244
247
<td>''table-caption''
245
-
<td>''table-caption flow''
248
+
<td>''table-caption flow-root''
246
249
<td>table cell <a>block container</a>
247
250
<tr>
248
251
<td>''ruby-base''
@@ -393,7 +396,7 @@ Layout-Internal Display Types: the ''table-*'' and ''ruby-*'' keywords</h3>
393
396
The element is an <dfn dfn>internal table element</dfn>,
394
397
and participates in a table layout context. [[!CSS2]]
395
398
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>.
@@ -456,7 +459,7 @@ Layout-Internal Display Types: the ''table-*'' and ''ruby-*'' keywords</h3>
456
459
</div>
457
460
458
461
<h3 id="box-generation">
459
-
Box Generation: the ''none'' and ''contents'' keywords</h3>
462
+
Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
460
463
461
464
While 'display' can control the <em>types</em> of boxes an element will generate,
462
465
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>
470
473
but its children and pseudo-elements still generate boxes as normal.
471
474
For the purposes of box generation and layout,
472
475
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.
473
478
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.
477
487
478
488
<dt><dfn>none</dfn>
479
489
<dd>
480
490
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.
485
491
</dl>
486
492
487
493
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>
528
534
529
535
Some layout effects require <dfn export lt="blockify|blockification">blockification</dfn>
530
536
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'',
532
539
to ''block'' or ''inline'' (respectively).
533
540
534
541
<div class='example'>
@@ -549,8 +556,9 @@ Automatic Box Type Transformations</h3>
549
556
break up the inline formatting context in which it participates.
550
557
551
558
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.
553
560
561
+
<!--
554
562
555
563
<h2 id='box-suppress'>
556
564
Toggling Box Generation: the 'display-or-not' property</h2>
@@ -569,15 +577,15 @@ Toggling Box Generation: the 'display-or-not' property</h2>
569
577
The ''display: none'' value was historically used as a "toggle"
570
578
to switch between showing and hiding an element.
571
579
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''.
573
581
To make this common use-case easier,
574
582
this module introduces the separate 'display-or-not' property to do the same thing,
575
583
so that toggling whether or not an element appears in the formatting tree
576
584
can now be done without affecting its display type when it <em>is</em> displayed.
577
585
578
586
Issue: This property (which needs a better name)
579
587
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'',
581
589
are intended to be longhands of 'display'.
582
590
This has not yet been edited in, as this split feature is likely to be deferred to the next level
583
591
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>
619
627
Issue: Please send use cases (examples of where this property or something close to it is useful and necessary)
620
628
<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.
621
629
630
+
-->
631
+
622
632
<h2 id='run-in-layout'>
623
633
Run-In Layout</h2>
624
634
@@ -693,12 +703,18 @@ Run-In Layout</h2>
693
703
A <dfn>run-in sequence</dfn> is a maximal sequence of consecutive sibling <a>run-in boxes</a>
694
704
and intervening white space and/or out-of-flow boxes.
695
705
696
-
Issue: Should out-of-flow elements get reparented, left behind, or break apart the sequence?
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.
698
711
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.
700
716
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]].
702
718
703
719
<h2 id='glossary'>
704
720
Appendix A: Glossary</h2>
@@ -833,11 +849,6 @@ Appendix A: Glossary</h2>
833
849
834
850
Note: some formatting contexts inhibit floating,
835
851
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?
841
852
</dl>
842
853
843
854
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>
852
863
and Anton Prowse,
853
864
whose relentless assault on CSS2.1 Chapter 9 forced some order out of the chaos.
854
865
866
+
<!--
855
867
We would also like to thank the many JavaScript libraries such as jQuery
856
868
which have hacked around the "what 'display' should I give it when you call .show()?" problem,
857
869
making it extremely clear that something needed to be done on our part.
870
+
-->
858
871
859
872
<h2 class=no-num id="changes">
860
873
Changes</h2>
861
874
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
+
862
887
Changes since the <a href="https://www.w3.org/TR/2015/WD-css-display-3-20150721/">21 July 2015 Working Draft</a> include:
0 commit comments