Computing document.width.baseVal on an empty SVG document


I hit a small bug today where the spec isn't clear. What should width
return in the following case?

<svg xmlns="">

Gecko returns 1
Blink throw an exception
Trident returns the viewport's width

I think Trident's behavior is the most intuitive. If you add a <rect> to
the document with 100% width and height, the width will resolve to the
viewport's width.


Received on Wednesday, 14 August 2013 23:02:34 UTC