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

Ian Hickson ian at hixie.ch
Tue Nov 13 17:34:57 PST 2012


On Tue, 13 Nov 2012, Glenn Maynard wrote: k
> On Tue, Nov 13, 2012 at 4:38 PM, Ian Hickson <ian at 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.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list