[libcroco-list] Re: CSS



Hi,
Sorry, for my late reply.

Well, librsvg "only" uses the SAC interface of libcroco.
Sodi definitely needs the CSSOM interface as it needs to perform edition on
the css document.

Let me explain a bit what the cascading interface of croco looks like today.
It all comes down to two main classes: the selection engine and the cascade.
The cascade is the combination of (at most) 3 stylesheets: the author stylesheet, the user stylesheet and the default (or user agent) stylesheet ... this is more or less what the css2 spec says.

The selection engine is the engine that (roughly said) can return all the css properties associated to an xml node.
Note that an xml node is an instance of the libxml2 xmlNode data structure.
This engine knows how to handle the css cascading rules to resolve all the "precedence conflicts" that
can arise.
As an example, the api that can be usefull is
_cr_sel_eng_get_matched_properties_from_cascade () describded at http://www.freespiders.org/projects/libcroco/docs/apidoc/0.2/cr-sel-eng_8c.html#a11 .

This is a starting point of discussion. I think you will need more information about how the stylesheet tree model is organized and how you can gather information from it
to build a style data structure with strongly typed fields.
If it appears that you need this kind of information, don't worry, just ask. I will try to answer.

All the best,

Dodji.


Okay, I think I'm ready to start looking at CSS again in earnest now.
I'm going to make a branch in my tree tonight and start working out what
I need to do to replace the existing parser I wrote.

Once the parser is in place, I'll try feeding the patch to Lauris
incrementally and then I can start implementing stylesheet/cascading
support.

Now... as Lauris commented, actually doing the cascade for each
declaration (and keeping it up to date as selectors/stylesheets/rules
change) is going to be tricky.

Are you familiar with how librsvg does it with libcroco, or does librsvg
not do dynamic documents?

-mental




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]