Title: [185376] branches/safari-600.1.4.16-branch
Revision
185376
Author
[email protected]
Date
2015-06-09 13:23:45 -0700 (Tue, 09 Jun 2015)

Log Message

Merged r183682.  rdar://problem/21290700

Modified Paths

Added Paths

Diff

Modified: branches/safari-600.1.4.16-branch/LayoutTests/ChangeLog (185375 => 185376)


--- branches/safari-600.1.4.16-branch/LayoutTests/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/LayoutTests/ChangeLog	2015-06-09 20:23:45 UTC (rev 185376)
@@ -1,3 +1,19 @@
+2015-06-08  Babak Shafiei  <[email protected]>
+
+        Merge r183682.
+
+    2015-05-01  Brady Eidson  <[email protected]>
+
+            Add API to disable meta refreshes.
+            <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
+
+            Reviewed by Alexey Proskuryakov.
+
+            * loader/meta-refresh-disabled-expected.txt: Added.
+            * loader/meta-refresh-disabled.html: Added.
+            * loader/resources/notify-done.html: Added.
+            * platform/win/TestExpectations:
+
 2015-05-08  Babak Shafiei  <[email protected]>
 
         Merge r183646.

Copied: branches/safari-600.1.4.16-branch/LayoutTests/loader/meta-refresh-disabled-expected.txt (from rev 183682, trunk/LayoutTests/loader/meta-refresh-disabled-expected.txt) (0 => 185376)


--- branches/safari-600.1.4.16-branch/LayoutTests/loader/meta-refresh-disabled-expected.txt	                        (rev 0)
+++ branches/safari-600.1.4.16-branch/LayoutTests/loader/meta-refresh-disabled-expected.txt	2015-06-09 20:23:45 UTC (rev 185376)
@@ -0,0 +1,4 @@
+This test makes sure the preference to disable meta refreshes works as expected.
+You should see this text when the test is done.
+If you do not see this text, and instead you see a blank page, then the redirect happened, which it should not have.
+

Copied: branches/safari-600.1.4.16-branch/LayoutTests/loader/meta-refresh-disabled.html (from rev 183682, trunk/LayoutTests/loader/meta-refresh-disabled.html) (0 => 185376)


--- branches/safari-600.1.4.16-branch/LayoutTests/loader/meta-refresh-disabled.html	                        (rev 0)
+++ branches/safari-600.1.4.16-branch/LayoutTests/loader/meta-refresh-disabled.html	2015-06-09 20:23:45 UTC (rev 185376)
@@ -0,0 +1,39 @@
+<head>
+<script>
+if (window.testRunner) {
+    testRunner.overridePreference("WebKitMetaRefreshEnabled", "0");
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+// This bizarre practice of continuously delaying notifyDone() by multiple 0-delay timers
+// is meant to work around a few 0-delays in the meta refresh process.
+// The refresh itself is on a timer, and then the policy delegate's reply might be on a timer.
+// The goal here is to give a successfully scheduled meta refresh long enough to occur,
+// but to not also wait an arbitrary amount of clock time before concluding the test.
+function notifyDoneDelayer(iteration)
+{
+    if (iteration == 10) {
+        if (window.testRunner)
+            testRunner.notifyDone();
+        else
+            document.body.innerHTML = "This test can only be run under DRT/WKTR";
+        return;
+    }
+    
+    setTimeout("notifyDoneDelayer(" + ++iteration + ");", 0);
+}
+
+function loaded()
+{
+    setTimeout("notifyDoneDelayer(1);", 0);
+}
+
+</script>
+<meta http-equiv="refresh" content="0;url=""    
+</head>
+<body _onload_="loaded();">
+This test makes sure the preference to disable meta refreshes works as expected.<br>
+You should see this text when the test is done.<br>
+If you do not see this text, and instead you see a blank page, then the redirect happened, which it should not have.<br>
+</body>

Copied: branches/safari-600.1.4.16-branch/LayoutTests/loader/resources/notify-done.html (from rev 183682, trunk/LayoutTests/loader/resources/notify-done.html) (0 => 185376)


--- branches/safari-600.1.4.16-branch/LayoutTests/loader/resources/notify-done.html	                        (rev 0)
+++ branches/safari-600.1.4.16-branch/LayoutTests/loader/resources/notify-done.html	2015-06-09 20:23:45 UTC (rev 185376)
@@ -0,0 +1,4 @@
+<script>
+if (window.testRunner)
+    testRunner.notifyDone();
+</script>

Modified: branches/safari-600.1.4.16-branch/LayoutTests/platform/win/TestExpectations (185375 => 185376)


--- branches/safari-600.1.4.16-branch/LayoutTests/platform/win/TestExpectations	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/LayoutTests/platform/win/TestExpectations	2015-06-09 20:23:45 UTC (rev 185376)
@@ -2821,3 +2821,6 @@
 webkit.org/b/72828 mathml/opentype/horizontal-munderover.html [ Failure ]
 webkit.org/b/119038 mathml/presentation/mo-stretch.html [ Failure ]
 webkit.org/b/119038 mathml/presentation/roots.xhtml [ Failure ]
+
+# Windows doesn't have API for disabling meta refresh
+loader/meta-refresh-disabled.html [ Skip ]
\ No newline at end of file

Modified: branches/safari-600.1.4.16-branch/Source/WebCore/ChangeLog (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebCore/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/ChangeLog	2015-06-09 20:23:45 UTC (rev 185376)
@@ -1,3 +1,20 @@
+2015-06-08  Babak Shafiei  <[email protected]>
+
+        Merge r183682.
+
+    2015-05-01  Brady Eidson  <[email protected]>
+
+            Add API to disable meta refreshes.
+            <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
+
+            Reviewed by Alexey Proskuryakov.
+
+            Test: loader/meta-refresh-disabled.html
+
+            * dom/Document.cpp:
+            (WebCore::Document::processHttpEquiv): Bail early if Settings have meta refreshes disabled.
+            * page/Settings.in:
+
 2015-05-31  Babak Shafiei  <[email protected]>
 
         Merge r185018.

Modified: branches/safari-600.1.4.16-branch/Source/WebCore/dom/Document.cpp (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebCore/dom/Document.cpp	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/dom/Document.cpp	2015-06-09 20:23:45 UTC (rev 185376)
@@ -2827,6 +2827,9 @@
         break;
 
     case HTTPHeaderName::Refresh: {
+        if (page() && !page()->settings().metaRefreshEnabled())
+            break;
+
         double delay;
         String urlString;
         if (frame && parseHTTPRefresh(content, true, delay, urlString)) {

Modified: branches/safari-600.1.4.16-branch/Source/WebCore/page/Settings.in (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebCore/page/Settings.in	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebCore/page/Settings.in	2015-06-09 20:23:45 UTC (rev 185376)
@@ -229,3 +229,5 @@
 # Allow clients to permit navigation to an invalid URL. Some apps may use invalid URLs
 # as a means to pass data from the web-portion of their app to the native portion.
 allowNavigationToInvalidURL initial=false
+
+metaRefreshEnabled initial=true

Modified: branches/safari-600.1.4.16-branch/Source/WebKit/mac/ChangeLog (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit/mac/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit/mac/ChangeLog	2015-06-09 20:23:45 UTC (rev 185376)
@@ -1,3 +1,25 @@
+2015-06-08  Babak Shafiei  <[email protected]>
+
+        Merge r183682.
+
+    2015-05-01  Brady Eidson  <[email protected]>
+
+            Add API to disable meta refreshes.
+            <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
+
+            Reviewed by Alexey Proskuryakov.
+
+            Add a preference to enable/disable meta refreshes, enabled by default.
+
+            * WebView/WebPreferenceKeysPrivate.h:
+            * WebView/WebPreferences.mm:
+            (+[WebPreferences initialize]):
+            (-[WebPreferences setMetaRefreshEnabled:]):
+            (-[WebPreferences metaRefreshEnabled]):
+            * WebView/WebPreferencesPrivate.h:
+            * WebView/WebView.mm:
+            (-[WebView _preferencesChanged:]):
+
 2015-04-21  Lucas Forschler  <[email protected]>
 
         Merge r180110

Modified: branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2015-06-09 20:23:45 UTC (rev 185376)
@@ -177,6 +177,7 @@
 #define WebKitDebugFullPageZoomPreferenceKey @"WebKitDebugFullPageZoomPreferenceKey"
 
 #define WebKitMinimumZoomFontSizePreferenceKey @"WebKitMinimumZoomFontSizePreferenceKey"
+#define WebKitMetaRefreshEnabledPreferenceKey @"WebKitMetaRefreshEnabled"
 
 #if TARGET_OS_IPHONE
 #define WebKitStandalonePreferenceKey @"WebKitStandalonePreferenceKey"

Modified: branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferences.mm (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2015-06-09 20:23:45 UTC (rev 185376)
@@ -440,6 +440,7 @@
 #endif
         [NSNumber numberWithBool:YES],  WebKitPluginsEnabledPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitDatabasesEnabledPreferenceKey,
+        [NSNumber numberWithBool:YES],  WebKitMetaRefreshEnabledPreferenceKey,
 #if PLATFORM(IOS)
         [NSNumber numberWithBool:NO],   WebKitStorageTrackerEnabledPreferenceKey,
 #endif
@@ -2532,6 +2533,16 @@
     [self _setBoolValue:enabled forKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];
 }
 
+- (void)setMetaRefreshEnabled:(BOOL)enabled
+{
+    [self _setBoolValue:enabled forKey:WebKitMetaRefreshEnabledPreferenceKey];
+}
+
+- (BOOL)metaRefreshEnabled
+{
+    return [self _boolValueForKey:WebKitMetaRefreshEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)

Modified: branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2015-06-09 20:23:45 UTC (rev 185376)
@@ -435,6 +435,9 @@
 - (void)setGamepadsEnabled:(BOOL)flag;
 - (BOOL)gamepadsEnabled;
 
+- (void)setMetaRefreshEnabled:(BOOL)flag;
+- (BOOL)metaRefreshEnabled;
+
 #if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
 - (void)_setAllowCompositingLayerVisualDegradation:(BOOL)flag;
 #endif

Modified: branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebView.mm (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebView.mm	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit/mac/WebView/WebView.mm	2015-06-09 20:23:45 UTC (rev 185376)
@@ -2295,6 +2295,7 @@
     }
 
     settings.setPlugInSnapshottingEnabled([preferences plugInSnapshottingEnabled]);
+    settings.setMetaRefreshEnabled([preferences metaRefreshEnabled]);
 
     settings.setFixedPositionCreatesStackingContext(true);
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 10100

Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/ChangeLog (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit2/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/ChangeLog	2015-06-09 20:23:45 UTC (rev 185376)
@@ -1,3 +1,27 @@
+2015-06-08  Babak Shafiei  <[email protected]>
+
+        Merge r183682.
+
+    2015-05-01  Brady Eidson  <[email protected]>
+
+            Add API to disable meta refreshes.
+            <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
+
+            Reviewed by Alexey Proskuryakov.
+
+            Add a preference to enable/disable meta refreshes, enabled by default.
+
+            * Shared/WebPreferencesDefinitions.h:
+            * UIProcess/API/C/WKPreferences.cpp:
+            (WKPreferencesSetMetaRefreshEnabled):
+            (WKPreferencesGetMetaRefreshEnabled):
+            (WKPreferencesGetIgnoreViewportScalingConstraints): Deleted.
+            * UIProcess/API/C/WKPreferencesRefPrivate.h:
+            * WebProcess/InjectedBundle/InjectedBundle.cpp:
+            (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::updatePreferences):
+
 2015-04-21  Lucas Forschler  <[email protected]>
 
         Merge r182162

Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2015-06-09 20:23:45 UTC (rev 185376)
@@ -211,6 +211,7 @@
     macro(EnableInheritURIQueryComponent, enableInheritURIQueryComponent, Bool, bool, false) \
     macro(ServiceControlsEnabled, serviceControlsEnabled, Bool, bool, false) \
     macro(GamepadsEnabled, gamepadsEnabled, Bool, bool, false) \
+    macro(MetaRefreshEnabled, metaRefreshEnabled, Bool, bool, true) \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
     macro(PDFScaleFactor, pdfScaleFactor, Double, double, 0) \

Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2015-06-09 20:23:45 UTC (rev 185376)
@@ -1295,3 +1295,13 @@
 {
     return toImpl(preferencesRef)->minimumZoomFontSize();
 }
+
+void WKPreferencesSetMetaRefreshEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setMetaRefreshEnabled(enabled);
+}
+
+bool WKPreferencesGetMetaRefreshEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->metaRefreshEnabled();
+}

Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2015-06-09 20:23:45 UTC (rev 185376)
@@ -338,6 +338,10 @@
 WK_EXPORT void WKPreferencesSetMinimumZoomFontSize(WKPreferencesRef preferencesRef, double);
 WK_EXPORT double WKPreferencesGetMinimumZoomFontSize(WKPreferencesRef preferencesRef);
 
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetMetaRefreshEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetMetaRefreshEnabled(WKPreferencesRef preferences);
+
 #ifdef __cplusplus
 }
 #endif

Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2015-06-09 20:23:45 UTC (rev 185376)
@@ -221,7 +221,8 @@
     macro(WebKitShouldRespectImageOrientation, ShouldRespectImageOrientation, shouldRespectImageOrientation) \
     macro(WebKitEnableCaretBrowsing, CaretBrowsingEnabled, caretBrowsingEnabled) \
     macro(WebKitDisplayImagesKey, LoadsImagesAutomatically, loadsImagesAutomatically) \
-    macro(WebKitMediaStreamEnabled, MediaStreamEnabled, mediaStreamEnabled)
+    macro(WebKitMediaStreamEnabled, MediaStreamEnabled, mediaStreamEnabled) \
+    macro(WebKitMetaRefreshEnabled, MetaRefreshEnabled, metaRefreshEnabled)
 
 #define OVERRIDE_PREFERENCE_AND_SET_IN_EXISTING_PAGES(TestRunnerName, SettingsName, WebPreferencesName) \
     if (preference == #TestRunnerName) { \

Modified: branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-06-09 20:23:45 UTC (rev 185376)
@@ -2749,6 +2749,8 @@
     settings.setInteractiveFormValidationEnabled(store.getBoolValueForKey(WebPreferencesKey::interactiveFormValidationEnabledKey()));
     settings.setSpatialNavigationEnabled(store.getBoolValueForKey(WebPreferencesKey::spatialNavigationEnabledKey()));
 
+    settings.setMetaRefreshEnabled(store.getBoolValueForKey(WebPreferencesKey::metaRefreshEnabledKey()));
+
 #if ENABLE(SQL_DATABASE)
     DatabaseManager::manager().setIsAvailable(store.getBoolValueForKey(WebPreferencesKey::databasesEnabledKey()));
 #endif

Modified: branches/safari-600.1.4.16-branch/Tools/ChangeLog (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Tools/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Tools/ChangeLog	2015-06-09 20:23:45 UTC (rev 185376)
@@ -1,3 +1,17 @@
+2015-06-08  Babak Shafiei  <[email protected]>
+
+        Merge r183682.
+
+    2015-05-01  Brady Eidson  <[email protected]>
+
+            Add API to disable meta refreshes.
+            <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
+
+            Reviewed by Alexey Proskuryakov.
+
+            * DumpRenderTree/mac/DumpRenderTree.mm:
+            (resetWebPreferencesToConsistentValues): Reset the meta refresh pref between tests.
+
 2015-01-28  David Kilzer  <[email protected]>
 
         run-webkit-tests: Merge 46 commits from trunk to make it work

Modified: branches/safari-600.1.4.16-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm (185375 => 185376)


--- branches/safari-600.1.4.16-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2015-06-09 20:22:44 UTC (rev 185375)
+++ branches/safari-600.1.4.16-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2015-06-09 20:23:45 UTC (rev 185376)
@@ -853,6 +853,8 @@
     [preferences setLoadsSiteIconsIgnoringImageLoadingPreference:NO];
     [preferences setFrameFlatteningEnabled:NO];
     [preferences setSpatialNavigationEnabled:NO];
+    [preferences setMetaRefreshEnabled:YES];
+
     if (persistentUserStyleSheetLocation) {
         [preferences setUserStyleSheetLocation:[NSURL URLWithString:(NSString *)(persistentUserStyleSheetLocation.get())]];
         [preferences setUserStyleSheetEnabled:YES];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to