W3C home > Mailing lists > Public > www-style@w3.org > August 2001

@rule for class attribute (Was: Another approch to style hyperlinks)

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 2 Aug 2001 21:59:48 -0700 (Pacific Daylight Time)
To: fantasai <fantasai@escape.com>
cc: <www-style@w3.org>
Message-ID: <Pine.WNT.4.31.0108022144120.800-100000@HIXIE.netscape.com>
On Fri, 3 Aug 2001, fantasai wrote:
> What you /do/ need is an @rule to identify the class attribute.

In practice, that's not a workable solution. The class attribute can be
handled specially at parse time in order to increase the performance of
matching on it. Therefore the attribute must be known to be the class
attribute before the stylesheet is read.

I once came up with the following XSchema data type definition which would
allow people to mark their attributes as being the class attribute without
resorting to changing the UA implementations, which may be used in a
future version of the Selectors module:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 <xsd:simpleType name="class">
  <xsd:list itemType="xsd:string"/>
   <xsd:documentation source="http://www.w3.org/TR/Selectors"
    The dot notation of Selectors SHOULD match attributes declared to
    be of this type. For example, the following element:

       <foo type="bright green" class="red"/>

    ...would match the following three selectors:

       .bright, .green, .bright.green

    ...assuming that the relevant schema defined the <foo> element as:

       <xsd:element xmlns:css="http://www.w3.org/2001/Selectors"
         <xsd:attribute name="type"  type="css:class"/>
         <xsd:attribute name="class" type="xsd:string"/>

    However the same element MUST not match this selector:


    ...because there is nothing magical about the "class" attribute
    itself on the foo element.

Ian Hickson                                            )\     _. - ._.)   fL
Invited Expert, CSS Working Group                     /. `- '  (  `--'
The views expressed in this message are strictly      `- , ) -  > ) \
personal and not those of Netscape or Mozilla. ________ (.' \) (.' -' ______
Received on Friday, 3 August 2001 00:58:53 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:58 UTC