W3C home > Mailing lists > Public > www-svg@w3.org > February 2006

[SVG1.1] Question about switch and ID

From: Jeff Schiller <codedread@gmail.com>
Date: Wed, 22 Feb 2006 09:55:22 -0600
Message-ID: <da131fde0602220755s69d93580jadb09a7436f5728c@mail.gmail.com>
To: www-svg@w3.org

I know everyone's focused on SVGT1.2 at the moment, but I have a SVG
1.1 question.

I had the following code:

<g id="screen" display="none">
    <switch>
        <rect requiredFeatures="http://www.w3.org/TR/SVG11/feature#Filter"
            id="shadow" x="10" y="10" width="322" height="502" opacity="0.6"
            fill="black" stroke="none" filter="url(#gblurshadow)" />
        <rect id="shadow" x="10" y="10" width="322" height="502" opacity="0.6"
            fill="black" stroke="none" />
    </switch>
</g>

But I get a validation error saying the id="shadow" was already
defined and it needs to be unique.

1) Is this a correct validation error?  Should <switch> allow its
children elements to have identical IDs (and I assume only one of the
two options gets put into the DOM)?

3) How do I attach an event listener to the rendered shadow element? 
Should I be putting the id on the <switch> element and attaching event
listeners to it?  Would events be forwarded to the properly rendered
element?

4) Can I determine (through script) which one has been rendered?

If I'm totally confused, how would I accomplish the above?

Thanks,
Jeff
Received on Wednesday, 22 February 2006 15:55:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:53 UTC