Bug 112454 - RenderBox::backgroundIsKnownToBeOpaqueInRect is wrong for <body> element under certain conditions
Summary: RenderBox::backgroundIsKnownToBeOpaqueInRect is wrong for <body> element unde...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alok Priyadarshi
URL:
Keywords:
Depends on:
Blocks: 70634
  Show dependency treegraph
 
Reported: 2013-03-15 10:32 PDT by Alok Priyadarshi
Modified: 2013-03-22 10:15 PDT (History)
4 users (show)

See Also:


Attachments
Test case (354 bytes, text/html)
2013-03-15 10:32 PDT, Alok Priyadarshi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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