Re: [libcroco-list] API corresponding to getComputedStyle() of DOM
- From: Dodji Seketeli <dodji seketeli org>
- To: Kang Jeong-Hee <Keizi mail co kr>
- Cc: libcroco-list gnome org
- Subject: Re: [libcroco-list] API corresponding to getComputedStyle() of DOM
- Date: Fri, 08 Aug 2003 13:12:13 +0200 (MEST)
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,
CRBox *a_parent_box) ;
This function is defined at
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
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,
> Libcroco-list mailing list
> Libcroco-list gnome org
gnome xml editor: http://www.freespiders.org/projects/gmlview
gnome css2 parsing toolkit: http://www.freespiders.org/projects/libcroco
] [Thread Prev