<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199571] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199571">199571</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2016-04-14 17:45:52 -0700 (Thu, 14 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make &lt;a download&gt; a runtime enabled option
https://bugs.webkit.org/show_bug.cgi?id=156583
&lt;rdar://problem/25733449&gt;

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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh">trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementcpp">trunk/Source/WebCore/html/HTMLAnchorElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementidl">trunk/Source/WebCore/html/HTMLAnchorElement.idl</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesmm">trunk/Source/WebKit/mac/WebView/WebPreferences.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencescpp">trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-04-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Make &lt;a download&gt; a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        &lt;rdar://problem/25733449&gt;
+
+        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:
+
</ins><span class="cx"> 2016-04-14  David Kilzer  &lt;ddkilzer@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r158956): Remove vestigial range code in FileReaderLoader class after removing ENABLE(STREAM)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2009 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved. 
</del><ins>+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved. 
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -227,6 +227,11 @@
</span><span class="cx">     bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    void setDownloadAttributeEnabled(bool isEnabled) { m_isDownloadAttributeEnabled = isEnabled; }
+    bool downloadAttributeEnabled() const { return m_isDownloadAttributeEnabled; }
+#endif
+
</ins><span class="cx">     WEBCORE_EXPORT static RuntimeEnabledFeatures&amp; sharedFeatures();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -328,6 +333,10 @@
</span><span class="cx">     bool m_isFetchAPIEnabled { false };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    bool m_isDownloadAttributeEnabled { false };
+#endif
+
</ins><span class="cx">     friend class WTF::NeverDestroyed&lt;RuntimeEnabledFeatures&gt;;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Simon Hausmann &lt;hausmann@kde.org&gt;
</span><del>- * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Graham Dennis (graham.dennis@gmail.com)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;PlatformMouseEvent.h&quot;
</span><span class="cx"> #include &quot;RenderImage.h&quot;
</span><span class="cx"> #include &quot;ResourceRequest.h&quot;
</span><ins>+#include &quot;RuntimeEnabledFeatures.h&quot;
</ins><span class="cx"> #include &quot;SVGImage.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;SecurityPolicy.h&quot;
</span><span class="lines">@@ -553,10 +554,10 @@
</span><span class="cx">     appendServerMapMousePosition(url, event);
</span><span class="cx">     URL kurl = document().completeURL(url.toString());
</span><span class="cx"> 
</span><ins>+    auto downloadAttribute = nullAtom;
</ins><span class="cx"> #if ENABLE(DOWNLOAD_ATTRIBUTE)
</span><del>-    auto downloadAttribute = fastGetAttribute(downloadAttr);
-#else
-    auto downloadAttribute = nullAtom;
</del><ins>+    if (RuntimeEnabledFeatures::sharedFeatures().downloadAttributeEnabled())
+        downloadAttribute = fastGetAttribute(downloadAttr);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     frame-&gt;loader().urlSelected(kurl, target(), event, LockHistory::No, LockBackForwardList::No, hasRel(RelationNoReferrer) ? NeverSendReferrer : MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), downloadAttribute);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.idl (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2006 Samuel Weinig &lt;sam.weinig@gmail.com&gt;
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx"> interface HTMLAnchorElement : HTMLElement {
</span><span class="cx">     [Reflect] attribute DOMString charset;
</span><span class="cx">     [Reflect] attribute DOMString coords;
</span><del>-    [Conditional=DOWNLOAD_ATTRIBUTE, Reflect] attribute DOMString download;
</del><ins>+    [Conditional=DOWNLOAD_ATTRIBUTE, EnabledAtRuntime=DownloadAttribute, Reflect] attribute DOMString download;
</ins><span class="cx">     [Reflect] attribute DOMString hreflang;
</span><span class="cx">     [Reflect] attribute DOMString name;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-04-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Make &lt;a download&gt; a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        &lt;rdar://problem/25733449&gt;
+
+        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.
+
</ins><span class="cx"> 2016-04-09  Gavin Barraclough  &lt;barraclough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit should adopt journal_mode=wal for all SQLite databases.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2012 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2005-2016 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -163,6 +163,7 @@
</span><span class="cx"> #define WebKitShadowDOMEnabledPreferenceKey @&quot;WebKitShadowDOMEnabled&quot;
</span><span class="cx"> #define WebKitCustomElementsEnabledPreferenceKey @&quot;WebKitCustomElementsEnabled&quot;
</span><span class="cx"> #define WebKitFetchAPIEnabledPreferenceKey @&quot;WebKitFetchAPIEnabled&quot;
</span><ins>+#define WebKitDownloadAttributeEnabledPreferenceKey @&quot;WebKitDownloadAttributeEnabled&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if !TARGET_OS_IPHONE
</span><span class="cx"> // These are private both because callers should be using the cover methods and because the
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferencesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2006, 2007, 2011, 2012, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Graham Dennis (graham.dennis@gmail.com)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -616,6 +616,9 @@
</span><span class="cx"> #if ENABLE(FETCH_API)
</span><span class="cx">         [NSNumber numberWithBool:NO], WebKitFetchAPIEnabledPreferenceKey,
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+        [NSNumber numberWithBool:NO], WebKitDownloadAttributeEnabledPreferenceKey,
+#endif
</ins><span class="cx">         nil];
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="lines">@@ -2726,6 +2729,16 @@
</span><span class="cx">     [self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)downloadAttributeEnabled
+{
+    return [self _boolValueForKey:WebKitDownloadAttributeEnabledPreferenceKey];
+}
+
+- (void)setDownloadAttributeEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitDownloadAttributeEnabledPreferenceKey];
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WebPreferences (WebInternal)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2007, 2011, 2012 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2005-2016 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -487,6 +487,9 @@
</span><span class="cx"> - (void)setFetchAPIEnabled:(BOOL)flag;
</span><span class="cx"> - (BOOL)fetchAPIEnabled;
</span><span class="cx"> 
</span><ins>+- (void)setDownloadAttributeEnabled:(BOOL)flag;
+- (BOOL)downloadAttributeEnabled;
+
</ins><span class="cx"> @property (nonatomic) BOOL javaScriptMarkupEnabled;
</span><span class="cx"> @property (nonatomic) BOOL mediaDataLoadsAutomatically;
</span><span class="cx"> @property (nonatomic) BOOL attachmentElementEnabled;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -2496,6 +2496,10 @@
</span><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled([preferences webGL2Enabled]);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled([preferences downloadAttributeEnabled]);
+#endif
+
</ins><span class="cx">     NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
</span><span class="cx">     if (timeout &gt; 0)
</span><span class="cx">         settings.setIncrementalRenderingSuppressionTimeoutInSeconds(timeout);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-04-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Make &lt;a download&gt; a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        &lt;rdar://problem/25733449&gt;
+
+        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):
+
</ins><span class="cx"> 2016-04-14  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix after r199554.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -229,6 +229,7 @@
</span><span class="cx">     macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, false) \
</span><span class="cx">     macro(FetchAPIEnabled, fetchAPIEnabled, Bool, bool, false) \
</span><span class="cx">     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, false) \
</span><ins>+    macro(DownloadAttributeEnabled, downloadAttributeEnabled, Bool, bool, false) \
</ins><span class="cx">     FOR_EACH_ADDITIONAL_WEBKIT_BOOL_PREFERENCE(macro) \
</span><span class="cx">     \
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -1530,3 +1530,13 @@
</span><span class="cx"> {
</span><span class="cx">     return toImpl(preferencesRef)-&gt;fetchAPIEnabled();
</span><span class="cx"> }
</span><ins>+
+void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)-&gt;setDownloadAttributeEnabled(flag);
+}
+
+bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)-&gt;downloadAttributeEnabled();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -427,6 +427,10 @@
</span><span class="cx"> WK_EXPORT void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef, bool flag);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef);
</span><span class="cx"> 
</span><ins>+// Defaults to false
+WK_EXPORT void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef);
+
</ins><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -213,6 +213,11 @@
</span><span class="cx">         RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled(enabled);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    if (preference == &quot;WebKitDownloadAttributeEnabled&quot;)
+        RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled(enabled);
+#endif
+    
</ins><span class="cx">     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
</span><span class="cx"> #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
</span><span class="cx">     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011, 2012, 2013-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2012 Intel Corporation. All rights reserved.
</span><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  *
</span><span class="lines">@@ -3103,6 +3103,10 @@
</span><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled(store.getBoolValueForKey(WebPreferencesKey::fetchAPIEnabledKey()));
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled(store.getBoolValueForKey(WebPreferencesKey::downloadAttributeEnabledKey()));
+#endif
+    
</ins><span class="cx">     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
</span><span class="cx">     if (m_processSuppressionEnabled != processSuppressionEnabled) {
</span><span class="cx">         m_processSuppressionEnabled = processSuppressionEnabled;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-04-15 00:30:23 UTC (rev 199570)
+++ trunk/Tools/ChangeLog        2016-04-15 00:45:52 UTC (rev 199571)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-04-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Make &lt;a download&gt; a runtime enabled option
+        https://bugs.webkit.org/show_bug.cgi?id=156583
+        &lt;rdar://problem/25733449&gt;
+
+        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:
+
</ins><span class="cx"> 2016-04-14  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Another build fix attempt.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005-2009, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2007 Graham Dennis (graham.dennis@gmail.com)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -991,6 +991,8 @@
</span><span class="cx"> 
</span><span class="cx">     [preferences setFetchAPIEnabled:YES];
</span><span class="cx"> 
</span><ins>+    [preferences setDownloadAttributeEnabled:YES];
+
</ins><span class="cx">     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
</span><span class="cx">     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -317,6 +317,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_testRunner-&gt;setFetchAPIEnabled(true);
</span><span class="cx"> 
</span><ins>+    m_testRunner-&gt;setDownloadAttributeEnabled(true);
+
</ins><span class="cx">     m_testRunner-&gt;setCloseRemainingWindowsWhenComplete(false);
</span><span class="cx">     m_testRunner-&gt;setAcceptsEditing(true);
</span><span class="cx">     m_testRunner-&gt;setTabKeyCyclesThroughElements(true);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -352,6 +352,13 @@
</span><span class="cx">     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestRunner::setDownloadAttributeEnabled(bool enabled)
+{
+    WKRetainPtr&lt;WKStringRef&gt; key(AdoptWK, WKStringCreateWithUTF8CString(&quot;WebKitDownloadAttributeEnabled&quot;));
+    auto&amp; injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
</ins><span class="cx"> void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; injectedBundle = InjectedBundle::singleton();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (199570 => 199571)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx">     void dispatchPendingLoadRequests();
</span><span class="cx">     void setCacheModel(int);
</span><span class="cx">     void setAsynchronousSpellCheckingEnabled(bool);
</span><ins>+    void setDownloadAttributeEnabled(bool);
</ins><span class="cx"> 
</span><span class="cx">     // Special DOM functions.
</span><span class="cx">     void clearBackForwardList();
</span></span></pre>
</div>
</div>

</body>
</html>