Skip to content

Commit a071812

Browse files
committed
[css-display] Rephrase the definition of display:contents to refer to the Appendix, and be less awkward about pseudos.
1 parent 80786eb commit a071812

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

css-display/Overview.bs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -478,26 +478,23 @@ Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
478478
The element itself does not generate any boxes,
479479
but its children and pseudo-elements still generate boxes as normal.
480480
For the purposes of box generation and layout,
481-
the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree.
482-
However, its ''::before'' and ''::after'' pseudo-elements still exist,
483-
and are parented by the element's parent's principal box along with the rest of the element's box-generating contents.
481+
the element must be treated as if it had been replaced in the [=element tree=]
482+
by its contents
483+
(including both its source-document children and its pseudo-elements,
484+
such as ''::before'' and ''::after'' pseudo-elements,
485+
which are generated before/after the element's children as normal).
484486

485487
Note: As only the box tree is affected,
486488
any semantics based on the document tree,
487489
such as selector-matching and event handling,
488490
are not affected.
489491

490-
This value is treated as ''display: none'' on replaced elements,
491-
and form controls
492-
(such as <a href="https://html.spec.whatwg.org/multipage/forms.html#category-submit">submittable elements</a> in [[HTML]]).
493-
The effect is exactly as if the UA style sheet had specified
494-
''display: none !important'' on such elements,
495-
except that the computed style is still ''contents''.
496-
497-
Note: Replaced elements and form controls are included in this special case
498-
because their rendering requirements are often
499-
outside the scope of the CSS formatting model,
500-
and therefore removing only the element’s own generating box
492+
This value behaves as ''display: none'' on replaced elements
493+
and other elements whose rendering is not entirely controlled by CSS;
494+
see [[#unbox]] for details.
495+
496+
Note: Replaced elements and form controls are treated specially
497+
because removing only the element’s own generating box
501498
is a more-or-less undefined operation.
502499
As this behavior may be refined if use cases
503500
(and more precise rendering models) develop,
@@ -506,7 +503,7 @@ Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
506503

507504
<dt><dfn>none</dfn>
508505
<dd>
509-
The element and its descendants generates no boxes.
506+
The element and its descendants generate no boxes.
510507
</dl>
511508

512509
Elements with either of these values do not have <a>inner</a> or <a>outer display types</a>,

0 commit comments

Comments
 (0)