W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2014

Re: [whatwg] hidden attribute useless with display: flex?

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 30 Apr 2014 18:08:11 -0500
Message-ID: <CABirCh_guMWOn4WeAhJ0y3HQ8rquT+RsDfW0R+jhd=SUfpq5jg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: whatwg <whatwg@whatwg.org>, David Bruant <bruant.d@gmail.com>
On Wed, Apr 30, 2014 at 4:12 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Wed, Apr 30, 2014 at 7:32 AM, Glenn Maynard <glenn@zewt.org> wrote:
> > It's too bad that display-box also has multiple uses--it doesn't only
> > display or hide the content, it has a third "contents" mode.  That means
> > the same problem would happen as soon as you set "display-box: contents"
> on
> > something--it would override [hidden].  What we really need is a CSS
> > property that only sets whether the element is visible or not and nothing
> > else, like "visible: false".  That way, the only way [hidden] gets
> > overridden is if you're actually setting the visibility style.
> Mind bringing this up in www-style?  My thinking in that design is

(It's confusing to move conversations to lists some people aren't
subscribed to, since they'll inevitably miss part of the discussion.  It'd
help a lot if the lists wouldn't bounce mails if you're subscribed to *any*
w3 mailing list, so cross-posting would work better.  But, I think that
starting a new thread on another list without copying it to this one is
even more confusing, so I've CC'd both.)

that display-box controls whether an element generates boxes at all,
> which seems consistent with including the 'contents' value.  But if it
> seems useful to have a property dedicated to literally just hiding the
> element, we can see about rejiggering things.

If an element is @hidden, I don't want style rules for other behaviors to
override that.  Just as today I don't want a display: block; style to break
hidden ("I just wanted this inline element to be block when it's not
hidden, not override hidden entirely!"), I don't want display-box:
contents; to break hidden either ("I just wanted to cause the element
itself to not be rendered when it's not hidden, not override hidden

That said, we may be past the point where it will really help.  It's too
late to actually use this with the default [hidden] rule, which means
authors will have to put a [hidden] { rendered: false; } (or something)
rule in their stylesheet.  If authors all need to add a boilerplate rule to
fix @hidden anyway, [hidden] { display: none !important; } works.

Glenn Maynard
Received on Wednesday, 30 April 2014 23:09:33 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:19 UTC