From:  T Rowley <>
Date:  22 Nov 2005 07:49:00 Hong Kong Time

Re: Background color for SVG


On 11/21/05 4:47 PM, Peter Weilbacher wrote:
> On Mon, 21 Nov 2005 19:53:13 UTC, Ian Hickson wrote:
>>On Mon, 21 Nov 2005, Peter Weilbacher wrote:
>>>I wonder if it is possible to access the background color at the place 
>>>of a SVG graphic in nsSVGCairoCanvas.cpp.
>>>The reason behind this is that due to the way the display APIs under 
>>>OS/2 work I need to "clear" the area that is going to be used for the 
>>>SVG display. Currently, I just fill it with white, but using the 
>>>background color of the  (or the browser default if none is set) 
>>>would be nicer.
>>Isn't the SVG supposed to overlay whatever is behind it? e.g. SVG on top 
>>of HTML would overlay that HTML?
> I don't know what it should do but if there are transparent parts in the
> SVG it displays with the default browser background (white in most 
> cases, light grey on my setup) on SeaMonkey (with cairo) under Linux. I 
> thought that was what it was supposed to do. Examples of this are
> and

nsSVGOuterSVGFrame tells gecko that it doesn't draw a background, so we 
end up just compositing atop what lies beneath us.  SVG 1.1 doesn't have 
an idea of a background color - that's a proposed 1.2 feature.

If the os/2 cairo backend doesn't properly implement 
_aquire_dest_surface, you might want to use the image backend (see the 
printing path on the branch, or the MOZ_ENABLE_{QUARTZ,WIN32}_SURFACE 
defines in nsSVGCairoCanvas.cpp on the trunk.