var p = this; while(p && !(p instanceof dojox.gfx.Surface)){ p = p.parent; } node.style.width = p.width; node.style.height = p.height; node.coordsize = p.width + " " + p.height;