Closed Bug 163268 Opened 22 years ago Closed 22 years ago

SVGRoot.createSVGRect != document.createElementNS('http://www.w3.org/2000/svg', 'rect')

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jwatt, Assigned: alex)

Details

Attachments

(1 file)

If an element is created using say: 

SVGRoot.createSVGRect();

then the setAttribute method does not exist for it. You have to use: 

document.createElementNS('http://www.w3.org/2000/svg', 'rect');

It is clear that there is different code for both methods. Would it perhaps be
more efficient to get the createSVGRect method etc to use the createElementNS
method code in some way? That would kill this bug at the same time. Of course I
could be talking rubbish as I don't know the implementation details.
Attached file Demonstration
svg::createSVGRect creates an instance of SVGRect
(http://www.croczilla.com/~alex/reference/SVG/specs1_0/types.html#InterfaceSVGRe
ct).

document::createElementNS("...", "rect") creates an instance of SVGRectElement 
(http://www.croczilla.com/~alex/reference/SVG/specs1_0/shapes.html#InterfaceSVGR
ectElement).

The two are different things. SVGRect doesn't contain a setAttribute method.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Oops, I used to know that. Stupid mistake! Sorry about that. 
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: