Title: [221927] branches/safari-604.2-branch

Diff

Modified: branches/safari-604.2-branch/Source/WebKit/ChangeLog (221926 => 221927)


--- branches/safari-604.2-branch/Source/WebKit/ChangeLog	2017-09-12 17:04:31 UTC (rev 221926)
+++ branches/safari-604.2-branch/Source/WebKit/ChangeLog	2017-09-12 17:10:25 UTC (rev 221927)
@@ -1,3 +1,22 @@
+2017-09-12  Jason Marcell  <[email protected]>
+
+        Cherry-pick r221906. rdar://problem/34390823
+
+    2017-09-11  Tim Horton  <[email protected]>
+
+            REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes
+            https://bugs.webkit.org/show_bug.cgi?id=176767
+            <rdar://problem/34196874>
+
+            Reviewed by Dan Bernstein.
+
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _processDidExit]):
+            Reset the "last sent" layout parameters when the Web Content process exits.
+            They're no longer "last sent", and if we short-circuit from sending them
+            again (from under _didRelaunchProcess), we will never send the correct
+            layout width (until it changes).
+
 2017-09-05  Matthew Hanson  <[email protected]>
 
         Cherry-pick r221444. rdar://problem/34215746

Modified: branches/safari-604.2-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (221926 => 221927)


--- branches/safari-604.2-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2017-09-12 17:04:31 UTC (rev 221926)
+++ branches/safari-604.2-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2017-09-12 17:10:25 UTC (rev 221927)
@@ -1458,6 +1458,9 @@
     _scrollViewBackgroundColor = WebCore::Color();
     _delayUpdateVisibleContentRects = NO;
     _hadDelayedUpdateVisibleContentRects = NO;
+    _lastSentMinimumLayoutSize = std::nullopt;
+    _lastSentMaximumUnobscuredSize = std::nullopt;
+    _lastSentDeviceOrientation = std::nullopt;
 
     _frozenVisibleContentRect = std::nullopt;
     _frozenUnobscuredContentRect = std::nullopt;

Modified: branches/safari-604.2-branch/Tools/ChangeLog (221926 => 221927)


--- branches/safari-604.2-branch/Tools/ChangeLog	2017-09-12 17:04:31 UTC (rev 221926)
+++ branches/safari-604.2-branch/Tools/ChangeLog	2017-09-12 17:10:25 UTC (rev 221927)
@@ -1,3 +1,20 @@
+2017-09-12  Jason Marcell  <[email protected]>
+
+        Cherry-pick r221906. rdar://problem/34390823
+
+    2017-09-11  Tim Horton  <[email protected]>
+
+            REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes
+            https://bugs.webkit.org/show_bug.cgi?id=176767
+            <rdar://problem/34196874>
+
+            Reviewed by Dan Bernstein.
+
+            * TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
+            (TEST):
+            Add a test ensuring that override layout size persists through Web
+            Content process crash.
+
 2017-09-05  Matthew Hanson  <[email protected]>
 
         Cherry-pick r221444. rdar://problem/34215746

Modified: branches/safari-604.2-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm (221926 => 221927)


--- branches/safari-604.2-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm	2017-09-12 17:04:31 UTC (rev 221926)
+++ branches/safari-604.2-branch/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm	2017-09-12 17:10:25 UTC (rev 221927)
@@ -63,14 +63,14 @@
 
 static RetainPtr<AnimatedResizeWebView> createAnimatedResizeWebView()
 {
-    RetainPtr<_WKProcessPoolConfiguration> processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
+    auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
     [processPoolConfiguration setIgnoreSynchronousMessagingTimeoutsForTesting:YES];
-    RetainPtr<WKProcessPool> processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
+    auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
 
-    RetainPtr<WKWebViewConfiguration> webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
     [webViewConfiguration setProcessPool:processPool.get()];
 
-    RetainPtr<AnimatedResizeWebView> webView = adoptNS([[AnimatedResizeWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
+    auto webView = adoptNS([[AnimatedResizeWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
 
     return webView;
 }
@@ -92,7 +92,7 @@
 
     auto navigationDelegate = createFirstVisuallyNonEmptyWatchingNavigationDelegate();
     [webView setNavigationDelegate:navigationDelegate.get()];
-    RetainPtr<UIWindow> window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
+    auto window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
     [window addSubview:webView.get()];
     [window setHidden:NO];
 
@@ -116,7 +116,7 @@
 
     auto navigationDelegate = createFirstVisuallyNonEmptyWatchingNavigationDelegate();
     [webView setNavigationDelegate:navigationDelegate.get()];
-    RetainPtr<UIWindow> window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
+    auto window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
     [window addSubview:webView.get()];
     [window setHidden:NO];
 
@@ -181,7 +181,7 @@
     [webView loadHTMLString:@"<head></head>" baseURL:nil];
     [webView _test_waitForDidFinishNavigation];
 
-    RetainPtr<UIWindow> window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
+    auto window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
     [window addSubview:webView.get()];
     [window setHidden:NO];
 
@@ -191,7 +191,7 @@
 
     // Load a page that will change the state of viewport-fit,
     // in the middle of the resize.
-    [webView loadHTMLString:@"<head><meta name='viewport' content='viewport-fit=cover' /></head>" baseURL:nil];
+    [webView loadHTMLString:@"<head><meta name='viewport' content='viewport-fit=cover'></head>" baseURL:nil];
     [webView _test_waitForDidFinishNavigation];
 
     didChangeSafeAreaShouldAffectObscuredInsets = false;
@@ -218,4 +218,35 @@
     EXPECT_TRUE(didChangeSafeAreaShouldAffectObscuredInsets);
 }
 
+TEST(WebKit, OverrideLayoutSizeIsRestoredAfterProcessRelaunch)
+{
+    auto webView = createAnimatedResizeWebView();
+    [webView setUIDelegate:webView.get()];
+
+    [webView _overrideLayoutParametersWithMinimumLayoutSize:CGSizeMake(200, 50) maximumUnobscuredSizeOverride:CGSizeMake(200, 50)];
+
+    [webView loadHTMLString:@"<head><meta name='viewport' content='initial-scale=1'></head>" baseURL:nil];
+    [webView _test_waitForDidFinishNavigation];
+
+    auto window = adoptNS([[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
+    [window addSubview:webView.get()];
+    [window setHidden:NO];
+
+    [webView _killWebContentProcessAndResetState];
+    [webView loadHTMLString:@"<head><meta name='viewport' content='initial-scale=1'></head>" baseURL:nil];
+    [webView _test_waitForDidFinishNavigation];
+
+    __block bool didReadLayoutSize = false;
+    [webView evaluateJavaScript:@"[window.innerWidth, window.innerHeight]" completionHandler:^(id value, NSError *error) {
+        CGFloat innerWidth = [[value objectAtIndex:0] floatValue];
+        CGFloat innerHeight = [[value objectAtIndex:1] floatValue];
+
+        EXPECT_EQ(innerWidth, 200);
+        EXPECT_EQ(innerHeight, 50);
+
+        didReadLayoutSize = true;
+    }];
+    TestWebKitAPI::Util::run(&didReadLayoutSize);
+}
+
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to