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

css, namespaces and default properties

From: Claus Wahlers <claus@ego7.com>
Date: Tue, 21 Jan 2003 03:08:52 +0100
To: <www-style@w3.org>
Message-ID: <MGEIIMPHDDELBHEBDJKHIEABDLAA.claus@ego7.com>

hi list,
as i'm new here, a quick introduction:
i'm a developer probably like all of you, but with a strong focus on
macromedia flash technologies (*duck*). in my current major project named
"DENG" i try to build a modular engine to render xml with css 2.1,
extensible with plugin namespace modules (we are working on an
XHTML-basic/XForms module right now, but any other namespaces may be added
in the future), all done in flash mx actionscript. you may check out an
early preview of the css parser module here: http://claus.packts.net/css
(you'll need the flash player 6). i also have a weblog up at
http://w3blog.com/news reporting on news about this project as well as on
other stuff i might find interesting.

now here's my problem:
for each node in the xml dom i create a css object containing default
property definitions for the namespace the element belongs to (this includes
property name, inheritance yes/no, initial value and getters for examining
the computed values or handling shorthand properties etc). for xhtml or if
no namespace is specified, i am using property definitions as specified in
the css2 and css2.1 specs, but for svg for example i use the css property
set as described in the svg spec).

an example:
<?xml version="1.0"?>
<?xml-stylesheet href="test.css" type="text/css"?>
<ns1:element
    class="main"
    xmlns:ns1="http://namespace/1"
    xmlns:ns2="http://namespace/2">
  <ns2:element>
    <ns1:element/>
  </ns2:element>
</ns1:element>

test.css:
element.main { color-rendering: optimizeSpeed; }

now lets say the only allowed property for ns1 is "color-rendering" and ns2
has no such property ("color-rendering" is a svg css property, and there's
no such property in css 2 core).

when rendering the innermost <ns1:element>, the renderer will find no value
for "color-rendering" so it has to do the cascade. the property is inherited
so it has to go down the chain in the xml dom. we've got a problem here, as
the parent node's namespace is ns2 and there is no such property.

how should a renderer handle this?
should it just skip the element and search the next parent?
should it ignore all other namespaces than the one of the originating node
when going down the cascade?
does this make sense at all?
any hints apprechated, thanks in advance!
cheers,
claus.
i: 4854079
e: claus@ego7.com
team macromedia volunteer for flash
http://www.macromedia.com/go/team/
Received on Monday, 20 January 2003 21:08:16 GMT

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