Re: [cssom] Proposing a getDefaultComputedStyle method

On Sat, Oct 13, 2012 at 7:51 PM, Mike Sherov <mike.sherov@gmail.com> wrote:
>> 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?

'initial' sets the property to the 'initial value' defined in the
property definition.  This is the same for all elements; for
'display', for example, it's 'inline'.

What you want instead is the "initial value before author styles are
applied".  This means you want the UA stylesheet to apply, so that
<div> returns 'block' for 'display'.

Given the use-case, it seems like we probably also want to allow user
styles to apply, so that we're interpreting the 'default' value as
just "what the value would be if there were no author stylesheets".

~TJ

Received on Sunday, 14 October 2012 15:18:07 UTC