Title: [247658] trunk/Source/WebKit
Revision
247658
Author
[email protected]
Date
2019-07-19 16:10:00 -0700 (Fri, 19 Jul 2019)

Log Message

Web Content process gets stuck suspended after navigating away from a system preview
https://bugs.webkit.org/show_bug.cgi?id=199965
<rdar://problem/53109004>

Reviewed by Dean Jackson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isBackground]):
* UIProcess/ios/WKSystemPreviewView.h:
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
(-[WKSystemPreviewView web_isBackground]):
Apply the fix from r193481 to WKSystemPreviewView as well, having it
become a WKApplicationStateTrackingView and plumbing that through
to our is-background machinery.

We really, really should instead have WKWebView itself be the application
state tracking view, but that is a bigger change (and has some implications
for full-screen video and whatnot).

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (247657 => 247658)


--- trunk/Source/WebKit/ChangeLog	2019-07-19 22:50:17 UTC (rev 247657)
+++ trunk/Source/WebKit/ChangeLog	2019-07-19 23:10:00 UTC (rev 247658)
@@ -1,3 +1,25 @@
+2019-07-19  Tim Horton  <[email protected]>
+
+        Web Content process gets stuck suspended after navigating away from a system preview
+        https://bugs.webkit.org/show_bug.cgi?id=199965
+        <rdar://problem/53109004>
+
+        Reviewed by Dean Jackson.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _isBackground]):
+        * UIProcess/ios/WKSystemPreviewView.h:
+        * UIProcess/ios/WKSystemPreviewView.mm:
+        (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
+        (-[WKSystemPreviewView web_isBackground]):
+        Apply the fix from r193481 to WKSystemPreviewView as well, having it
+        become a WKApplicationStateTrackingView and plumbing that through
+        to our is-background machinery.
+
+        We really, really should instead have WKWebView itself be the application
+        state tracking view, but that is a bigger change (and has some implications
+        for full-screen video and whatnot).
+
 2019-07-19  Dean Jackson  <[email protected]>
 
         Provide correct names for UIContextMenuInteraction API replacements

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (247657 => 247658)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-07-19 22:50:17 UTC (rev 247657)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-07-19 23:10:00 UTC (rev 247658)
@@ -1466,7 +1466,7 @@
 
 - (BOOL)_isBackground
 {
-    if ([self _isDisplayingPDF])
+    if (![self usesStandardContentView] && [_customContentView respondsToSelector:@selector(web_isBackground)])
         return [_customContentView web_isBackground];
     return [_contentView isBackground];
 }

Modified: trunk/Source/WebKit/UIProcess/ios/WKSystemPreviewView.h (247657 => 247658)


--- trunk/Source/WebKit/UIProcess/ios/WKSystemPreviewView.h	2019-07-19 22:50:17 UTC (rev 247657)
+++ trunk/Source/WebKit/UIProcess/ios/WKSystemPreviewView.h	2019-07-19 23:10:00 UTC (rev 247658)
@@ -25,12 +25,13 @@
 
 #if USE(SYSTEM_PREVIEW)
 
+#import "WKApplicationStateTrackingView.h"
 #import "WKWebViewContentProvider.h"
 #import <QuickLook/QuickLook.h>
 #import <UIKit/UIKit.h>
 #import <pal/spi/ios/QuickLookSPI.h>
 
-@interface WKSystemPreviewView : UIView <WKWebViewContentProvider, QLPreviewItemDataProvider>
+@interface WKSystemPreviewView : WKApplicationStateTrackingView <WKWebViewContentProvider, QLPreviewItemDataProvider>
 
 @end
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm (247657 => 247658)


--- trunk/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm	2019-07-19 22:50:17 UTC (rev 247657)
+++ trunk/Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm	2019-07-19 23:10:00 UTC (rev 247658)
@@ -69,7 +69,7 @@
 
 - (instancetype)web_initWithFrame:(CGRect)frame webView:(WKWebView *)webView mimeType:(NSString *)mimeType
 {
-    if (!(self = [super initWithFrame:frame]))
+    if (!(self = [super initWithFrame:frame webView:webView]))
         return nil;
 
     UIColor *backgroundColor = [UIColor colorWithRed:(38. / 255) green:(38. / 255) blue:(38. / 255) alpha:1];
@@ -170,6 +170,11 @@
 {
 }
 
+- (BOOL)web_isBackground
+{
+    return self.isBackground;
+}
+
 #pragma mark Find-in-Page
 
 - (void)web_countStringMatches:(NSString *)string options:(_WKFindOptions)options maxCount:(NSUInteger)maxCount
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to