RESOLVED FIXED 151886
Background state not being tracked correctly for PDFs on iOS
https://bugs.webkit.org/show_bug.cgi?id=151886
Summary Background state not being tracked correctly for PDFs on iOS
Gavin Barraclough
Reported 2015-12-04 14:41:15 PST
The problem here is that when viewing a PDF we don't have an ApplicationStateTracker. (While we do have a content view - which normally holds the ApplicationStateTracker - the content view is not in a window, and only has an ApplicationStateTracker while in a window). For now, let's give the WKPDFView an ApplicationStateTracker of its very own. In the future we may want to refactor ownership of the ApplicationStateTracker up to the WKWebView.
Attachments
Fix (8.35 KB, patch)
2015-12-04 14:46 PST, Gavin Barraclough
andersca: review+
Gavin Barraclough
Comment 1 2015-12-04 14:46:33 PST
Anders Carlsson
Comment 2 2015-12-04 14:53:14 PST
Comment on attachment 266663 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=266663&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:756 > + return ((WKPDFView *)_customContentView.get()).isBackground; For RetainPtr we don't use property syntax because it looks bad. This can just be [_customContentView isBackground]; I' also assert that [_customContentView isKindOfClass:[WKPDFView class]] here. > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:758 > + return (_contentView.get()).isBackground; Same comment about property syntax.
Gavin Barraclough
Comment 3 2015-12-04 15:08:41 PST
> I'd also assert that [_customContentView isKindOfClass:[WKPDFView class]] here. I'm already checking _isDisplayingPDF, which does exactly that (and other methods checking via _isDisplayingPDF then cast without an additional ASSERT). Guessing you missed the _isDisplayingPDF check, & thought I was just checking _customContentView - as such going to leave as is for now, but let me know you strongly disagree. Have made the other requested property syntax change.
Gavin Barraclough
Comment 4 2015-12-04 15:10:05 PST
Committed revision 193481.
Note You need to log in before you can comment on or make changes to this bug.