Re: [css4-values] Global Keywords 'normal', 'auto', 'none', 'default'

On Tue, Apr 3, 2012 at 3:54 AM, Christoph Päper
<christoph.paeper@crissov.de> wrote:
> I actually thought about something like this (with different keywords) as an April Fool’s joke, but maybe it isn’t that stupid at all. Since the deadline for LC comments for Units and Values Level 3 ended last week, this is a suggestion for Level 4 of that module, although the editors and the WG could of course accept it – at least the first three quarters – into the current draft.
>
> I would like to propose to make the frequent keywords ‘normal’, ‘auto’ and ‘none’ available globally, i.e. for all property values. Modules may give them special meaning per property and begin doing so at any level, otherwise they default to their Values definition and are interpreted as follows:
>
>  ‘normal’:
>     The value the user agent vendor prefers for a property in general.
>     Usually the same as ‘initial’ or “100%”.
>
>  ‘auto’:
>     Any valid value the user agent deems appropriate for the current
>     document and rendering environment.
>     Usually the same as ‘inherit’ for inherited properties and the
>     same as ‘normal’ for others.
>
>  ‘none’:
>     If the property has only two valid values except for global keywords,
>     ‘none’ has the opposite effect of ‘normal’.
>     If a single numeric value, e.g. <length>, is possible, it equals “0”.
>     Otherwise it may be any value at the vendor’s discretion, but should
>     not compute to the same as ‘initial’.
>
> I would also like to propose a new global value, ‘default’:
>
>  ‘default’:
>     The value the user agent normally uses for this selector in the
>     current document and rendering environment, often the same as
>     ‘initial’ or ‘inherit’.
>     That is, the value from non-important UA and user stylesheets
>     combined, without author stylesheets intervening.
>     If specified in UA stylesheets it works the same as ‘initial’.
>
> All of these can be used wherever ‘initial’ and ‘inherit’ would be valid. Therefore they’re introduced in the same section.
>
> I’m open to better suggestions for the generalized semantics of these keywords.

I agree with 'default' - we had an issue in V&U3 for it for a while,
but have punted it for now.  The intent is that it will "roll back"
the cascade one level: if used in an author style sheet, it instead
uses the cascaded value from user stylesheets (or UA if there is no
user); if used in a user style sheet, it uses the cascaded value from
the UA stylesheet, etc.  It might pay attention to !important as well,
I dunno.

I also agree with 'none', though not quite how you phrase it - I think
all list-valued properties should have a value that means "do
nothing".  Many of them already use 'none' for precisely that value,
which is fine, but we can go ahead and make it global.

I disagree with 'normal' and 'auto'.  When we add them to a property,
they mean approximately what you describe.  However, making them
global means that they're valid for all properties, which means we
can't alter their meaning for a particular property later when we
discover that we really want to make a "do something reasonable"
value.  These values are most useful when we add them at the moment we
decide we need them, so we can give them the specific meaning that we
need.

~TJ

Received on Tuesday, 3 April 2012 17:12:42 UTC