Diff
Modified: branches/safari-607-branch/LayoutTests/ChangeLog (241910 => 241911)
--- branches/safari-607-branch/LayoutTests/ChangeLog 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/LayoutTests/ChangeLog 2019-02-21 22:55:19 UTC (rev 241911)
@@ -1,5 +1,53 @@
2019-02-21 Alan Coon <[email protected]>
+ Cherry-pick r241728. rdar://problem/48243264
+
+ Disable safe browsing in WKWebView and remove its WKPreferences API
+ https://bugs.webkit.org/show_bug.cgi?id=194723
+ <rdar://problem/48122993>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/WebKit:
+
+ * Shared/WebPreferences.yaml:
+ * UIProcess/API/Cocoa/WKPreferences.h:
+ * UIProcess/API/Cocoa/WKPreferences.mm:
+ (-[WKPreferences setSafeBrowsingEnabled:]): Deleted.
+ (-[WKPreferences isSafeBrowsingEnabled]): Deleted.
+
+ Tools:
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+ (TEST):
+ (safeBrowsingView):
+ Make tests use SPI instead of API.
+
+ LayoutTests:
+
+ * platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
+ This test has results that depend on timing, and I need to update its results when I disable safe browsing.
+ I've done this several times before. See r237876 for an example.
+
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-18 Alex Christensen <[email protected]>
+
+ Disable safe browsing in WKWebView and remove its WKPreferences API
+ https://bugs.webkit.org/show_bug.cgi?id=194723
+ <rdar://problem/48122993>
+
+ Reviewed by Geoffrey Garen.
+
+ * platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
+ This test has results that depend on timing, and I need to update its results when I disable safe browsing.
+ I've done this several times before. See r237876 for an example.
+
+2019-02-21 Alan Coon <[email protected]>
+
Apply patch. rdar://problem/48229545
2019-02-21 Ryosuke Niwa <[email protected]>
Modified: branches/safari-607-branch/LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt (241910 => 241911)
--- branches/safari-607-branch/LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt 2019-02-21 22:55:19 UTC (rev 241911)
@@ -10,8 +10,6 @@
CONSOLE MESSAGE: line 55: Pasting text "d".
CONSOLE MESSAGE: line 58: Input element value after text input events: "".
CONSOLE MESSAGE: line 20: Pressing "z" with access key modifiers should navigate to resources/keyboard-events-after-navigation.html.
-CONSOLE MESSAGE: line 18: keydownevent dispatched (isTrusted: true).
-CONSOLE MESSAGE: line 18: keyupevent dispatched (isTrusted: true).
CONSOLE MESSAGE: line 6: Finished navigating to resources/keyboard-events-after-navigation.html.
CONSOLE MESSAGE: line 7: Trusted events should be logged and the input element should have the value "acd".
CONSOLE MESSAGE: line 34: Dispatching untrusted keypress event.
Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (241910 => 241911)
--- branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog 2019-02-21 22:55:19 UTC (rev 241911)
@@ -1,5 +1,55 @@
2019-02-21 Alan Coon <[email protected]>
+ Cherry-pick r241728. rdar://problem/48243264
+
+ Disable safe browsing in WKWebView and remove its WKPreferences API
+ https://bugs.webkit.org/show_bug.cgi?id=194723
+ <rdar://problem/48122993>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/WebKit:
+
+ * Shared/WebPreferences.yaml:
+ * UIProcess/API/Cocoa/WKPreferences.h:
+ * UIProcess/API/Cocoa/WKPreferences.mm:
+ (-[WKPreferences setSafeBrowsingEnabled:]): Deleted.
+ (-[WKPreferences isSafeBrowsingEnabled]): Deleted.
+
+ Tools:
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+ (TEST):
+ (safeBrowsingView):
+ Make tests use SPI instead of API.
+
+ LayoutTests:
+
+ * platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
+ This test has results that depend on timing, and I need to update its results when I disable safe browsing.
+ I've done this several times before. See r237876 for an example.
+
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-18 Alex Christensen <[email protected]>
+
+ Disable safe browsing in WKWebView and remove its WKPreferences API
+ https://bugs.webkit.org/show_bug.cgi?id=194723
+ <rdar://problem/48122993>
+
+ Reviewed by Geoffrey Garen.
+
+ * Shared/WebPreferences.yaml:
+ * UIProcess/API/Cocoa/WKPreferences.h:
+ * UIProcess/API/Cocoa/WKPreferences.mm:
+ (-[WKPreferences setSafeBrowsingEnabled:]): Deleted.
+ (-[WKPreferences isSafeBrowsingEnabled]): Deleted.
+
+2019-02-21 Alan Coon <[email protected]>
+
Cherry-pick r241618. rdar://problem/48243264
Add SPI version of WKPreferences.safeBrowsingEnabled
Modified: branches/safari-607-branch/Source/WebKit/Shared/WebPreferences.yaml (241910 => 241911)
--- branches/safari-607-branch/Source/WebKit/Shared/WebPreferences.yaml 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Source/WebKit/Shared/WebPreferences.yaml 2019-02-21 22:55:19 UTC (rev 241911)
@@ -68,7 +68,7 @@
SafeBrowsingEnabled:
type: bool
- defaultValue: true
+ defaultValue: false
webcoreBinding: none
PrivateBrowsingEnabled:
Modified: branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h (241910 => 241911)
--- branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h 2019-02-21 22:55:19 UTC (rev 241911)
@@ -53,12 +53,6 @@
*/
@property (nonatomic) BOOL _javascript_CanOpenWindowsAutomatically;
-/*! @abstract A Boolean value indicating whether warnings should be
- shown for suspected unsafe content such as phishing or malware.
- @discussion The default value is YES.
- */
-@property (nonatomic, getter=isSafeBrowsingEnabled) BOOL safeBrowsingEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
-
#if !TARGET_OS_IPHONE
/*! @abstract A Boolean value indicating whether Java is enabled.
@discussion The default value is NO.
Modified: branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (241910 => 241911)
--- branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm 2019-02-21 22:55:19 UTC (rev 241911)
@@ -140,16 +140,6 @@
_preferences->setStorageAccessPromptsEnabled(enabled);
}
-- (void)setSafeBrowsingEnabled:(BOOL)enabled
-{
- _preferences->setSafeBrowsingEnabled(enabled);
-}
-
-- (BOOL)isSafeBrowsingEnabled
-{
- return _preferences->safeBrowsingEnabled();
-}
-
#pragma mark OS X-specific methods
#if PLATFORM(MAC)
Modified: branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h (241910 => 241911)
--- branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h 2019-02-21 22:55:19 UTC (rev 241911)
@@ -1,3 +1,4 @@
+
/*
* Copyright (C) 2014-2016 Apple Inc. All rights reserved.
*
Modified: branches/safari-607-branch/Tools/ChangeLog (241910 => 241911)
--- branches/safari-607-branch/Tools/ChangeLog 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Tools/ChangeLog 2019-02-21 22:55:19 UTC (rev 241911)
@@ -1,5 +1,55 @@
2019-02-21 Alan Coon <[email protected]>
+ Cherry-pick r241728. rdar://problem/48243264
+
+ Disable safe browsing in WKWebView and remove its WKPreferences API
+ https://bugs.webkit.org/show_bug.cgi?id=194723
+ <rdar://problem/48122993>
+
+ Reviewed by Geoffrey Garen.
+
+ Source/WebKit:
+
+ * Shared/WebPreferences.yaml:
+ * UIProcess/API/Cocoa/WKPreferences.h:
+ * UIProcess/API/Cocoa/WKPreferences.mm:
+ (-[WKPreferences setSafeBrowsingEnabled:]): Deleted.
+ (-[WKPreferences isSafeBrowsingEnabled]): Deleted.
+
+ Tools:
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+ (TEST):
+ (safeBrowsingView):
+ Make tests use SPI instead of API.
+
+ LayoutTests:
+
+ * platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
+ This test has results that depend on timing, and I need to update its results when I disable safe browsing.
+ I've done this several times before. See r237876 for an example.
+
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-02-18 Alex Christensen <[email protected]>
+
+ Disable safe browsing in WKWebView and remove its WKPreferences API
+ https://bugs.webkit.org/show_bug.cgi?id=194723
+ <rdar://problem/48122993>
+
+ Reviewed by Geoffrey Garen.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+ (TEST):
+ (safeBrowsingView):
+ Make tests use SPI instead of API.
+
+2019-02-21 Alan Coon <[email protected]>
+
Cherry-pick r241845. rdar://problem/48267029
Regression(PSON) "Reload without content extensions" does not work when the main resource is blocked
Modified: branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (241910 => 241911)
--- branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-02-21 22:55:19 UTC (rev 241911)
@@ -537,7 +537,7 @@
auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:navigationDelegate.get()];
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
[webView loadRequest:request];
@@ -1627,7 +1627,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]];
[webView loadRequest:request];
@@ -2176,7 +2176,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
[webView loadRequest:request];
@@ -2839,7 +2839,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
failed = false;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]];
@@ -2867,7 +2867,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
[webView loadRequest:request];
@@ -3842,7 +3842,7 @@
auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:navigationDelegate.get()];
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]];
TestWebKitAPI::Util::run(&done);
@@ -3900,7 +3900,7 @@
auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:navigationDelegate.get()];
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]];
TestWebKitAPI::Util::run(&done);
Modified: branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (241910 => 241911)
--- branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm 2019-02-21 22:55:15 UTC (rev 241910)
+++ branches/safari-607-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm 2019-02-21 22:55:19 UTC (rev 241911)
@@ -32,6 +32,7 @@
#import "TestNavigationDelegate.h"
#import "TestWKWebView.h"
#import <WebKit/WKNavigationDelegate.h>
+#import <WebKit/WKPreferencesPrivate.h>
#import <WebKit/WKUIDelegatePrivate.h>
#import <WebKit/WKWebViewPrivate.h>
#import <wtf/RetainPtr.h>
@@ -169,15 +170,17 @@
};
auto webView = adoptNS([WKWebView new]);
+ [webView configuration].preferences._safeBrowsingEnabled = YES;
[webView setNavigationDelegate:delegate.get()];
- EXPECT_TRUE([webView configuration].preferences.safeBrowsingEnabled);
+ EXPECT_FALSE([webView configuration].preferences._safeBrowsingEnabled);
+ [webView configuration].preferences._safeBrowsingEnabled = YES;
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple")]];
while (![webView _safeBrowsingWarning])
TestWebKitAPI::Util::spinRunLoop();
- [webView configuration].preferences.safeBrowsingEnabled = NO;
+ [webView configuration].preferences._safeBrowsingEnabled = NO;
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple2")]];
TestWebKitAPI::Util::run(&done);
- EXPECT_FALSE([webView configuration].preferences.safeBrowsingEnabled);
+ EXPECT_FALSE([webView configuration].preferences._safeBrowsingEnabled);
EXPECT_FALSE([webView _safeBrowsingWarning]);
}
@@ -187,6 +190,7 @@
static auto delegate = adoptNS([SafeBrowsingNavigationDelegate new]);
auto webView = adoptNS([WKWebView new]);
+ [webView configuration].preferences._safeBrowsingEnabled = YES;
[webView setNavigationDelegate:delegate.get()];
[webView setUIDelegate:delegate.get()];
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple")]];
@@ -312,6 +316,7 @@
auto webViewWithWarning = [&] () -> RetainPtr<WKWebView> {
auto webView = adoptNS([WKWebView new]);
+ [webView configuration].preferences._safeBrowsingEnabled = YES;
[webView addObserver:observer.get() forKeyPath:@"URL" options:NSKeyValueObservingOptionNew context:nil];
[webView loadHTMLString:@"meaningful content to be drawn" baseURL:simpleURL.get()];
@@ -404,6 +409,7 @@
auto delegate = adoptNS([WKWebViewGoBackNavigationDelegate new]);
auto webView = adoptNS([WKWebView new]);
+ [webView configuration].preferences._safeBrowsingEnabled = YES;
[webView setNavigationDelegate:delegate.get()];
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple")]];
TestWebKitAPI::Util::run(&navigationFinished);