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

    @min: "10"; 
    -min: "10"; 

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

   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;

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.


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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC