If you open an SVG file using the object element, and the element has a transparent background (no background color is specified for the SVG), WebKit/Safari paints the background white. I've tried to set the background to transparent in the SVG, in the object, nothing works.
I just saw another bug like this tonight, but they were using wmode="transparent" to get this behavior. I wonder if the same would work for you. (the wmode bug did not reproduce for me, I think they were using an SVG plugin, instead of WebKit's built-in SVG support).
The page has a background color, which was hidden with both Safari (including Webkit) and Opera, but not with Firefox 3. I put a background on the object itself to fix.
To demonstrate, I added the two SVG elements as objects, removed any background color and the following snapshot shows what the page looks like in Webkit:
<a href="http://skitch.com/shelleyp/jxta/burningbird"><img src="http://img.skitch.com/20080414-t1u3fmn1kspnhr6befpanwppw3.preview.jpg" alt="Burningbird" /></a>
However, same page with Firefox:
<a href="http://skitch.com/shelleyp/jx1d/burningbird"><img src="http://img.skitch.com/20080414-c7792ac8j22nkxniajgkab5ey8.preview.jpg" alt="Burningbird" /></a>
What's interesting, though, is that I used wget to create a <a href="http://burningbird.net/svgerror/burningbird.net">snapshot of the page</a> to preserve the bug, but Safari/Webkit now picks up the background color. The only difference? One site is dynamic, the other is a static web page.
I'll leave the front page up for a time so you can see the bug, but I can't preserve the web page indefinitely. Hopefully the images will be enough to show how to recreate the bug.
Correction, it works when the page is served up as HTML, not when the page is served up as XHTML. That's the difference.
(In reply to comment #3)
> Correction, it works when the page is served up as HTML, not when the page is
> served up as XHTML. That's the difference.
Now that I know the exact problem, I've created static sites to serve for confirmation of this bug. The first site, http://burningbird.net/svgerror/burningbird.net/, serves the page up as HTML and Safari/Webkit processes the background color properly. The second site, at http://burningbird.net/svgerror/xburningbird.net/, serves the page up as XHTML, and the background color is not coming through. That's the only difference between the two pages.
Confirm this problem exists under MacOS only, glaringly inconsistent with all other browsers including webkit under Windows, tested unaffected by mime type with which the page is served, problem exhibited by
This bug also occurs in the Linux 32-bit Ubuntu build of the chromium-browser, webkit build 531.
Created attachment 32775 [details]
Small test case
Attachment has a smaller test case. Shows a 100x100 green rectangle in Firefox 3.5 and Opera 10a, shows plain white in WebKit.
*** This bug has been marked as a duplicate of bug 10687 ***