Re: [css-d] CSS Javascript API

* Ian Hickson wrote:
>On Thu, 1 Jan 2004, Bjoern Hoehrmann wrote:
>>
>> I need an interface (or interfaces) for tree-style access to cascading
>> style sheets to write general purpose CSS processing tools.
>
>Could you be more specific? DOM2 CSS does satisfy what you describe,

I gave some examples... Say I want to write a general purpose CSS pretty
printer based on DOM Level 2 CSS. I would need a DOM implementation. I
tried to write one and failed [1].

Even if it would be possible to implement the specification [2] suggests
that the implementation should not provide the UnknownRule interface. My
pretty printer would thus be limited to CSS Level 2.0 style sheets in
contrast to the intention of beeing a general purpose tool.

And, would you use a CSS pretty printer that drops all comments in your
style sheets? I would not.

[1] http://lists.w3.org/Archives/Public/www-style/2001Sep/0093.html
[2] http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html

>> A CSS DOM Use Cases and Requirements document would probably be helpful.
>
>Indeed, unfortunately I don't really know what the use cases and
>requirements _are_. That is what I am trying to find out. :-)

Well,

  W3C 
  CSS DOM Use Cases and Requirements
  W3C Working Draft ...
  ...
  Abstract
  ...
  Status of this Document
  ...
  Table of Contents
  ...
  1. Use Cases

    We have no idea, please send comments to www-style@w3.org.

  A. References
  ...

;-)

However, to make a start, I need a Selector API that

  * is at least as sophisticated as [3]
  * is forward-compatible in a usable manner
  * includes support for CSS Level 3 Selectors
  * allows to query for the selectors specifity
  * provides access to comments as in e.g. a/**/b {...}
  * allows to query pseudo classes, attribute selectors, and
    pseudo elements for their associated element type selector

[3] http://www.w3.org/Style/CSS/SAC/doc/org/w3c/css/sac/Selector.html

Received on Thursday, 1 January 2004 21:26:45 UTC