[webkit-gtk] webkit2 missing webkit_web_view_set_transparent ?

Carlos Garcia Campos cgarcia at igalia.com
Mon Dec 29 01:32:29 PST 2014


El dom, 21-12-2014 a las 02:42 +0100, Jérémy Lal escribió:
> Hi,
> 
> webkit_web_view_set_transparent has disappeared from webkit2gtk's API.

Well, something that doesn't exist can't disappear :-)
webkit_web_view_set_transparent is in the WebKit1 API, but it's never
been in WebKit2 API, so it's not that it has been removed, but never
implemented.

> Is there another way to achieve the same effect ?

It should be very easy to expose that in the WebKit2 API. What's exactly
your use case? I didn't even know that function existed in WebKit1 :-P
and I find it a bit confusing, it sounds like you can make a web view
transparent, when it's actually referring to the background color. 

Looking at WebPageProxy I see at least 3 methods related to the
background and transparency:

  - WebPageProxy::setDrawsBackground(): This ends up calling
FrameView::setTransparent() for every frame. It seems that when this is
set to true the document or base background color is ignored.
webkit_web_view_set_transparent() in WebKit1 calls
FrameView::setTransparent() for the main frame only.

  - WebPageProxy::setDrawsTransparentBackground(): This calls
FrameView::setBaseBackgroundColor() for every frame. It sets the color
to Transparent when the called with true and White when called with
false. Surprisingly this is not what webkit_web_view_set_transparent()
does. Also, it seems that setDrawsBackground(false) is not exactly the
same as setDrawsTransparentBackground(true). When the frame view is set
transparent the background color is ignored and setCannotBlitToWindow()
is called, but when the background color is set to transparent, it's
used unless backgroundShouldExtendBeyondPage setting is true, in which
case the document background color is used.

  - WebPageProxy::setBackgroundExtendsBeyondPage: And this one sets the
backgroundShouldExtendBeyondPage setting.


Also, other ports have methods to set a background color for the backing
store. 

So, I find all this a bit messy. Exposing these methods in our API is
easy, but first we need to understand what all those methods do, and
what we want to expose and how.

> Regards,
> Jérémy.
> 
> 
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-gtk

-- 
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20141229/7c3125e5/attachment.sig>


More information about the webkit-gtk mailing list