W3C home > Mailing lists > Public > public-appformats@w3.org > February 2007

Re: [XBL] Accessing flattened tree parents of a shadow tree

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 15 Feb 2007 00:50:59 +0000 (UTC)
To: Cameron McCormack <cam@mcc.id.au>
Cc: public-appformats@w3.org
Message-ID: <Pine.LNX.4.62.0702150050190.4112@dhalsim.dreamhost.com>
On Thu, 15 Feb 2007, Ian Hickson wrote:
>
> On Thu, 15 Feb 2007, Cameron McCormack wrote:
> > 
> > My example before wasn’t the best, I think.  Here’s a more concrete 
> > one: I want to write a function that will center an element in its 
> > viewport.
> 
> Just wrap the element in two <g> elements, the outer one having a <g 
> x="50%"> and the inner one having <g x="-...px"> where ... is half the 
> bounding box (which you can obtain through the DOM).

It was pointed out to me that, in line with SVG's usual inconsistencies, 
<g> doesn't have an x="" attribute. Please pretend I had used a transform 
attribute with a translate() transform instead.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 15 February 2007 00:51:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:10:21 GMT