Rendering done WebStateObserver callback |
|||||||
Issue descriptionSome features require to do some actions when the rendering of the page is done - snapshotting the page, - distill the page for Reading List. At the moment, the only event provided by WebStateObserver is PageLoaded. This does not allow to process pages that are built by Javascript after the load is complete. There should be a way to know that rendering is (likely) complete and processing can be done.
,
Jan 2 2017
Some ideas: - No DOM mutations during some delay after page is loaded
,
Jan 2 2017
,
Jan 3 2017
I don't think this is possible to implement reliably. Page painting can be requested asynchronously in JS, so implementing this callback correctly would not be possible even if we could use Blink on iOS. We should not have a callback which gives a lot of false positives in many cases. content has DidFirstPaintAfterLoad callback. I don't know if this is something that we could implement on iOS, but this is the best we can do in browser. Olivier, would DidFirstPaintAfterLoad be useful for you?
,
Jan 3 2017
I agree with Eugene; this is not possible in any sort of reliable way using the WKWebView interface. I spent some time trying to get this signal when I was implementing scroll/zoom restoration, but couldn't figure out a good enough heuristic. As a result, sometimes our scroll/zoom is restored too early, and the page continues to render and overwrites our restored values.
,
Jan 3 2017
Kurt, do you think it is even possible to implement DidFirstPaintAfterLoad on iOS?
,
Jan 4 2017
It looks like that message is getting sent by the renderer process in content, so it's not something we can exactly duplicate. One heuristic we could use would be to send notifications triggered by KVO callbacks for the WKWebView's scroll view content size, which is a rough estimate of when new objects have been rendered to the page. It will be pretty noisy though, and we wouldn't have any notion of whether the page has "finished" rendering.
,
Jan 4 2017
In KIF tests on device I've seen cases when scroll view was resized but the page was blank. Maybe even DidFirstPaintAfterLoad is not possible on iOS. However we can file a radar if Olivier needs this callback.
,
Jan 4 2017
,
Jan 4 2017
Olivier, do you think filing radar would be useful here?
,
Mar 15 2017
Oliver, should we file radar for this callback?
,
Apr 13 2017
Olivier, please reopen if you think we need a radar
,
Apr 14 2017
+ Pink Olivier is going to be OOO for a while now. So if this bug needs a radar to be filed, someone else needs to do it.
,
Apr 14 2017
I don't mind filling, it just seems unnecessary.
,
Apr 14 2017
Probably worth filing a WebKit bug in addition to the radar. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by olivierrobin@chromium.org
, Jan 2 2017