[webkit-dev] Notifying PageClient when page transition has begun

Brady Eidson beidson at apple.com
Thu Jul 25 10:34:57 PDT 2013


On Jul 25, 2013, at 10:10 AM, Thiago Lacerda <thiago.lacerda at openbossa.org> wrote:

> Hi Brady
> 
> 
> On Thu, Jul 25, 2013 at 1:48 PM, Brady Eidson <beidson at apple.com> wrote:
> 
> On Jul 25, 2013, at 9:08 AM, Thiago Lacerda <thiago.lacerda at openbossa.org> wrote:
> 
>> Hi,
>> 
>> We in the Nix port team (which is going upstream), are facing an issue that we need our WebView to know when the page transition has begun.
>> There was callback, in PageClient, that was making a similar job, called didCommitLoadForMainFrame, but it was removed recently.
> 
> If by “PageClient” you mean the WKPageLoaderClient in WKPage.h, then didCommitLoadForFrame is there.
> 
> I don’t even recall there ever being a didCommitLoadForMainFrame, but didCommitLoadForFrame combined with a quick call to WKPageGetMainFrame will do the exact same thing.
> 
> By PageClient I mean the one in Source/WebKit2/UIProcess/PageClient.h (which WebView inherits from) 

I see.  I misunderstood and thought you were talking about the API layer.

PageClient is largely a platform abstraction and not all platforms inherit a WebView from it.  And since it’s a platform abstraction, I can’t tell you how your platform should behave with it.

But that’s probably neither here-nor-there…

>> WebPage does have a callback that tells this (didStartPageTransition), but this is not forwarded to UIProcess, which is kind of weird, since its opposite (didCompletePageTransition) is fired to PageClient when a page has completed its transition.
> 
> didStartPageTransition is about starting a provisional load, and didCompletePageTransition is *not* about committing a provisional load.  Additionally, neither of these are actually sent to any API clients;  They are internal to WebPage.
> 
> If you think didCommitLoadForFrame() for the main frame was what you wanted, then both of these are irrelevant anyways.
> 
> didCompletePageTransition is forwarded to the C API client.
> In WebPage it calls WebPageProxy::pageTransitionViewportReady -> WebView(inheriting PageClient)::pageTransitionViewportReady -> WebViewClient::didCompletePageTransition


This is not true in general for the WK2 project.  Cross platform WK2 API is in terms of the WK* objects and their clients.  What you’re describing here is something very platform specific to your platform’s WebView implementation.

Anyways, in your original message, you mentioned that you wanted to know didCommitLoadForFrame for the main frame, and you intended to pipe didStartPageTransition through to the UIProcess to approximate that.

didStartPageTransition is more about tiled backing stores being set up properly and not about loading transitions.  It’s not remotely the same thing as didCommitLoadForFrame was called for the main frame.

Thanks,
~Brady
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130725/05b0f002/attachment.html>


More information about the webkit-dev mailing list