New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 677805 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Feature



Sign in to add a comment

Rendering done WebStateObserver callback

Project Member Reported by olivierrobin@chromium.org, Jan 2 2017

Issue description

Some 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.
 
Description: Show this description
Some ideas:
- No DOM mutations during some delay after page is loaded

Cc: kkhorimoto@chromium.org noyau@chromium.org eugene...@chromium.org mard...@chromium.org olivierrobin@chromium.org
Labels: -Restrict-View-Google
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?
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.
Kurt, do you think it is even possible to implement DidFirstPaintAfterLoad on iOS?
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.
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.
Owner: eugene...@chromium.org
Status: Assigned (was: Untriaged)
Components: Mobile>WebView>Glue
Labels: -Pri-2 Pri-3
Owner: ----
Status: Available (was: Assigned)
Olivier, do you think filing radar would be useful here? 
Oliver, should we file radar for this callback?
Status: WontFix (was: Available)
Olivier, please reopen if you think we need a radar
Cc: pinkerton@chromium.org
+ 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.
I don't mind filling, it just seems unnecessary.
Probably worth filing a WebKit bug in addition to the radar.

Sign in to add a comment