[webkit-help] transparent body rendered in white --how to prevent?

Benbuck Nason bnason at netflix.com
Thu May 6 08:13:51 PDT 2010


Hi,

On 5/6/2010 6:45 AM, Òscar Vilaplana wrote:
> I'm using webkit to render a pdf from a html, and I want to get a
> transparent background so I can merge it with another pdf.
> 
> Setting the body background to transparent doesn't help, it still gets
> rendered in white.
> 
> I've been browsing the webkit source but I'm a bit lost. Could any of
> you direct me to where the elements are rendered, and maybe suggest what
> would have to be changed?

It probably depends on which port you are using. For example with Qt I
think you need to do something like this:

        QPalette palette = mWebView->palette();
        palette.setBrush(QPalette::Base, transparent);
        mWebView->page()->setPalette(palette);
        mWebView->setAttribute(WA_OpaquePaintEvent, false);
        mWebView->setAttribute(WA_NoSystemBackground, true);

-Benbuck


More information about the webkit-help mailing list