Hello all,

This was my first post here, but it looks like it has never been
actually posted (sorry if I should not post it again).

I have a problem with the canvas svg element used by Raphael
(raphaeljs.org). I don't know a lot about the way Firefox lets us
embed svg elements inside html documents, so I was surprised to find
that Element.viewportOffset doesn't work on the <svg> element, or any
other Position methods, while event handlers and several other js
things work as usual.

Take a look at this test page for Firefox 3.5:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
<script type="text/javascript">
Event.observe(window,"load", function (e) {
       var canvas = document.createElementNS("http://www.w3.org/2000/
       canvas.setAttribute("width", "512px");
       canvas.setAttribute("height", "342px");
<body style="margin:0px">
<div id="container" style="padding:10px;margin:20px"><div id="test"></

"container" contains both the svg canvas and a "test" div, but only
"test" is supported by the viewportOffset method.

Why can't I get the offset of the canvas element? Is there a fix or a
workaround? What is special about the SVGSVGElement?

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to