From 74941340beea10c2a7be5564e6c393dae4765c8a Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 23 Jul 2020 16:16:31 -0700 Subject: [PATCH] browser(webkit): correctly report outerWidth/Height on Mac (#3131) --- browser_patches/webkit/BUILD_NUMBER | 4 ++-- browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m | 5 +++++ .../webkit/embedder/Playwright/mac/BrowserWindowController.m | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER index 115628598e..b25ae4a7f8 100644 --- a/browser_patches/webkit/BUILD_NUMBER +++ b/browser_patches/webkit/BUILD_NUMBER @@ -1,2 +1,2 @@ -1315 -Changed: lushnikov@chromium.org Thu Jul 23 09:56:07 PDT 2020 +1316 +Changed: yurys@chromium.org Thu Jul 23 16:12:30 PDT 2020 diff --git a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m index 53881d97fe..e9a16afaa6 100644 --- a/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m +++ b/browser_patches/webkit/embedder/Playwright/mac/AppDelegate.m @@ -368,6 +368,11 @@ const NSActivityOptions ActivityOptions = } } +- (void)_webView:(WKWebView *)webView getWindowFrameWithCompletionHandler:(void (^)(CGRect))completionHandler +{ + completionHandler([webView.window frame]); +} + - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler { WebViewDialog* dialog = [[WebViewDialog alloc] autorelease]; diff --git a/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m b/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m index 6c1177d85f..9ea7388a6e 100644 --- a/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m +++ b/browser_patches/webkit/embedder/Playwright/mac/BrowserWindowController.m @@ -421,6 +421,11 @@ static BOOL areEssentiallyEqual(double a, double b) [self.window close]; } +- (void)_webView:(WKWebView *)webView getWindowFrameWithCompletionHandler:(void (^)(CGRect))completionHandler +{ + completionHandler([self.window frame]); +} + #define DefaultMinimumZoomFactor (.5) #define DefaultMaximumZoomFactor (3.0) #define DefaultZoomFactorRatio (1.2)