Fwd: Re: Display

-------- Original-Nachricht --------
> Datum: Tue, 27 Apr 2010 14:40:40 -0400
> Von: Boris Zbarsky <bzbarsky@MIT.EDU>

> On 4/27/10 10:43 AM, Markus Ernst wrote:
> > function showHide(elementId, mode) {
> >    var el = document.getElementById(elementId);
> >    el.style.display = mode == "show" ? "" : "none";
> > }
> >
> > Anyway, I did not find a specification for this, so I am not sure if
> this is supposed to work like that in every UA. And for sure, a "default"
> keyword would be more intuitive.
> 
> But the above doesn't set display to "default".  It sets it to "whatever 
> it is ignoring inline style", since a set to "" is treated like 
> removeProperty.

I see, so this is what Colt actually meant with the "defined" keyword (if I understood him correctly).

> It's not clear to me how "default" would be defined.  Care to suggest a 
> definition?

The element's "natural" display value, if no value is set in a style sheet or the style attribute - "block" for a div or p element, "table-row" for a tr element, "inline" for a span or em element... There are such keywords for other kinds of values, such as "normal" for the line-height property.

I assume it is the same Aryeh Gregor refers to in his post, saying "A magic value meaning 'ignore all author rules and use whatever the UA stylesheet says'". This would IMO be helpful, not only for the display property, but specially for this one.

> > Also, I like the idea of a 'defined' keyword to reset the value from 
> the stylesheet.
> 
> Not sure what you mean.  Can you give an example?

As mentioned above, the value that applies if the property is removed from the style attribute. Anyway, as removing the property is no problem, this suggestion might be obsolete indeed.


[PS: If strange quoting occurs again in this post, I apologize. Unlike other mailing lists, www-style does not accept mail with my GMX sender address sent through my ISP's SMTP server, so I have to use the GMX mail application instead of properly quoting Thunderbird.]
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/chbrowser

-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/chbrowser

Received on Tuesday, 27 April 2010 20:28:58 UTC