Re: Layout Information for SVG Elements

Steven Roussey <[email protected]> Tue, 24 Nov 2009 19:24:37 -0800 (PST)
Newsgroups gmane.comp.mozilla.devel.svg
Organization http://groups.google.com
Message-ID <f2107918-4d11-4169-98f8-5b7f70055e39@y10g2000prg.googlegroups.com>
> > But anyway, if the option is off then it shows offsets and uses
> > element.offset* which results in nothing, and height/width of NaN.
>
> You should, imo, just drop the offset* stuff.  It's broken and useless.

OK, knowing how it is broken would be helpful. For example: for just
width/height?

What else gives the relative distance to the nearest positioned
parent?

> > Looking at the svg of a circle here:
> >http://math.chapman.edu/~jipsen/mathml/asciimathandmathmlsvg.xhtml
>
> >        <svg:svg width="50px" height="50px">
> >          <svg:circle cx="25px" cy="25px" r="20px" fill="green"/>
> >        </svg:svg>
>
> > It says it has a width and height of 40px.
>
> Height and width of which?  The <svg:circle> or the <svg:svg>?  The
> former in fact has a bounding rect with width=height=40px.

Both. <svg:svg> also says it is 40px. Changing its width from 50px to
150px makes a clear difference if you have text around it, as viewed
in the content. But getBoundingClientRect still returns 40px for the
width.

MathML has a similar issue with its top most element and
getBoundingClientRect. All the ones inside look fine.

-steve--