Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion browser_patches/webkit/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1116
1117
48 changes: 21 additions & 27 deletions browser_patches/webkit/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -13089,10 +13089,10 @@ index 0000000000000000000000000000000000000000..41b5751cab626971cd12c5066218c6d1
+@end
diff --git a/Tools/Playwright/mac/AppDelegate.m b/Tools/Playwright/mac/AppDelegate.m
new file mode 100644
index 0000000000000000000000000000000000000000..84e0cd9c2d20111e936e4b16519d20bcd5aa37db
index 0000000000000000000000000000000000000000..828d172381e12ea0455045fdc098dfa7726ae040
--- /dev/null
+++ b/Tools/Playwright/mac/AppDelegate.m
@@ -0,0 +1,486 @@
@@ -0,0 +1,488 @@
+/*
+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
+ *
Expand Down Expand Up @@ -13453,7 +13453,7 @@ index 0000000000000000000000000000000000000000..84e0cd9c2d20111e936e4b16519d20bc
+ return [controller webView];
+}
+
+- (WKWebView *)createHeadlessWebView:(WKWebViewConfiguration *)configuration
+- (WKWebView *)createHeadlessWebView:(WKWebViewConfiguration *)configuration forPopup:(BOOL)popup
+{
+ NSRect rect = NSMakeRect(0, 0, 1024, 768);
+ NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0];
Expand All @@ -13467,9 +13467,11 @@ index 0000000000000000000000000000000000000000..84e0cd9c2d20111e936e4b16519d20bc
+
+ webView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
+ [window.contentView addSubview:webView];
+ NSURL *url = [NSURL _webkit_URLWithUserTypedString:_initialURL ? _initialURL : @"about:blank"];
+ _initialURL = nil;
+ [webView loadRequest:[NSURLRequest requestWithURL:url]];
+ if (!popup) {
+ NSURL *url = [NSURL _webkit_URLWithUserTypedString:_initialURL ? _initialURL : @"about:blank"];
+ _initialURL = nil;
+ [webView loadRequest:[NSURLRequest requestWithURL:url]];
+ }
+ [_headlessWindows addObject:window];
+ webView.UIDelegate = self;
+ return [webView autorelease];
Expand All @@ -13478,7 +13480,7 @@ index 0000000000000000000000000000000000000000..84e0cd9c2d20111e936e4b16519d20bc
+- (WKWebView *)createHeadlessPage:(uint64_t)sessionID
+{
+ WKWebViewConfiguration *configuration = [self sessionConfiguration:sessionID];
+ return [self createHeadlessWebView:configuration];
+ return [self createHeadlessWebView:configuration forPopup:NO];
+}
+
+- (_WKBrowserContext *)createBrowserContext
Expand Down Expand Up @@ -13575,7 +13577,7 @@ index 0000000000000000000000000000000000000000..84e0cd9c2d20111e936e4b16519d20bc
+
+- (nullable WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
+{
+ return [self createHeadlessWebView:configuration];
+ return [self createHeadlessWebView:configuration forPopup:YES];
+}
+
+@end
Expand Down Expand Up @@ -13792,10 +13794,10 @@ index 0000000000000000000000000000000000000000..4dbf13c8fb31a745ae8e1965a457d4fb
+@end
diff --git a/Tools/Playwright/mac/BrowserWindowController.m b/Tools/Playwright/mac/BrowserWindowController.m
new file mode 100644
index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881ddbc19bb45
index 0000000000000000000000000000000000000000..033c4fcda83002cda5d069205d4f605d02f1e1f5
--- /dev/null
+++ b/Tools/Playwright/mac/BrowserWindowController.m
@@ -0,0 +1,834 @@
@@ -0,0 +1,826 @@
+/*
+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
+ *
Expand Down Expand Up @@ -13946,8 +13948,6 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+
+- (void)awakeFromNib
+{
+ self.window.styleMask &= ~NSWindowStyleMaskFullSizeContentView;
+
+ _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:_configuration];
+ _webView._windowOcclusionDetectionEnabled = NO;
+
Expand Down Expand Up @@ -13994,13 +13994,14 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+ return nil;
+ _configuration = [configuration copy];
+ _isPrivateBrowsingWindow = !_configuration.websiteDataStore.isPersistent;
+ self.window.styleMask &= ~NSWindowStyleMaskFullSizeContentView;
+ return self;
+}
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+
+ [progressIndicator unbind:NSHiddenBinding];
+ [progressIndicator unbind:NSValueBinding];
+
Expand Down Expand Up @@ -14079,7 +14080,7 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+ return [self canZoomOut];
+ if (action == @selector(resetZoom:))
+ return [self canResetZoom];
+
+
+ if (action == @selector(toggleZoomMode:))
+ [menuItem setState:_zoomTextOnly ? NSControlStateValueOn : NSControlStateValueOff];
+ else if (action == @selector(showHideWebInspector:))
Expand Down Expand Up @@ -14258,7 +14259,6 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+- (nullable WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
+{
+ BrowserWindowController *controller = [[BrowserWindowController alloc] initWithConfiguration:configuration];
+ [controller awakeFromNib];
+ [controller.window makeKeyAndOrderFront:self];
+
+ return controller->_webView;
Expand Down Expand Up @@ -14286,7 +14286,7 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript confirm dialog from %@.", [frame.request.URL absoluteString]]];
+ [alert setInformativeText:message];
+
+
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+
Expand All @@ -14304,14 +14304,14 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript prompt dialog from %@.", [frame.request.URL absoluteString]]];
+ [alert setInformativeText:prompt];
+
+
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+
+
+ NSTextField* input = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 24)];
+ [input setStringValue:defaultText];
+ [alert setAccessoryView:input];
+
+
+ _alert = alert;
+ [alert beginSheetModalForWindow:self.window completionHandler:^void (NSModalResponse response) {
+ [input validateEditing];
Expand Down Expand Up @@ -14438,12 +14438,6 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+ decisionHandler(WKNavigationActionPolicyAllow);
+ return;
+ }
+
+ if (navigationAction._userInitiatedAction && !navigationAction._userInitiatedAction.isConsumed) {
+ [navigationAction._userInitiatedAction consume];
+ [[NSWorkspace sharedWorkspace] openURL:navigationAction.request.URL];
+ }
+
+ decisionHandler(WKNavigationActionPolicyCancel);
+}
+
Expand Down Expand Up @@ -14487,7 +14481,7 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+ NSView *container = [[[NSView alloc] initWithFrame:NSMakeRect(0, 0, 200, 48)] autorelease];
+ NSTextField *userInput = [[[NSTextField alloc] initWithFrame:NSMakeRect(0, 24, 200, 24)] autorelease];
+ NSTextField *passwordInput = [[[NSSecureTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 24)] autorelease];
+
+
+ [alert setMessageText:[NSString stringWithFormat:@"Log in to %@:%lu.", challenge.protectionSpace.host, challenge.protectionSpace.port]];
+ [alert addButtonWithTitle:@"Log in"];
+ [alert addButtonWithTitle:@"Cancel"];
Expand All @@ -14496,7 +14490,7 @@ index 0000000000000000000000000000000000000000..7a745879d076017df30afd77ded881dd
+ [alert setAccessoryView:container];
+ [userInput setNextKeyView:passwordInput];
+ [alert.window setInitialFirstResponder:userInput];
+
+
+ [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse response) {
+ [userInput validateEditing];
+ if (response == NSAlertFirstButtonReturn)
Expand Down