Title: [197920] trunk
Revision
197920
Author
[email protected]
Date
2016-03-09 20:06:51 -0800 (Wed, 09 Mar 2016)

Log Message

Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
https://bugs.webkit.org/show_bug.cgi?id=155265
<rdar://problem/11101440>

Reviewed by Andy Estes.

Source/WebKit2:

We require "AllowUniversalAccessFromFileURLs" to permit file URLs from accessing
localStorage. However, this setting is not available on the Cocoa WKPreference (by design).
Instead, you need to set this value on the WKWebViewConfiguration.
        
Back out the work-around landed in r197889, 

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Remove test workaround.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Set the correct flag on
the WKWebViewConfiguration.

Tools:

WK2 localStorage tests need the 'AllowUniversalAccessFromFileURLs' preference set by default.
Tests that confirm blocking localStorage manually set the flag to "False" in the test.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration): Set the default state to the correct value.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (197919 => 197920)


--- trunk/Source/WebKit2/ChangeLog	2016-03-10 03:16:44 UTC (rev 197919)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-10 04:06:51 UTC (rev 197920)
@@ -1,3 +1,23 @@
+2016-03-09  Brent Fulgham  <[email protected]>
+
+        Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
+        https://bugs.webkit.org/show_bug.cgi?id=155265
+        <rdar://problem/11101440>
+
+        Reviewed by Andy Estes.
+
+        We require "AllowUniversalAccessFromFileURLs" to permit file URLs from accessing
+        localStorage. However, this setting is not available on the Cocoa WKPreference (by design).
+        Instead, you need to set this value on the WKWebViewConfiguration.
+        
+        Back out the work-around landed in r197889, 
+
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration init]): Remove test workaround.
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage): Set the correct flag on
+        the WKWebViewConfiguration.
+
 2016-03-09  Enrica Casucci  <[email protected]>
 
         Retrieve additional context for some data detector link for preview and action menu.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (197919 => 197920)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2016-03-10 03:16:44 UTC (rev 197919)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm	2016-03-10 04:06:51 UTC (rev 197920)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -152,7 +152,7 @@
     _allowsJavaScriptMarkup = YES;
     _convertsPositionStyleOnCopy = NO;
     _allowsMetaRefresh = YES;
-    _allowUniversalAccessFromFileURLs = YES; //FIXME(155265): Workaround for test break
+    _allowUniversalAccessFromFileURLs = NO;
 
     return self;
 }

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (197919 => 197920)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2016-03-10 03:16:44 UTC (rev 197919)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2016-03-10 04:06:51 UTC (rev 197920)
@@ -372,6 +372,7 @@
     preferences._logsPageMessagesToSystemConsoleEnabled = YES;
 #endif
     preferences._allowFileAccessFromFileURLs = YES;
+    [configuration _setAllowUniversalAccessFromFileURLs:YES];
     preferences._javaScriptRuntimeFlags = 0;
     if (isUnderTest()) {
         preferences._hiddenPageDOMTimerThrottlingEnabled = NO;

Modified: trunk/Tools/ChangeLog (197919 => 197920)


--- trunk/Tools/ChangeLog	2016-03-10 03:16:44 UTC (rev 197919)
+++ trunk/Tools/ChangeLog	2016-03-10 04:06:51 UTC (rev 197920)
@@ -1,3 +1,17 @@
+2016-03-09  Brent Fulgham  <[email protected]>
+
+        Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
+        https://bugs.webkit.org/show_bug.cgi?id=155265
+        <rdar://problem/11101440>
+
+        Reviewed by Andy Estes.
+
+        WK2 localStorage tests need the 'AllowUniversalAccessFromFileURLs' preference set by default.
+        Tests that confirm blocking localStorage manually set the flag to "False" in the test.
+
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::initializeWebViewConfiguration): Set the default state to the correct value.
+
 2016-03-09  David Kilzer  <[email protected]>
 
         check-webkit-style: fix false-positive warnings about @try/@catch blocks in Objective-C++ source files

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (197919 => 197920)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2016-03-10 03:16:44 UTC (rev 197919)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2016-03-10 04:06:51 UTC (rev 197920)
@@ -57,6 +57,7 @@
 
     globalWebViewConfiguration.processPool = WTF::adoptNS([[WKProcessPool alloc] _initWithConfiguration:(_WKProcessPoolConfiguration *)contextConfiguration]).get();
     globalWebViewConfiguration.websiteDataStore = (WKWebsiteDataStore *)WKContextGetWebsiteDataStore(context);
+    globalWebViewConfiguration._allowUniversalAccessFromFileURLs = YES;
 
 #if TARGET_OS_IPHONE
     globalWebViewConfiguration.allowsInlineMediaPlayback = YES;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to