Title: [185375] branches/safari-600.7-branch
Revision
185375
Author
[email protected]
Date
2015-06-09 13:22:44 -0700 (Tue, 09 Jun 2015)

Log Message

Merged r183682.  rdar://problem/21290693

Modified Paths

Added Paths

Diff

Modified: branches/safari-600.7-branch/LayoutTests/ChangeLog (185374 => 185375)


--- branches/safari-600.7-branch/LayoutTests/ChangeLog	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/LayoutTests/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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-13  Ryosuke Niwa  <[email protected]>
 
         Add a Pass/Failure test expectation on

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


--- branches/safari-600.7-branch/LayoutTests/loader/meta-refresh-disabled-expected.txt	                        (rev 0)
+++ branches/safari-600.7-branch/LayoutTests/loader/meta-refresh-disabled-expected.txt	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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.7-branch/LayoutTests/loader/meta-refresh-disabled.html (from rev 183682, trunk/LayoutTests/loader/meta-refresh-disabled.html) (0 => 185375)


--- branches/safari-600.7-branch/LayoutTests/loader/meta-refresh-disabled.html	                        (rev 0)
+++ branches/safari-600.7-branch/LayoutTests/loader/meta-refresh-disabled.html	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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.7-branch/LayoutTests/loader/resources/notify-done.html (from rev 183682, trunk/LayoutTests/loader/resources/notify-done.html) (0 => 185375)


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

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


--- branches/safari-600.7-branch/LayoutTests/platform/win/TestExpectations	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/LayoutTests/platform/win/TestExpectations	2015-06-09 20:22:44 UTC (rev 185375)
@@ -2822,3 +2822,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.7-branch/Source/WebCore/ChangeLog (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebCore/ChangeLog	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebCore/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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.7-branch/Source/WebCore/dom/Document.cpp (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebCore/dom/Document.cpp	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebCore/dom/Document.cpp	2015-06-09 20:22:44 UTC (rev 185375)
@@ -2831,6 +2831,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.7-branch/Source/WebCore/page/Settings.in (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebCore/page/Settings.in	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebCore/page/Settings.in	2015-06-09 20:22:44 UTC (rev 185375)
@@ -231,3 +231,5 @@
 
 serviceControlsEnabled initial=false, conditional=SERVICE_CONTROLS
 appleMailPaginationQuirkEnabled initial=false
+
+metaRefreshEnabled initial=true

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


--- branches/safari-600.7-branch/Source/WebKit/mac/ChangeLog	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit/mac/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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-17  Lucas Forschler  <[email protected]>
 
         Merge r180110

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


--- branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2015-06-09 20:22:44 UTC (rev 185375)
@@ -179,6 +179,7 @@
 #define WebKitDebugFullPageZoomPreferenceKey @"WebKitDebugFullPageZoomPreferenceKey"
 
 #define WebKitMinimumZoomFontSizePreferenceKey @"WebKitMinimumZoomFontSizePreferenceKey"
+#define WebKitMetaRefreshEnabledPreferenceKey @"WebKitMetaRefreshEnabled"
 
 #if TARGET_OS_IPHONE
 #define WebKitStandalonePreferenceKey @"WebKitStandalonePreferenceKey"

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


--- branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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
@@ -2556,6 +2557,16 @@
     [self _setStringValue:directory forKey:WebKitMediaKeysStorageDirectoryKey];
 }
 
+- (void)setMetaRefreshEnabled:(BOOL)enabled
+{
+    [self _setBoolValue:enabled forKey:WebKitMetaRefreshEnabledPreferenceKey];
+}
+
+- (BOOL)metaRefreshEnabled
+{
+    return [self _boolValueForKey:WebKitMetaRefreshEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)

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


--- branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2015-06-09 20:22:44 UTC (rev 185375)
@@ -441,6 +441,9 @@
 - (void)setMediaKeysStorageDirectory:(NSString *)directory;
 - (NSString *)mediaKeysStorageDirectory;
 
+- (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.7-branch/Source/WebKit/mac/WebView/WebView.mm (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebView.mm	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit/mac/WebView/WebView.mm	2015-06-09 20:22:44 UTC (rev 185375)
@@ -2329,6 +2329,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.7-branch/Source/WebKit2/ChangeLog (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebKit2/ChangeLog	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit2/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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-23  Babak Shafiei  <[email protected]>
 
         Merge r181656 & r182985.

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


--- branches/safari-600.7-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2015-06-09 20:22:44 UTC (rev 185375)
@@ -210,6 +210,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.7-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2015-06-09 20:22:44 UTC (rev 185375)
@@ -1285,3 +1285,13 @@
 {
     return toImpl(preferencesRef)->gamepadsEnabled();
 }
+
+void WKPreferencesSetMetaRefreshEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setMetaRefreshEnabled(enabled);
+}
+
+bool WKPreferencesGetMetaRefreshEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->metaRefreshEnabled();
+}

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


--- branches/safari-600.7-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2015-06-09 20:22:44 UTC (rev 185375)
@@ -334,6 +334,10 @@
 WK_EXPORT void WKPreferencesSetGamepadsEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetGamepadsEnabled(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.7-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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.7-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (185374 => 185375)


--- branches/safari-600.7-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-06-09 20:22:44 UTC (rev 185375)
@@ -2709,6 +2709,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.7-branch/Tools/ChangeLog (185374 => 185375)


--- branches/safari-600.7-branch/Tools/ChangeLog	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Tools/ChangeLog	2015-06-09 20:22:44 UTC (rev 185375)
@@ -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-05-15  Ryosuke Niwa  <[email protected]>
 
         Merge r182018 and r181280.

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


--- branches/safari-600.7-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2015-06-09 20:12:15 UTC (rev 185374)
+++ branches/safari-600.7-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2015-06-09 20:22:44 UTC (rev 185375)
@@ -848,6 +848,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