Re: [libcroco-list] API corresponding to getComputedStyle() of DOM

Hi Kang,
Hi think some explanations are needed here so that we get sure
we talk about the same thing.

Well, from what I understand at,
the interface of getComputedStyle is :

CSSStyleDeclaration getComputedStyle(in Element elt, 
                                       in DOMString pseudoElt);

Libcroco's layout engine aka layeng, when dealing with
specified/computed/actual style properties doesn't keep any information
about the css declaration that originated the style.
In other word, (for the moment) you cannot get the CSSStyleDeclaration
that originated a given style property.

Instead,  the style information is encoded in a CRStyle data structure,
and each instance of CRStyle holds both speficied and computed values.
Of course, the "computed values" are ... computed from the
"specified values" and from some other information.
The "computed values" processing is done by the function :

static enum CRStatus
style_specified_2_computed_values (CRLayEng *a_this,
                                   CRStyle *a_style, 
                                   CRBox *a_parent_box) ;
This function is defined at,
line 339.

Note that each instance of xmlNode* from the origin xml document has
an instance of CRStyle associated to it.

Is this the function you would like to see "public" ?
If not, could you 
1/explain me what you want to do with this api exactly so that I understand
the context.
2/give me an example of function prototype you would like to have. Then
we could discuss the pros and cons, and maybe you could even provide a patch :)

All the best,


Quoting Kang Jeong-Hee <Keizi mail co kr>:

> DOM Level 2 Style declare ViewCSS::getComputedStyle()
> to return fully computed CSSStyleDeclaration; e.g.
> when I give a height of 2em, CSSStyleDeclaration
> returned by getComputedStyle() have 36px of height.
> You can see a full example html here;
> I've seen cr-lay-eng.c have some lines of code that
> include parent's style into calculation for current style.
> But they're not public and not universal.
> I think that I need a public API to get computed style
> of any property of any kind of value. Desirable?
> Thanks in advance,
> kz.
> _______________________________________________
> Libcroco-list mailing list
> Libcroco-list gnome org

gnome xml editor:
gnome css2 parsing toolkit:

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