Re: Proposal: Nesting SVG Graphics Elements

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