Disable cross-origin-window-policy by default
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2018 16:53:39 +0000 (16:53 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2018 16:53:39 +0000 (16:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187509

Reviewed by Chris Dumez.

Source/WebCore:

Disabled the feature by default.

* page/Settings.yaml:

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCrossOriginWindowPolicyEnabled):
(WKPreferencesGetCrossOriginWindowPolicyEnabled):
* UIProcess/API/C/WKPreferencesRef.h:

Source/WebKitLegacy/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKitLegacy/win:

* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):

Tools:

Enable the feature for testing purposes. DumpRenderTree does this already in enableExperimentalFeatures.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233687 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.yaml
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRef.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebPreferences.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp

index 0fbfba4..4dcd574 100644 (file)
@@ -1,3 +1,14 @@
+2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Disable cross-origin-window-policy by default
+        https://bugs.webkit.org/show_bug.cgi?id=187509
+
+        Reviewed by Chris Dumez.
+
+        Disabled the feature by default.
+
+        * page/Settings.yaml:
+
 2018-07-10  Alejandro G. Castro  <alex@igalia.com>
 
         [GTK][WPE] The LibWebRTCProvider object in RealtimeMediaSourceCenterLibWebRTC is not needed anymore
index c1c41b3..d3e1d68 100644 (file)
@@ -745,7 +745,7 @@ clientCoordinatesRelativeToLayoutViewport:
   onChange: setNeedsRecalcStyleInAllFrames
 
 crossOriginWindowPolicySupportEnabled:
-  initial: true
+  initial: false
 
 accessibilityEventsEnabled:
   initial: true
index 457fd2e..fbd43b4 100644 (file)
@@ -1,3 +1,16 @@
+2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Disable cross-origin-window-policy by default
+        https://bugs.webkit.org/show_bug.cgi?id=187509
+
+        Reviewed by Chris Dumez.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetCrossOriginWindowPolicyEnabled):
+        (WKPreferencesGetCrossOriginWindowPolicyEnabled):
+        * UIProcess/API/C/WKPreferencesRef.h:
+
 2018-07-09  Tim Horton  <timothy_horton@apple.com>
 
         REGRESSION (r232416): Flickering when going back to Google search results on back swipe
index 9a57e74..0ec44f6 100644 (file)
@@ -1059,7 +1059,7 @@ ConstantPropertiesEnabled:
 
 CrossOriginWindowPolicySupportEnabled:
   type: bool
-  defaultValue: true
+  defaultValue: false
 
 SubresourceIntegrityEnabled:
   type: bool
index 69284fc..11ee25f 100644 (file)
@@ -1984,6 +1984,16 @@ bool WKPreferencesGetCrossOriginResourcePolicyEnabled(WKPreferencesRef preferenc
     return toImpl(preferencesRef)->crossOriginResourcePolicyEnabled();
 }
 
+void WKPreferencesSetCrossOriginWindowPolicyEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setCrossOriginWindowPolicySupportEnabled(enabled);
+}
+
+bool WKPreferencesGetCrossOriginWindowPolicyEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->crossOriginWindowPolicySupportEnabled();
+}
+
 void WKPreferencesSetRestrictedHTTPResponseAccess(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setRestrictedHTTPResponseAccess(flag);
index 1bb0984..d2ce2a1 100644 (file)
@@ -323,6 +323,10 @@ WK_EXPORT void WKPreferencesSetRestrictedHTTPResponseAccess(WKPreferencesRef pre
 WK_EXPORT bool WKPreferencesGetCrossOriginResourcePolicyEnabled(WKPreferencesRef preferencesRef);
 WK_EXPORT void WKPreferencesSetCrossOriginResourcePolicyEnabled(WKPreferencesRef preferencesRef, bool allow);
 
+// Defaults to false.
+WK_EXPORT bool WKPreferencesGetCrossOriginWindowPolicyEnabled(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetCrossOriginWindowPolicyEnabled(WKPreferencesRef preferencesRef, bool enabled);
+
 #ifdef __cplusplus
 }
 #endif
index 1c55a77..05cbc6b 100644 (file)
@@ -1,3 +1,13 @@
+2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Disable cross-origin-window-policy by default
+        https://bugs.webkit.org/show_bug.cgi?id=187509
+
+        Reviewed by Chris Dumez.
+
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+
 2018-07-09  Timothy Hatcher  <timothy@apple.com>
 
         Semantic colors don't update when accessibility Increase Contrast mode is enabled.
index f09a666..18e1a39 100644 (file)
@@ -634,7 +634,7 @@ public:
         [NSNumber numberWithBool:NO], WebKitWebGPUEnabledPreferenceKey,
 #endif
         [NSNumber numberWithBool:NO], WebKitCacheAPIEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitCrossOriginWindowPolicySupportEnabledPreferenceKey,
+        [NSNumber numberWithBool:NO], WebKitCrossOriginWindowPolicySupportEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitFetchAPIEnabledPreferenceKey,
 
 #if ENABLE(STREAMS_API)
index 4e46fb4..3ff42f3 100644 (file)
@@ -1,3 +1,13 @@
+2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Disable cross-origin-window-policy by default
+        https://bugs.webkit.org/show_bug.cgi?id=187509
+
+        Reviewed by Chris Dumez.
+
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+
 2018-06-23  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [WTF] Add user-defined literal for ASCIILiteral
index e3806fd..e100412 100644 (file)
@@ -249,7 +249,7 @@ void WebPreferences::initializeDefaultSettings()
     CFDictionaryAddValue(defaults, CFSTR(WebKitShouldDisplaySubtitlesPreferenceKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(WebKitShouldDisplayCaptionsPreferenceKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(WebKitShouldDisplayTextDescriptionsPreferenceKey), kCFBooleanFalse);
-    CFDictionaryAddValue(defaults, CFSTR(WebKitCrossOriginWindowPolicySupportEnabledPreferenceKey), kCFBooleanTrue);
+    CFDictionaryAddValue(defaults, CFSTR(WebKitCrossOriginWindowPolicySupportEnabledPreferenceKey), kCFBooleanFalse);
 
     RetainPtr<CFStringRef> linkBehaviorStringRef = adoptCF(CFStringCreateWithFormat(0, 0, CFSTR("%d"), WebKitEditableLinkDefaultBehavior));
     CFDictionaryAddValue(defaults, CFSTR(WebKitEditableLinkBehaviorPreferenceKey), linkBehaviorStringRef.get());
index 43fa7e0..2b6c789 100644 (file)
@@ -1,3 +1,15 @@
+2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Disable cross-origin-window-policy by default
+        https://bugs.webkit.org/show_bug.cgi?id=187509
+
+        Reviewed by Chris Dumez.
+
+        Enable the feature for testing purposes. DumpRenderTree does this already in enableExperimentalFeatures.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2018-07-10  Thibault Saunier  <tsaunier@igalia.com>
 
         [Flatpak] Feature options to build-webkit and --makeargs are not passed inside the sandbox
index 4be88c6..5c619d5 100644 (file)
@@ -772,6 +772,7 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
     WKPreferencesSetAccessibilityObjectModelEnabled(preferences, true);
     WKPreferencesSetMediaCapabilitiesEnabled(preferences, true);
 
+    WKPreferencesSetCrossOriginWindowPolicyEnabled(preferences, true);
     WKPreferencesSetRestrictedHTTPResponseAccess(preferences, true);
 
     WKPreferencesSetServerTimingEnabled(preferences, true);