CSS Parser (Fwd: Re: kdenonbeta/kdom/css)

Rob Buis rwlbuis at xs4all.nl
Mon Feb 16 11:08:02 GMT 2004


----- Forwarded message from Rob Buis <rwlbuis at xs4all.nl> -----

Hi,

On Sat, Feb 14, 2004 at 04:54:52AM +0100, Dirk Mueller wrote:
> 
> I'm not aware of any other requests. But anyway, its free software, send a 
> patch. You can't expect anybody else to just make it suit your needs when he 
> doesn't even know about those needs. And "Yeah, CSS Parser" is not precise 
> enough. For parsing CSS you don't need much more than copying the bison 
> grammar file, big deal. The interesting part is the data representation and 
> the inheritance / style selector. And as long as nobody says what he wants 
> its unlikely that a solution will be make that fits the needs..

Ok, maybe we have been too vague.
Well, I can say, KSVG definitely needs *some* css parser :))

The thing with it, is that it also dictates a lot of related issues,
like render objects/styles. I did think over css parsing a lot and how to 
use the khtml css code...
For it to work with khtml css parser, there are two scenarios I can think 
of right now :

1) Change the current css parser to also parse svg properties (fill, 
   stroke etc.). Also then the style selector would have to change, as
   ksvg doesnt use RenderStyle/RenderObject datastructures, although our
   datastructures are quite close.
2) Copy the css parser and make it pick up strictly props needed for svg.

It is clear new style selector code has to be written for svg in both 
cases, simply because of the fact svg has different style concepts 
(paint styles, masks, markers etc.).

Does this make sense, did I forget anything? Assuming these are the two 
only scenarios, what are the benefits and downsides to both approaches?
Cheers,

Rob.

----- End forwarded message -----




More information about the kfm-devel mailing list