Bug 44180 - WebView::paint fails to paint a child WebView of a Layered Window
Summary: WebView::paint fails to paint a child WebView of a Layered Window
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Jessie Berlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 09:03 PDT by Jessie Berlin
Modified: 2010-08-18 11:18 PDT (History)
3 users (show)

See Also:


Attachments
Check if m_backingStoreBitmap is null instead of whether rcPaint is empty (1.75 KB, patch)
2010-08-18 10:14 PDT, Jessie Berlin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jessie Berlin 2010-08-18 09:03:41 PDT
Even though GetUpdateRect and GetUpdateRgn for a child WebView of a Layered Window report that the region that should be painted as non-empty in WebView::paint before the call to BeginPaint (http://msdn.microsoft.com/en-us/library/aa922023.aspx), BeginPaint still fills the rcPaint field of the PAINTSTRUCT with an empty RECT.

This means http://trac.webkit.org/changeset/58900 causes WebView::paint to end the paint early, before painting the contents of child WebView of a Layered Window.

A fix would be to check if the m_backingStoreBitmap is null after the call to ensureBackingStore (which will notice that the WebView isn't zero-sized in the case of the child WebView of a Layered Window that isn't zero-sized) instead of checking if the rcPaint rect is empty in order to determine whether to continue on with the paint or not.
Comment 1 Jessie Berlin 2010-08-18 10:14:39 PDT
Created attachment 64724 [details]
Check if m_backingStoreBitmap is null instead of whether rcPaint is empty
Comment 2 Adam Roben (:aroben) 2010-08-18 10:36:11 PDT
Comment on attachment 64724 [details]
Check if m_backingStoreBitmap is null instead of whether rcPaint is empty

> +    bool backingStoreCompletelyDirty = ensureBackingStore();
> +    if (!m_backingStoreBitmap) {
> +        EndPaint(m_viewWindow, &ps);
>          return;
>      }

We should only call EndPaint if a dc was passed to this function. Otherwise we won't have called BeginPaint.

r=me
Comment 3 Jessie Berlin 2010-08-18 11:13:14 PDT
(In reply to comment #2)
> (From update of attachment 64724 [details])
> > +    bool backingStoreCompletelyDirty = ensureBackingStore();
> > +    if (!m_backingStoreBitmap) {
> > +        EndPaint(m_viewWindow, &ps);
> >          return;
> >      }
> 
> We should only call EndPaint if a dc was passed to this function. Otherwise we won't have called BeginPaint.

Added in the check for whether there was a dc passed in.

> 
> r=me

Thanks!
Comment 4 Jessie Berlin 2010-08-18 11:18:30 PDT
Comment on attachment 64724 [details]
Check if m_backingStoreBitmap is null instead of whether rcPaint is empty

Committed in r65618

http://trac.webkit.org/changeset/65618