Re: [cssom] Proposing a getDefaultComputedStyle method

Mike Sherov
Lead Developer
SNAP Interactive, Inc.
Ticker: STVI

Sent From Mobile: Please excuse my grammar, tone, and punctuation. My
thumbs can't produce flowery prose.

On Oct 12, 2012, at 5:29 PM, "Tab Atkins Jr." <> wrote:

> 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.

Sorry, I'm dense. What do you mean by one "level"? In the use case
I've described, why wouldn't "initial" be sufficient and only
"default" would?

> 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 Sunday, 14 October 2012 02:51:45 UTC