Diff
Modified: trunk/LayoutTests/ChangeLog (246126 => 246127)
--- trunk/LayoutTests/ChangeLog 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/LayoutTests/ChangeLog 2019-06-05 21:24:45 UTC (rev 246127)
@@ -1 +1,11 @@
+2019-06-05 Alex Christensen <[email protected]>
+
+ Re-enable safe browsing in WKWebView
+ https://bugs.webkit.org/show_bug.cgi?id=196161
+ <rdar://problem/49171413>
+
+ Reviewed by Ryosuke Niwa.
+
+ * platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
+
== Rolled over to ChangeLog-2019-06-05 ==
Modified: trunk/LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt (246126 => 246127)
--- trunk/LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt 2019-06-05 21:24:45 UTC (rev 246127)
@@ -10,6 +10,8 @@
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: trunk/Source/WebKit/ChangeLog (246126 => 246127)
--- trunk/Source/WebKit/ChangeLog 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/Source/WebKit/ChangeLog 2019-06-05 21:24:45 UTC (rev 246127)
@@ -1,5 +1,21 @@
2019-06-05 Alex Christensen <[email protected]>
+ Re-enable safe browsing in WKWebView
+ https://bugs.webkit.org/show_bug.cgi?id=196161
+ <rdar://problem/49171413>
+
+ Reviewed by Ryosuke Niwa.
+
+ This is mostly just reverting r241728.
+
+ * Shared/WebPreferences.yaml:
+ * UIProcess/API/Cocoa/WKPreferences.h:
+ * UIProcess/API/Cocoa/WKPreferences.mm:
+ (-[WKPreferences setSafeBrowsingEnabled:]):
+ (-[WKPreferences isSafeBrowsingEnabled]):
+
+2019-06-05 Alex Christensen <[email protected]>
+
Progress towards resurrecting Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=197132
Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (246126 => 246127)
--- trunk/Source/WebKit/Shared/WebPreferences.yaml 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml 2019-06-05 21:24:45 UTC (rev 246127)
@@ -82,7 +82,7 @@
SafeBrowsingEnabled:
type: bool
- defaultValue: false
+ defaultValue: true
webcoreBinding: none
PrivateBrowsingEnabled:
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h (246126 => 246127)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.h 2019-06-05 21:24:45 UTC (rev 246127)
@@ -51,6 +51,13 @@
*/
@property (nonatomic) BOOL _javascript_CanOpenWindowsAutomatically;
+/*! @abstract A Boolean value indicating whether warnings should be
+ shown for suspected fraudulent content such as phishing or malware.
+ @discussion The default value is YES. This feature is currently available
+ in the following region: China.
+ */
+@property (nonatomic, getter=isFraudulentWebsiteWarningEnabled) BOOL fraudulentWebsiteWarningEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
#if !TARGET_OS_IPHONE
/*!
@property tabFocusesLinks
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (246126 => 246127)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm 2019-06-05 21:24:45 UTC (rev 246127)
@@ -122,6 +122,16 @@
_preferences->setJavaScriptEnabled(_javascript_Enabled);
}
+- (void)setFraudulentWebsiteWarningEnabled:(BOOL)enabled
+{
+ _preferences->setSafeBrowsingEnabled(enabled);
+}
+
+- (BOOL)isFraudulentWebsiteWarningEnabled
+{
+ return _preferences->safeBrowsingEnabled();
+}
+
- (BOOL)_javascript_CanOpenWindowsAutomatically
{
return _preferences->_javascript_CanOpenWindowsAutomatically();
Modified: trunk/Tools/ChangeLog (246126 => 246127)
--- trunk/Tools/ChangeLog 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/Tools/ChangeLog 2019-06-05 21:24:45 UTC (rev 246127)
@@ -1 +1,14 @@
+2019-06-05 Alex Christensen <[email protected]>
+
+ Re-enable safe browsing in WKWebView
+ https://bugs.webkit.org/show_bug.cgi?id=196161
+ <rdar://problem/49171413>
+
+ Reviewed by Ryosuke Niwa.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+ * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+ (TEST):
+ (safeBrowsingView):
+
== Rolled over to ChangeLog-2019-06-05 ==
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (246126 => 246127)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm 2019-06-05 21:24:45 UTC (rev 246127)
@@ -606,7 +606,7 @@
auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:navigationDelegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
[webView loadRequest:request];
@@ -1696,7 +1696,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]];
[webView loadRequest:request];
@@ -2245,7 +2245,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
[webView loadRequest:request];
@@ -3046,7 +3046,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
failed = false;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]];
@@ -3074,7 +3074,7 @@
auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main1.html"]];
[webView loadRequest:request];
@@ -4453,7 +4453,7 @@
auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:navigationDelegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]];
TestWebKitAPI::Util::run(&done);
@@ -4511,7 +4511,7 @@
auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
[webView setNavigationDelegate:navigationDelegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]];
TestWebKitAPI::Util::run(&done);
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (246126 => 246127)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm 2019-06-05 21:11:39 UTC (rev 246126)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm 2019-06-05 21:24:45 UTC (rev 246127)
@@ -170,17 +170,17 @@
};
auto webView = adoptNS([WKWebView new]);
- EXPECT_FALSE([webView configuration].preferences._safeBrowsingEnabled);
- [webView configuration].preferences._safeBrowsingEnabled = YES;
+ EXPECT_TRUE([webView configuration].preferences.fraudulentWebsiteWarningEnabled);
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = YES;
[webView setNavigationDelegate:delegate.get()];
- [webView configuration].preferences._safeBrowsingEnabled = YES;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = YES;
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple")]];
while (![webView _safeBrowsingWarning])
TestWebKitAPI::Util::spinRunLoop();
- [webView configuration].preferences._safeBrowsingEnabled = NO;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = NO;
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple2")]];
TestWebKitAPI::Util::run(&done);
- EXPECT_FALSE([webView configuration].preferences._safeBrowsingEnabled);
+ EXPECT_FALSE([webView configuration].preferences.fraudulentWebsiteWarningEnabled);
EXPECT_FALSE([webView _safeBrowsingWarning]);
}
@@ -190,7 +190,7 @@
static auto delegate = adoptNS([SafeBrowsingNavigationDelegate new]);
auto webView = adoptNS([WKWebView new]);
- [webView configuration].preferences._safeBrowsingEnabled = YES;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = YES;
[webView setNavigationDelegate:delegate.get()];
[webView setUIDelegate:delegate.get()];
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple")]];
@@ -319,7 +319,7 @@
auto webViewWithWarning = [&] () -> RetainPtr<WKWebView> {
auto webView = adoptNS([WKWebView new]);
- [webView configuration].preferences._safeBrowsingEnabled = YES;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = YES;
[webView addObserver:observer.get() forKeyPath:@"URL" options:NSKeyValueObservingOptionNew context:nil];
[webView loadHTMLString:@"meaningful content to be drawn" baseURL:simpleURL.get()];
@@ -415,7 +415,7 @@
auto delegate = adoptNS([WKWebViewGoBackNavigationDelegate new]);
auto webView = adoptNS([WKWebView new]);
- [webView configuration].preferences._safeBrowsingEnabled = YES;
+ [webView configuration].preferences.fraudulentWebsiteWarningEnabled = YES;
[webView setNavigationDelegate:delegate.get()];
[webView loadRequest:[NSURLRequest requestWithURL:resourceURL(@"simple")]];
TestWebKitAPI::Util::run(&navigationFinished);