RESOLVED FIXED10917
REGRESSION (r16027): iFrame transparency broken
https://bugs.webkit.org/show_bug.cgi?id=10917
Summary REGRESSION (r16027): iFrame transparency broken
Dan Cryer
Reported 2006-09-18 08:39:22 PDT
In the latest nightlies, iframe transparency has stopped working. The background displays as white, whereas other browsers display a transparent background. I made a redux that demonstrates it: http://www.veriea.com/webkit/ The above works correctly in Firefox and the stock Safari, but not in the latest nightlies. When loading the page, the iframe is initially rendered transparent, with its border, but then when the document within it loads, the white background appears. This doesn't happen with any background other than transparent, blue ( as you can see in the top iframe ) works fine.
Attachments
Patch fixes this (2.58 KB, patch)
2006-09-19 16:58 PDT, Timothy Hatcher
hyatt: review-
Patch taking into account Dave's comments (1.95 KB, patch)
2006-09-20 09:34 PDT, Timothy Hatcher
hyatt: review+
Layout test attempt (19.18 KB, image/png)
2006-09-20 09:36 PDT, Timothy Hatcher
no flags
mitz
Comment 1 2006-09-18 09:01:24 PDT
Looks like a regression from r16207 (Allow changing the background color WebCore draws under transparent page backgrounds).
Timothy Hatcher
Comment 2 2006-09-19 16:58:15 PDT
Created attachment 10655 [details] Patch fixes this - Don't paint the background color if we are told to do slow repaints. - Removed unneeded Color isValid() checks where we also check alpha() > 0. - Removed a check for alpha() > 0 before calling fillRect() since it also checks. * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBackgroundExtended):
Dave Hyatt
Comment 3 2006-09-19 18:36:10 PDT
Comment on attachment 10655 [details] Patch fixes this Slow repaints have nothing to do with background color painting. That's just whether or not to blit or not when scrolling...
Dave Hyatt
Comment 4 2006-09-19 19:01:29 PDT
- bool shouldPaintBackgroundColor = !bgLayer->next() && bgColor.isValid() && bgColor.alpha() > 0; + bool shouldPaintBackgroundColor = !bgLayer->next() && bgColor.alpha() > 0; I don't see the reason for this change. This only applies when printing, and it seems wrong to me to remove the isValid check from it.
Dave Hyatt
Comment 5 2006-09-19 19:06:50 PDT
I think to fix this you just need to adjust this line: if (isRoot() && (!bgColor.isValid() || bgColor.alpha() < 0xFF) && !view()->frameView()->isTransparent()) { To ask !isTransparent rather than !view()->frameView()->isTransparent(). To do that just pull the isTransparent boolean out of the previous if and init it to false. I don't believe anything else should change in the code, since dropping the isValid checks is incorrect.
Timothy Hatcher
Comment 6 2006-09-20 09:34:57 PDT
Created attachment 10668 [details] Patch taking into account Dave's comments Thanks Dave. I was under the impression that a color that has alpha > 0 was always valid. But that isn't the case it seems.
Timothy Hatcher
Comment 7 2006-09-20 09:36:50 PDT
Created attachment 10669 [details] Layout test attempt I was going to make a pixel layout test for this, and here is the expected result image I get... This file loads and looks fine in Safari (no white backgrounds). But DRT always paints the background of the iframes white. Any ideas? This happened with both versions of my patch.
Dave Hyatt
Comment 8 2006-09-20 17:47:49 PDT
Comment on attachment 10668 [details] Patch taking into account Dave's comments r=me
Timothy Hatcher
Comment 9 2006-09-20 20:45:30 PDT
Landed in r16491.
Note You need to log in before you can comment on or make changes to this bug.