Bug 112454

Summary: RenderBox::backgroundIsKnownToBeOpaqueInRect is wrong for <body> element under certain conditions
Product: WebKit Reporter: Alok Priyadarshi <alokp>
Component: Layout and RenderingAssignee: Alok Priyadarshi <alokp>
Status: RESOLVED FIXED    
Severity: Normal CC: jamesr, koivisto, simon.fraser, vangelis
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 70634    
Attachments:
Description Flags
Test case none

Description Alok Priyadarshi 2013-03-15 10:32:25 PDT
Created attachment 193334 [details]
Test case

RenderBox::backgroundIsKnownToBeOpaqueInRect looks at the CSS background to determine if the RenderBox is opaque. This works for all elements except the <body> element if:
1. The <body> element is composited
2. The <html> element does not have a background

In this case <body> background is not painted and you can see through any elements under the <body>.

In the attached example <body> border is painted over the underlying <div>, but the background is not. In this case <body> element is not opaque. As soon as you add a background to the <html> element, the body background gets painted and becomes opaque.
Comment 1 Antti Koivisto 2013-03-19 15:47:53 PDT
I don't see any regression with the test case. Are there some additional steps to reproduce?
Comment 2 Alok Priyadarshi 2013-03-19 16:52:02 PDT
(In reply to comment #1)
> I don't see any regression with the test case. Are there some additional steps to reproduce?

I did not find it straightforward to create a "repaint" test case. The attached html page is not really a test case, but rather an example where <body> render-box should not be considered opaque.

Please see the latest patch for https://bugs.webkit.org/show_bug.cgi?id=70634. In particular the function skipBodyBackground() and two test cases - body-background-painted and body-background-skipped. Without skipBodyBackground() logic, body-background-skipped will fail.
Comment 3 Alok Priyadarshi 2013-03-22 10:15:41 PDT
This was fixed in r146531.
http://trac.webkit.org/changeset/146531