Bug 131860 - [iOS] REGRESSION (r167039): WebKit incorrectly sets a background process assertion state when displaying a PDF
Summary: [iOS] REGRESSION (r167039): WebKit incorrectly sets a background process asse...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords: InRadar
Depends on: 131453
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-18 15:14 PDT by Andy Estes
Modified: 2014-04-18 15:50 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.59 KB, patch)
2014-04-18 15:18 PDT, Andy Estes
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2014-04-18 15:14:15 PDT
[iOS] REGRESSION (r167039): WebKit incorrectly sets a background process assertion state when displaying a PDF
Comment 1 Andy Estes 2014-04-18 15:14:34 PDT
<rdar://problem/16631282>
Comment 2 Andy Estes 2014-04-18 15:18:08 PDT
Created attachment 229678 [details]
Patch
Comment 3 Tim Horton 2014-04-18 15:23:39 PDT
Comment on attachment 229678 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=229678&action=review

> Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm:130
> -    return [m_contentView window];
> +    return [m_webView window];

We also need to notify the view state that it needs to recompute when WKWebView goes into/out of window, just like WKContentView does:
WKWebView

- (void)didMoveToWindow
{
    _page->viewStateDidChange(ViewState::IsInWindow);
}
Comment 4 Tim Horton 2014-04-18 15:25:49 PDT
Comment on attachment 229678 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=229678&action=review

>> Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm:130
>> +    return [m_webView window];
> 
> We also need to notify the view state that it needs to recompute when WKWebView goes into/out of window, just like WKContentView does:
> WKWebView
> 
> - (void)didMoveToWindow
> {
>     _page->viewStateDidChange(ViewState::IsInWindow);
> }

And the reason is, we want to background e.g. the network process if you have a PDF currently loaded and then remove the WKWebView (so the WKContentView didMoveToWindow won't get called, and won't viewStateDidChange, so WKWebView has to do it). There's also no real reason to do it in WKContentView's didMoveToWindow, since it will only change on WKWebView's.
Comment 5 Andy Estes 2014-04-18 15:49:09 PDT
Committed r167512: <http://trac.webkit.org/changeset/167512>