W3C home > Mailing lists > Public > www-style@w3.org > October 2012

Re: [cssom] Proposing a getDefaultComputedStyle method

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 12 Oct 2012 14:28:57 -0700
Message-ID: <CAAWBYDD_doppPDjvf+=mTXxTZO0cERfByW+LgC593gMccbkp7Q@mail.gmail.com>
To: Mike Sherov <mike.sherov@gmail.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Fri, Oct 12, 2012 at 2:23 PM, Mike Sherov <mike.sherov@gmail.com> wrote:
> Yeah, as a jQuery team member here, I would say this is a top ask of ours.
>
> The IFRAME hack is nasty, and the none IFRAME case isn't much better.
>
> The use case here is $(elem).show() when the author rules say the CSS
> display value is "none". What CSS display value should be added?
> Without keeping a large map of elements to default value, its
> impossible to say without jumping through hoops.
>
> We even have several tickets dedicated to working around the issue be
> using the .hidden property of the element, but that'll be a dead end
> too.
>
> I'm glad to see this gaining support!

Yeah, like I said, *that* use-case can be handled well by the new
"default" global value that we've discussed adding, which is like
"initial" but only resets one "level" of stylesheets, rather than
going back all the way to absolute starting values.

You only need this function if you're going to do processing *based
on* the default value, like what Boris explained with the "if the
element defaults to 'inline', make it 'inline-block' when you animate
width/height" case.

~TJ
Received on Friday, 12 October 2012 21:29:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:01 GMT