Bug 52009

Summary: WKView on Windows has no equivalent of Mac's -[WKView setDraws[Transparent]Background:]
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: WebKit2Assignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: adachan, andersca, sam
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Patch aroben: review+

Description Adam Roben (:aroben) 2011-01-06 12:38:03 PST
WKView on Mac has the following APIs:

-[WKView setDrawsBackground:]
-[WKView setDrawsTransparentBackground:]

These allow API clients to cause the WKView to be transparent or to have some other custom background. We have no equivalent of this on Windows (but don't need it, at the moment, either).
Comment 1 Adam Roben (:aroben) 2011-01-06 12:38:33 PST
<rdar://problem/8829746>
Comment 2 Anders Carlsson 2011-05-04 14:51:38 PDT
Created attachment 92319 [details]
Patch
Comment 3 Adam Roben (:aroben) 2011-05-04 15:06:52 PDT
Comment on attachment 92319 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=92319&action=review

> Source/WebKit2/UIProcess/win/WebView.cpp:642
> -static void drawPageBackground(HDC dc, const RECT& rect)
> +static void drawPageBackground(HDC dc, const WebPageProxy* page, const RECT& rect)
>  {
> -    // Mac checks WebPageProxy::drawsBackground and
> -    // WebPageProxy::drawsTransparentBackground here, but those are always false on
> -    // Windows currently (see <http://webkit.org/b/52009>).
> +    if (!page->drawsBackground() || page->drawsTransparentBackground())
> +        return;
> +
>      ::FillRect(dc, &rect, reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1));
>  }

Failing to paint parts of the HWND will lead to pixel smearing when Aero is disabled. That doesn't seem good!
Comment 4 Adam Roben (:aroben) 2011-05-04 15:17:13 PDT
Comment on attachment 92319 [details]
Patch

I guess this will perhaps someday be useful if we add a way to make a WS_EX_LAYERED WKView. Maybe we'll find other uses for it before then.
Comment 5 Anders Carlsson 2011-05-04 15:20:49 PDT
Committed r85794: <http://trac.webkit.org/changeset/85794>