|Summary:||SVG opened in object does not honor transparent background|
|Product:||WebKit||Reporter:||Shelley Powers <shelleyp>|
|Severity:||Normal||CC:||c.1, cam, jeffschiller|
|Version:||528+ (Nightly build)|
|OS:||OS X 10.4|
Description Shelley Powers 2008-03-10 07:11:31 PDT
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.
Comment 1 Eric Seidel (no email) 2008-04-13 22:56:57 PDT
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).
Comment 2 Shelley Powers 2008-04-14 07:15:08 PDT
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.
Comment 3 Shelley Powers 2008-04-14 07:20:08 PDT
Correction, it works when the page is served up as HTML, not when the page is served up as XHTML. That's the difference.
Comment 4 Shelley Powers 2008-04-14 07:29:04 PDT
(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.
Comment 5 CPK Smithies 2009-06-25 09:39:42 PDT
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 http://grainger-quartet.co.uk/
Comment 6 CPK Smithies 2009-06-25 20:28:31 PDT
This bug also occurs in the Linux 32-bit Ubuntu build of the chromium-browser, webkit build 531.
Comment 7 Cameron McCormack 2009-07-15 04:15:16 PDT
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.