[webkit-dev] (no subject)

Mike Fischer mf_software at mac.com
Sat Nov 4 23:35:30 PST 2006


I am seeing a strange problem with transparent PNG files in the  
release version of Safari/WebKit on Max OS X 10.4.8 PPC:

I created a 1 pixel PNG image with color white and an alpha value of  
approx. 60%.

When I display this in an IMG tag (or as a CSS background image) over  
other content the other content does not appear lighter as expected  
but more gray (not really darker).

When I use a CANVAS element to draw a white fill color with 60% alpha  
the background is lightened as expected.

The current nightly build does not show this problem. By searching  
for bugs related to PNG on <http://bugs.webkit.org> I couldn't find  
anything relevant. Also Firefox, Opera 9.02 and OmniWeb  
5.5.1 show the expected color effect, i.e. lightening the background.

OTOH using a 1 pixel PNG with color black and an alpha of 50% works  
exactly as expected, i.e. darkening the background for a shadow effect.

My questions:

a) Was there a bug in WebKit causing this that got fixed for the  
current nightlies? Or is this some unintended side effect and I need  
to file a new bug to ensure that this stays fixed in the future?

b) Is there a workaround for the released version of WebKit (419.3)?  
(Other than using a CANVAS element ;-)

A test page demonstrating the effect is here (the top transparent  
area shows the problem):
Note that the testing area is built using JavaScript DOM methods in  
this example. It essentially builds three layers: At the bottom some  
text is created. Then (DIV id:"bgc1" z.index:1) some color areas are  
created and in the top layer (DIV id:"bgc2" z-index:2) the  
transparent testing areas are created.

Mike Fischer         Softwareentwicklung, EDV-Beratung
                                     Schulung, Vertrieb
Web: <http://homepage.mac.com/mike_fischer/index.html>

More information about the webkit-dev mailing list