W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: [CSS] Would be nice if...

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 09 Jan 2008 12:26:43 -0800
Message-ID: <47852E03.9060107@terrainformatica.com>
To: David Dorward <david@dorward.me.uk>
CC: CSS Style <www-style@w3.org>

David Dorward wrote:
>
> On 8 Jan 2008, at 20:09, Andrew Fedoniouk wrote:
>> ... CSS will allow to define values of attributes of elements.
>
> Please, no. That would require every user agent to support style 
> sheets before they could process documents.
>
> html {
>   @lang: 'en';
> }
>
> Now GoogleBot has to support CSS in order to determine the language of 
> the document.
>
> We have markup to define values of attributes of elements, we don't 
> need another way to do it.
>
Seems like my wording was not clear enough.

Imagine that your UA allows you to define custom *CSS attributes* like

#myelem
{
    @min: "10"; 
}
or
#myelem
{
    -min: "10"; 
}

Imagine also that implementation of input[type="range"] element 
(behavior,driver,control, etc.) gets attribute
value as:

<pseudocode>
   value element::get_value_of_min()
  {
      if( this.attributes.has("min")  ) return this.attributes.get("min");
      if( this.style.has("@min")  ) return this.style.get("@min");
      return value::undefined;
  }
</pseudocode>

Having these two features allows you to define min/max values for group 
of range elements in CSS.
So technically this is not
  "CSS will allow to define values of attributes of elements"
but rather
  "Could we have a notation that will allow to define custom attributes 
in CSS?"

These custom attributes will help in other places too.
For example Ben Nolan's behaviors [1] can be implemented better -
at least his implementation will not require hand made CSS selector 
processor (in JS).

--
Andrew Fedoniouk.

http://terrainformatica.com

[1] http://www.bennolan.com/behaviour/
Received on Wednesday, 9 January 2008 20:27:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:57 GMT