Bug 52009 - WKView on Windows has no equivalent of Mac's -[WKView setDraws[Transparent]Background:]
Summary: WKView on Windows has no equivalent of Mac's -[WKView setDraws[Transparent]Ba...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks:
 
Reported: 2011-01-06 12:38 PST by Adam Roben (:aroben)
Modified: 2011-05-04 15:20 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.34 KB, patch)
2011-05-04 14:51 PDT, Anders Carlsson
aroben: review+
Details | Formatted Diff | Diff

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