Make <a download> a runtime enabled option
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2016 00:45:52 +0000 (00:45 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2016 00:45:52 +0000 (00:45 +0000)
commit322efcf951c3161afb92dc2cc3d63c580a0f910d
treef957fb705dcd3820bcd24faeea01101935f36b70
parentf48fec2885ff4fe9cfe54cbf9af625e1fefcec02
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199571 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLAnchorElement.idl
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h