Full version, Basic version

Specification link: 5.11 DOM interfaces

script-handle-04-b ← index → struct-dom-02-b

# struct-dom-01-b
SVG Image | PNG Image

Verify the basic capability to handle the SVG DOM API. The test is composed of a top level svg element with an 'onload' event handler and a rect element. Both the svg and the rect elements have an identifier. The 'onload' handler invokes SVG-specific DOM API methods which use these identifiers.

First, the handler gets the SVG element owner of the rect element and checks it has the expected identifier. Then, the handler accesses the coordinates of the rect element and uses them to build a 'shadow' rectangle under the existing one. Finally, the 'shadow' rectangle is created using the SVGSVGElement's createSVGRect method.

If an implementation supports the ECMA Script DOM binding for SVG, then the image should show the following text: "This document's root identifier is: svg-root" and a red rectangle with a black shadow rectangle. Otherwise, only a red rectangle will show.

The rendered picture should match the reference image.

script-handle-04-b ← index → struct-dom-02-b

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License.
To contribute to a W3C Test Suite, see the policies and contribution forms.