<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 25, 2013, at 11:28 AM, Thiago Lacerda <<a href="mailto:thiago.lacerda@openbossa.org">thiago.lacerda@openbossa.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Thu, Jul 25, 2013 at 2:34 PM, Brady Eidson<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:beidson@apple.com" target="_blank">beidson@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;"><br><div><div class="im"><div>On Jul 25, 2013, at 10:10 AM, Thiago Lacerda <<a href="mailto:thiago.lacerda@openbossa.org" target="_blank">thiago.lacerda@openbossa.org</a>> wrote:</div><br><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr">Hi Brady<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 25, 2013 at 1:48 PM, Brady Eidson<span> </span><span dir="ltr"><<a href="mailto:beidson@apple.com" target="_blank">beidson@apple.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;"><br><div><div><div>On Jul 25, 2013, at 9:08 AM, Thiago Lacerda <<a href="mailto:thiago.lacerda@openbossa.org" target="_blank">thiago.lacerda@openbossa.org</a>> wrote:</div><br><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr">Hi,<div><br></div></div></div></blockquote><blockquote type="cite"><div dir="ltr">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.</div></blockquote><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr">There was callback, in PageClient, that was making a similar job, called didCommitLoadForMainFrame, but it was removed recently.</div></div></blockquote><div><br></div></div><div>If by “PageClient” you mean the WKPageLoaderClient in WKPage.h, then didCommitLoadForFrame is there.</div><div><br></div><div>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.</div></div></div></blockquote><div><br></div><div>By PageClient I mean the one in Source/WebKit2/UIProcess/PageClient.h (which WebView inherits from) </div></div></div></div></div></blockquote><div><br></div></div>I see. I misunderstood and thought you were talking about the API layer.</div><div><br></div><div>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.</div><div><br></div><div>But that’s probably neither here-nor-there…</div><div><br></div><div><div class="im"><blockquote type="cite" dir="auto"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;"><div><div><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr">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.</div></div></blockquote><div><br></div></div>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.</div><div><br></div><div>If you think didCommitLoadForFrame() for the main frame was what you wanted, then both of these are irrelevant anyways.</div></div></blockquote><div><br></div><div>didCompletePageTransition is forwarded to the C API client.</div></div></div></div></div></blockquote><div><blockquote type="cite" dir="auto"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">In WebPage it calls WebPageProxy::pageTransitionViewportReady -> WebView(inheriting PageClient)::pageTransitionViewportReady -> WebViewClient::didCompletePageTransition</div></div></div></blockquote><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br></div></div></div></div></div><div><br></div></div><div>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.</div></div></div></blockquote><div><br></div><div>Please take a look at WKViewClient code, you will see that there is a didCompletePageTransition callback</div></div></blockquote><div><br></div></div><div>~: grep -r WKViewClient .</div><div>...</div><div>./UIProcess/API/C/<b>CoordinatedGraphics</b>/WKView.h:struct WKViewClient</div><div><div><br></div><div>That’s not cross platform API, so it’s not a surprise I hadn’t heard of it and that a search of the .xcodeproj didn’t find it.</div></div><div><br><blockquote type="cite" dir="auto"><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;"><div style="word-wrap: break-word;"><div>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.</div><div><br></div><div>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.</div></div></blockquote><div><br></div><div>Hum... maybe I have misunderstood the concepts here, by looking at the name (didPageStartTransition) I though it was totally related with page transitions.</div></div></blockquote><div><br></div>Look at the implementation and the fact that most related code is wrapped by "#if USE(TILED_BACKING_STORE)”</div><div><br></div><div>Also, you’re using the phrase “page transitions” which is not a loader concept, yet your original message was asking about a loader concept.</div><div><br><blockquote type="cite" dir="auto"><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div> Despite of that, I think we have an inconsistent API here, which tells when the transition is over but not when it has started. </div></div></blockquote><div><br></div><div>This is not general cross platform API, but also, the general cross platform API *DOES* have the concept of some callbacks being WebProcess-only while others go to both Web and UI processes. It’s not an inherent inconsistency.</div><div><br></div><div>There’s a reason to not do it, which is to not pay the IPC messaging cost.</div><div><br></div><blockquote type="cite" dir="auto"><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div>That is the main reason I think it would be good to put that callback in WKViewClient as well.</div></div></blockquote><div><br></div>Noting that you’ve been focusing more on what is and is not API instead of answering this point, I will bring this up one more time:</div><div><br></div><div>Are you interested in using didCommitLoadForFrame for the main frame, as you originally asked for?</div><div><br></div><div>If so, you already have what you need.</div><div><br></div><div>If you do understand what this specific call actually means and you actually need it in the UI Process, I would ask that the messaging be wrapped with "#if USE(TILED_BACKING_STORE)” so the non-main ports don’t pay the cost.</div><div><br></div><div><div>If you’re simply interested in adding new API because you think it makes things more consistent, even if it’s not what you need, then I would say that’s a terrible idea.</div><div><br></div></div><div>Thanks,</div><div>~Brady</div><div><br></div></body></html>