Title: [199571] trunk
Revision
199571
Author
[email protected]
Date
2016-04-14 17:45:52 -0700 (Thu, 14 Apr 2016)

Log Message

Make <a download> a runtime enabled option
https://bugs.webkit.org/show_bug.cgi?id=156583
<rdar://problem/25733449>

Reviewed by Alex Christensen.

Source/WebCore:

Mark the download attribute interface as EnabledAtRuntime=DownloadAttribute.
Add DownloadAttribute runtime flag getter and setter.

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::fetchAPIEnabled):
(WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled):
(WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLAnchorElement.idl:

Source/WebKit/mac:

Add a download attribute runtime flag based on preferences.
Disable the download attribute by default.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences setFetchAPIEnabled:]):
(-[WebPreferences downloadAttributeEnabled]):
(-[WebPreferences setDownloadAttributeEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged]): Set the runtime flag properly
based on the user preferences.

Source/WebKit2:

Add a download attribute runtime flag based on preferences.
Disable the download attribute by default.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetFetchAPIEnabled):
(WKPreferencesSetDownloadAttributeEnabled):
(WKPreferencesGetDownloadAttributeEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setDownloadAttributeEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (199570 => 199571)


--- trunk/Source/WebCore/ChangeLog	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebCore/ChangeLog	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,3 +1,22 @@
+2016-04-14  Brent Fulgham  <[email protected]>
+
+        Make <a download> a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        <rdar://problem/25733449>
+
+        Reviewed by Alex Christensen.
+
+        Mark the download attribute interface as EnabledAtRuntime=DownloadAttribute.
+        Add DownloadAttribute runtime flag getter and setter.
+
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled):
+        (WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::handleClick):
+        * html/HTMLAnchorElement.idl:
+
 2016-04-14  David Kilzer  <[email protected]>
 
         REGRESSION (r158956): Remove vestigial range code in FileReaderLoader class after removing ENABLE(STREAM)

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (199570 => 199571)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved. 
+ * Copyright (C) 2013-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 are
@@ -227,6 +227,11 @@
     bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; }
 #endif
 
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    void setDownloadAttributeEnabled(bool isEnabled) { m_isDownloadAttributeEnabled = isEnabled; }
+    bool downloadAttributeEnabled() const { return m_isDownloadAttributeEnabled; }
+#endif
+
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
@@ -328,6 +333,10 @@
     bool m_isFetchAPIEnabled { false };
 #endif
 
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    bool m_isDownloadAttributeEnabled { false };
+#endif
+
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (199570 => 199571)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2016-04-15 00:45:52 UTC (rev 199571)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll ([email protected])
  *           (C) 1999 Antti Koivisto ([email protected])
  *           (C) 2000 Simon Hausmann <[email protected]>
- * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2016 Apple Inc. All rights reserved.
  *           (C) 2006 Graham Dennis ([email protected])
  *
  * This library is free software; you can redistribute it and/or
@@ -42,6 +42,7 @@
 #include "PlatformMouseEvent.h"
 #include "RenderImage.h"
 #include "ResourceRequest.h"
+#include "RuntimeEnabledFeatures.h"
 #include "SVGImage.h"
 #include "SecurityOrigin.h"
 #include "SecurityPolicy.h"
@@ -553,10 +554,10 @@
     appendServerMapMousePosition(url, event);
     URL kurl = document().completeURL(url.toString());
 
+    auto downloadAttribute = nullAtom;
 #if ENABLE(DOWNLOAD_ATTRIBUTE)
-    auto downloadAttribute = fastGetAttribute(downloadAttr);
-#else
-    auto downloadAttribute = nullAtom;
+    if (RuntimeEnabledFeatures::sharedFeatures().downloadAttributeEnabled())
+        downloadAttribute = fastGetAttribute(downloadAttr);
 #endif
 
     frame->loader().urlSelected(kurl, target(), event, LockHistory::No, LockBackForwardList::No, hasRel(RelationNoReferrer) ? NeverSendReferrer : MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), downloadAttribute);

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.idl (199570 => 199571)


--- trunk/Source/WebCore/html/HTMLAnchorElement.idl	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.idl	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Samuel Weinig <[email protected]>
  *
  * This library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
 interface HTMLAnchorElement : HTMLElement {
     [Reflect] attribute DOMString charset;
     [Reflect] attribute DOMString coords;
-    [Conditional=DOWNLOAD_ATTRIBUTE, Reflect] attribute DOMString download;
+    [Conditional=DOWNLOAD_ATTRIBUTE, EnabledAtRuntime=DownloadAttribute, Reflect] attribute DOMString download;
     [Reflect] attribute DOMString hreflang;
     [Reflect] attribute DOMString name;
 

Modified: trunk/Source/WebKit/mac/ChangeLog (199570 => 199571)


--- trunk/Source/WebKit/mac/ChangeLog	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,3 +1,25 @@
+2016-04-14  Brent Fulgham  <[email protected]>
+
+        Make <a download> a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        <rdar://problem/25733449>
+
+        Reviewed by Alex Christensen.
+
+        Add a download attribute runtime flag based on preferences.
+        Disable the download attribute by default.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences setFetchAPIEnabled:]):
+        (-[WebPreferences downloadAttributeEnabled]):
+        (-[WebPreferences setDownloadAttributeEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged]): Set the runtime flag properly
+        based on the user preferences.
+
 2016-04-09  Gavin Barraclough  <[email protected]>
 
         WebKit should adopt journal_mode=wal for all SQLite databases.

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (199570 => 199571)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2012 Apple Inc.  All rights reserved.
+ * Copyright (C) 2005-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
@@ -163,6 +163,7 @@
 #define WebKitShadowDOMEnabledPreferenceKey @"WebKitShadowDOMEnabled"
 #define WebKitCustomElementsEnabledPreferenceKey @"WebKitCustomElementsEnabled"
 #define WebKitFetchAPIEnabledPreferenceKey @"WebKitFetchAPIEnabled"
+#define WebKitDownloadAttributeEnabledPreferenceKey @"WebKitDownloadAttributeEnabled"
 
 #if !TARGET_OS_IPHONE
 // These are private both because callers should be using the cover methods and because the

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (199570 => 199571)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2006, 2007, 2011, 2012, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2016 Apple Inc. All rights reserved.
  *           (C) 2006 Graham Dennis ([email protected])
  *
  * Redistribution and use in source and binary forms, with or without
@@ -616,6 +616,9 @@
 #if ENABLE(FETCH_API)
         [NSNumber numberWithBool:NO], WebKitFetchAPIEnabledPreferenceKey,
 #endif
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+        [NSNumber numberWithBool:NO], WebKitDownloadAttributeEnabledPreferenceKey,
+#endif
         nil];
 
 #if !PLATFORM(IOS)
@@ -2726,6 +2729,16 @@
     [self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
 }
 
+- (BOOL)downloadAttributeEnabled
+{
+    return [self _boolValueForKey:WebKitDownloadAttributeEnabledPreferenceKey];
+}
+
+- (void)setDownloadAttributeEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitDownloadAttributeEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (199570 => 199571)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2007, 2011, 2012 Apple Inc.  All rights reserved.
+ * Copyright (C) 2005-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
@@ -487,6 +487,9 @@
 - (void)setFetchAPIEnabled:(BOOL)flag;
 - (BOOL)fetchAPIEnabled;
 
+- (void)setDownloadAttributeEnabled:(BOOL)flag;
+- (BOOL)downloadAttributeEnabled;
+
 @property (nonatomic) BOOL _javascript_MarkupEnabled;
 @property (nonatomic) BOOL mediaDataLoadsAutomatically;
 @property (nonatomic) BOOL attachmentElementEnabled;

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (199570 => 199571)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2016-04-15 00:45:52 UTC (rev 199571)
@@ -2496,6 +2496,10 @@
     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled([preferences webGL2Enabled]);
 #endif
 
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled([preferences downloadAttributeEnabled]);
+#endif
+
     NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
     if (timeout > 0)
         settings.setIncrementalRenderingSuppressionTimeoutInSeconds(timeout);

Modified: trunk/Source/WebKit2/ChangeLog (199570 => 199571)


--- trunk/Source/WebKit2/ChangeLog	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit2/ChangeLog	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,3 +1,25 @@
+2016-04-14  Brent Fulgham  <[email protected]>
+
+        Make <a download> a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        <rdar://problem/25733449>
+
+        Reviewed by Alex Christensen.
+
+        Add a download attribute runtime flag based on preferences.
+        Disable the download attribute by default.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesGetFetchAPIEnabled):
+        (WKPreferencesSetDownloadAttributeEnabled):
+        (WKPreferencesGetDownloadAttributeEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2016-04-14  Alex Christensen  <[email protected]>
 
         Build fix after r199554.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (199570 => 199571)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-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
@@ -229,6 +229,7 @@
     macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, false) \
     macro(FetchAPIEnabled, fetchAPIEnabled, Bool, bool, false) \
     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, false) \
+    macro(DownloadAttributeEnabled, downloadAttributeEnabled, Bool, bool, false) \
     FOR_EACH_ADDITIONAL_WEBKIT_BOOL_PREFERENCE(macro) \
     \
 

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (199570 => 199571)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-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
@@ -1530,3 +1530,13 @@
 {
     return toImpl(preferencesRef)->fetchAPIEnabled();
 }
+
+void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setDownloadAttributeEnabled(flag);
+}
+
+bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->downloadAttributeEnabled();
+}

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (199570 => 199571)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-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
@@ -427,6 +427,10 @@
 WK_EXPORT void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef);
 
+// Defaults to false
+WK_EXPORT void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (199570 => 199571)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-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
@@ -213,6 +213,11 @@
         RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled(enabled);
 #endif
 
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    if (preference == "WebKitDownloadAttributeEnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled(enabled);
+#endif
+    
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (199570 => 199571)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011, 2012, 2013-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Intel Corporation. All rights reserved.
  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
  *
@@ -3103,6 +3103,10 @@
     RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled(store.getBoolValueForKey(WebPreferencesKey::fetchAPIEnabledKey()));
 #endif
 
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled(store.getBoolValueForKey(WebPreferencesKey::downloadAttributeEnabledKey()));
+#endif
+    
     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
     if (m_processSuppressionEnabled != processSuppressionEnabled) {
         m_processSuppressionEnabled = processSuppressionEnabled;

Modified: trunk/Tools/ChangeLog (199570 => 199571)


--- trunk/Tools/ChangeLog	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Tools/ChangeLog	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,3 +1,19 @@
+2016-04-14  Brent Fulgham  <[email protected]>
+
+        Make <a download> a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        <rdar://problem/25733449>
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setDownloadAttributeEnabled):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
 2016-04-14  Anders Carlsson  <[email protected]>
 
         Another build fix attempt.

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (199570 => 199571)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2009, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2016 Apple Inc. All rights reserved.
  *           (C) 2007 Graham Dennis ([email protected])
  *
  * Redistribution and use in source and binary forms, with or without
@@ -991,6 +991,8 @@
 
     [preferences setFetchAPIEnabled:YES];
 
+    [preferences setDownloadAttributeEnabled:YES];
+
     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (199570 => 199571)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-04-15 00:45:52 UTC (rev 199571)
@@ -317,6 +317,8 @@
 
     m_testRunner->setFetchAPIEnabled(true);
 
+    m_testRunner->setDownloadAttributeEnabled(true);
+
     m_testRunner->setCloseRemainingWindowsWhenComplete(false);
     m_testRunner->setAcceptsEditing(true);
     m_testRunner->setTabKeyCyclesThroughElements(true);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (199570 => 199571)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-04-15 00:45:52 UTC (rev 199571)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-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
@@ -352,6 +352,13 @@
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
+void TestRunner::setDownloadAttributeEnabled(bool enabled)
+{
+    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitDownloadAttributeEnabled"));
+    auto& injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
 void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
 {
     auto& injectedBundle = InjectedBundle::singleton();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (199570 => 199571)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-04-15 00:45:52 UTC (rev 199571)
@@ -122,6 +122,7 @@
     void dispatchPendingLoadRequests();
     void setCacheModel(int);
     void setAsynchronousSpellCheckingEnabled(bool);
+    void setDownloadAttributeEnabled(bool);
 
     // Special DOM functions.
     void clearBackForwardList();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to