I cannot find a standard relating to this. However, XBM images are rendered as black on while. For compatibility with NCSA Mosaic where they were most used, they should actually be rendered using the current foreground and background colors. (I noticed this when trying to use them as a way to provided rounded corners in a CSS3 border using current colors.)
Reporter, could you please attach a test case, or link to it?
Test document: http://homepage.mac.com/gregharewood/tmp/examplebmp/simple.html Revised description: correct behavior, per netscape 4.7, is to show black on a transparent background. However, I found more variation than I remembered - see screenshot - so there is little point in changing Safari's handling.
Created attachment 8127 [details] xbm images in Mosaic, Netscape, IE 5 for Mac
Firefox also renders the test case with transparent backround, so I guess Safari should as well.
Created attachment 19156 [details] xbm image creation patch I tried to create a patch to make xpms rendered as they are rendered in Firefox
Comment on attachment 19156 [details] xbm image creation patch Looks good to me. For compatibility with 64-bit, instead of float it should be CGFloat. This is really a workaround for a Radar bug: <rdar://problem/3922468> browsers treat XBM images as black on transparent background, ImageIO decodes as black on white review- because this won't compile 64-bit.
Created attachment 19158 [details] xbm image creation patch Changed the patch to use CGFloat instead of float
Comment on attachment 19158 [details] xbm image creation patch Two remaining problems: 1) A tab character in the change log. 2) This needs a regression test. I think we could do one with <canvas>. I'm tempted to say r=me as-is, but (2) is a serious issue. I'll do review+ for now, but please look into creating a regression test.
Created attachment 19175 [details] xbm image creation patch Added a regression test and removed the tab
Comment on attachment 19175 [details] xbm image creation patch r=me Once our canvas has an operation for reading pixels, we should change this into a dumpAsText() test.
P5 is not used for WebKit bugs. [http://webkit.org/quality/bugpriorities.html]
Committed revision 30556. After landing this I realized that: 1) We should take advantage of getImageData to turn this into a text test rather than a pixel test. 2) We should move the test out of the canvas directory -- it's a test of image rendering not of the canvas. But I suppose neither of those is urgent.