W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] hidden="" should be "display:none !important" in the UA stylesheet

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 14 Nov 2012 01:34:57 +0000 (UTC)
To: Glenn Maynard <glenn@zewt.org>
Message-ID: <Pine.LNX.4.64.1211140129200.15000@ps20323.dreamhostps.com>
Cc: whatwg@lists.whatwg.org, Edward O'Connor <eoconnor@apple.com>
On Tue, 13 Nov 2012, Glenn Maynard wrote: k
> On Tue, Nov 13, 2012 at 4:38 PM, Ian Hickson <ian@hixie.ch> wrote:
> > 
> > You just have to write .thing:not([hidden]), or have an explicit 
> > [hidden] rule. It's not a big deal.
> 
> This is a cumbersome, hackish workaround.

To be honest, in practice I almost always have a rule for [hidden] because 
I rarely want it to use 'display: none' anyway. So I don't really agree 
that it's hackish or cumbersome, at least not in my case.


> I shouldn't have to care about whether an element might have its @hidden 
> property set when I set an element to inline-block, and I shouldn't need 
> to hack up my CSS when I hide an element.

That's like saying you shouldn't have to care whether a form control is 
disabled when you set its color, or whether a link is visited when you set 
its color, or whether a <details> or <dialog> element is open when you set 
its dimensions, or what the rel="" value on a link is when you set its 
cursor, or various other similar cases.


> > The better solution would be for us to cascade the display type 
> > separately from the rendering tree inclusion/exclusion decision, but 
> > that boat sailed a long time ago.
> 
> Surely nothing prevents adding a CSS property, eg. "shown: no", which 
> takes precedence over display when set to "no" and does nothing when set 
> to "yes".  It's probably too late to change @hidden to use it, though 
> maybe not; it would probably break a roughly equal number of sites as 
> the change proposed here would.

I meant the ship had sailed for making 'display' a shorthand, but I guess 
in theory we could still do this. In fact, people periodically say 
display-inner/display-outer should be introduced. This kind of thing, if 
done right, would certainly avoid this particular issue in the future for 
hidden="". Not a quick fix, though.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 14 November 2012 02:29:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT