Re: [cssom] Proposing a getDefaultComputedStyle method

On Fri, Oct 12, 2012 at 2:23 PM, Mike Sherov <> 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.


Received on Friday, 12 October 2012 21:29:43 UTC