Proposal: allow display: contents to do away with legacy fieldset/legend rendering #957
Description
If a style declaration of display: contents
is applied to a fieldset
element, it should ditch all the legacy behavior in terms of rendering, and (I'm assuming) just show the legend
as an inline element per default, allowing authors to control the layout and rendering fully by using CSS (by using another wrapper, rather than styling the fieldset
element directly).
The old/odd behavior of fieldset
and legend
has, in my experience, prevented loads of people from using them over the years, potentially making the web less accessible in the process. I think the addition of display: contents
in CSS is an excellent opportunity to ditch the old behavior for newer sites, without breaking backwards compatibility.
I've opened the same issue against the WHATWG spec here: whatwg/html#2805
Blog post here: https://thatemil.com/blog/2017/07/01/fixing-fieldsets/