W3C home > Mailing lists > Public > www-svg@w3.org > December 2012

Re: Proposal: Nesting SVG Graphics Elements

From: Lea Verou <lea@w3.org>
Date: Fri, 7 Dec 2012 03:44:29 +0200
Cc: SVG public list <www-svg@w3.org>
Message-Id: <D52539B1-D49F-4965-81F0-76E162E63728@w3.org>
To: steve@fenestra.com
On Dec 1, 2012, at 01:35, Steve Schafer wrote:

> So, going back to one of your examples, this slightly modified version:
>  <rect id="r4" x="100" y="10" width="40" height="40">
>    <circle id="c4" cx="200" cy="20" r="20"/>
>  </rect>
> And this one:
>  <circle id="c4" cx="300" cy="20" r="20"/>
>    <rect id="r4" x="-100" y="10" width="40" height="40">
>  </circle>
> render indistinguishably.
> That just gives me chills up my spine. ;-)

This is an edge case, where the shapes don’t overlap with their parents/children. In the most common use cases, they wouldn’t render indistinguishably. In the first example the circle would be on top of the rect, whereas in the 2nd case, the rect would be drawn on top of the circle. This doesn’t even require any additional rules, just the current one about source order.

FWIW, I completely agree with Tab and Doug here. As someone who learned CSS and HTML before SVG, the inability to nest always frustrated me to no end. I believe this sentiment is shared by multiple authors and, to a certain degree, contributes to the low adoption of SVG.

Lea Verou
W3C developer relations
http://w3.org/people/all#leahttp://lea.verou.me ✿ @leaverou
Received on Friday, 7 December 2012 01:44:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:30 UTC