Bug 134779 - Support transparent WKWebViews
Summary: Support transparent WKWebViews
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-09 14:47 PDT by Anders Carlsson
Modified: 2014-07-10 20:13 PDT (History)
1 user (show)

See Also:


Attachments
Patch (6.19 KB, patch)
2014-07-09 14:50 PDT, Anders Carlsson
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2014-07-09 14:47:02 PDT
Support transparent WKWebViews
Comment 1 Anders Carlsson 2014-07-09 14:50:13 PDT
Created attachment 234659 [details]
Patch
Comment 2 Tim Horton 2014-07-09 15:00:57 PDT
Comment on attachment 234659 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Schedule rebuilding the compositing layers if a FrameView's transparency changes.

this definitely needs a "why" (though I vaguely remember from you showing me)

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1173
> +    BOOL oldOpaque = self.opaque;

s/old/was/g?

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1176
> +    [super setOpaque:opaque];
> +    [_contentView setOpaque:opaque];

why are these before the early return?
Comment 3 Anders Carlsson 2014-07-09 15:06:49 PDT
Committed r170935: <http://trac.webkit.org/changeset/170935>
Comment 4 Benjamin Poulain 2014-07-10 19:58:35 PDT
The background color is quite broken on load in Safari. This looks related.
Comment 5 Benjamin Poulain 2014-07-10 20:13:14 PDT
Comment on attachment 234659 [details]
Patch

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

I think we should revert, we should not create our own behaviors different from regular UIScrollView.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:665
> +    if (!webView.opaque)
> +        return WebCore::Color::transparent;

What?

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:672
> -        color = _page->pageExtendedBackgroundColor();
> +        color = webView->_page->pageExtendedBackgroundColor();

This is an invalid color until the first layer tree update!

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1171
> +- (void)setOpaque:(BOOL)opaque

Opaque is a rendering hint, it does not work like that.