The URL http://18.104.22.168/chrome/test1.html gives a small demo of the problem. I can hide the graph by setting the div visibility to "hidden" and the graph is still there after setting it visible again, but in this case it still occupies screen space which I don't want. So
I couldn't get the nightly build to run. The problem I'm reporting is present on Google Chrome on XP version 22.214.171.1244 (45376) and also on Chromium on Linux version 5.0.342.9 (43360) Ubuntu.
This is almost the same as bug 27775, but with SVG instead of a plug-in. But in this case, there is an easy workaround - there is no need to use <embed> to display SVG, it can be inserted directly into HTML content, or into an iframe.
Created attachment 56408 [details]
reduced test case
Yes, inlining the SVG into xhtml is a usable workround, thanks. Of course, that means serving different pages to different browsers (IE) which is a nuisance, but that's not Chromium's problem, and on the other hand it opens new possibilities for modern browsers.
Confirming on Chrome 6.0.472.63 and Safari 5.0.2, both on Win2003.
Steve, have you tried combining visibility:hidden with position:absolute as a workaround? That ought to prevent it messing up layout.
*** Bug 45389 has been marked as a duplicate of this bug. ***
"Steve, have you tried combining visibility:hidden with position:absolute as a workaround?"
No, I went for XHTML in the end. I realised that if I serve XHTML, then Firefox users could save the whole active page as a file for later reference (right-click, save page as...), which is a useful thing for them to be able to do.
It's a shame that doesn't work in Chromium too, but Chromium also saves the dynamic DOM content as static SVG so you get double-images when viewing the saved file.
The reduction can't work due to data: urls having unique origins (at least in Chrome):
attachment.cgi:8Uncaught TypeError: Cannot call method 'getElementById' of undefined