Skip to content

Commit f4780dc

Browse files
committed
[css-display] Make form controls and replaced elements behave like 'display: none'. Use a handwavy definition of “form control” until HTML has one we can refer to. w3c#1024 w3c#540
1 parent a26f141 commit f4780dc

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

css-display/Overview.bs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,25 @@ Box Generation: the ''display/none'' and ''display/contents'' keywords</h3>
482482
such as selector-matching and event handling,
483483
are not affected.
484484

485-
This value has no effect on replaced elements and form controls;
486-
it computes to ''inline'' exactly as if the UA style sheet had specified
487-
''display: inline !important'' on such elements.
485+
This value is treated as ''display: none'' on replaced elements,
486+
form controls
487+
(i.e. user interface elements whose element type
488+
can accept and/or submit user data,
489+
such as <code>&lt;input&gt;</code> and <code>&lt;button&gt;</code>),
490+
and (obviously) empty elements.
491+
The effect is exactly as if the UA style sheet had specified
492+
''display: none !important'' on such elements,
493+
except that the computed style is still ''contents''.
494+
495+
Note: Replaced elements and form controls are included in this special case
496+
because their rendering requirements are often
497+
outside the scope of the CSS formatting model,
498+
and therefore removing only the element’s own generating box
499+
is a more-or-less undefined operation.
500+
As this behavior may be refined if use cases
501+
(and more precise rendering models) develop,
502+
authors should use ''display: none'' rather than ''display: contents''
503+
on such elements for forward-compatibility.
488504

489505
<dt><dfn>none</dfn>
490506
<dd>

0 commit comments

Comments
 (0)