Bug 146825
Summary: | Safari page goes blank after suspending and resuming with an alert open | ||
---|---|---|---|
Product: | WebKit | Reporter: | chenwenhong <wenpkpk> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ajuma, andersca, bfulgham, justincohen, mitz, sam, simon.fraser, thorton, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 8.0 |
chenwenhong
1、open a webpage in safari
2、trigger alert
3、press home button set safari app into background mode
4、click safari app icon to resume,the result is webpage is empty behind the alert view controller. recovered when dismiss the alert
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Justin
This is also happening with Chromium in WKWebView mode in iOS9.
Ali Juma
What's happening is that when Safari is resumed, the WebProcess is blocked on a sync IPC (see WebChromeClient::runJavaScriptAlert) waiting for the alert to be dismissed. In the UIProcess, the RemoteLayerTreeDrawingAreaProxy detaches the root layer after Safari goes into the background (see hideContentUntilPendingUpdate), so when Safari is resumed the UIProcess has no layer tree to draw from until the next composited layer flush. And the WebProcess is blocked until the alert is dismissed, so we can't flush until that happens.
Having a way to persist the snapshot that's taken when the app goes into the background (so that it continues to be displayed until the alert is dismissed) might be a way to fix this, but not sure if it's worth the complexity for this edge case.
Radar WebKit Bug Importer
<rdar://problem/46320427>
Tim Horton
(In reply to Ali Juma from comment #2)
> What's happening is that when Safari is resumed, the WebProcess is blocked
> on a sync IPC (see WebChromeClient::runJavaScriptAlert) waiting for the
> alert to be dismissed. In the UIProcess, the RemoteLayerTreeDrawingAreaProxy
> detaches the root layer after Safari goes into the background (see
> hideContentUntilPendingUpdate), so when Safari is resumed the UIProcess has
> no layer tree to draw from until the next composited layer flush. And the
> WebProcess is blocked until the alert is dismissed, so we can't flush until
> that happens.
>
> Having a way to persist the snapshot that's taken when the app goes into the
> background (so that it continues to be displayed until the alert is
> dismissed) might be a way to fix this, but not sure if it's worth the
> complexity for this edge case.
That snapshot is not of the page content, but the whole app (including the alert), so keeping it up would be problematic w.r.t. actually being able to dismiss the alert.
Really what you'd want is a snapshot of the page content that you could pop in in place of the layer tree before you've had a chance to get another commit in (including repainted tiles), but I think I agree that that's pretty expensive for a rare edge case.