Turning off custom pasteboard data doesn't actually turn it off in WK2
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 06:41:05 +0000 (06:41 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 06:41:05 +0000 (06:41 +0000)
commit81b8dfbd0a5838c5263b310dfda441cc1889ae61
tree1355571c8918253a53f148d888569d1aff67fb41
parent76f9e0043da53c8dbed2e3db6909329183f1eaa8
Turning off custom pasteboard data doesn't actually turn it off in WK2
https://bugs.webkit.org/show_bug.cgi?id=181920
<rdar://problem/36686429>

Reviewed by Wenson Hsieh.

Source/WebCore:

Replaced the global settings for custom pasteboard data by regular runtime enabled flags.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getDataForItem const):
(WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
(WebCore::DataTransfer::setDataFromItemList):
(WebCore::DataTransfer::types const):
(WebCore::DataTransfer::commitToPasteboard):
* dom/DataTransferItemList.cpp:
(WebCore::shouldExposeTypeInItemList):
* editing/Editor.cpp:
(WebCore::createDataTransferForClipboardEvent):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentAndAddResources):
(WebCore::WebContentReader::readWebArchive):
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::setCustomPasteboardDataEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::customPasteboardDataEnabled): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCustomPasteboardDataEnabled):
(WebCore::RuntimeEnabledFeatures::customPasteboardDataEnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setCustomPasteboardDataEnabled):

Source/WebKit:

Moved the code to decide when to enable custom pasteboard data from WebCore
since we never enable this feature in WebKit1.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.cpp:
(defaultCustomPasteboardDataEnabled): Added.
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

Always disable custom pasteboard data in WebKit1. See r226156 for details.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/DataTransfer.cpp
Source/WebCore/dom/DataTransferItemList.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/page/DeprecatedGlobalSettings.cpp
Source/WebCore/page/DeprecatedGlobalSettings.h
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
Source/WebKit/Shared/WebPreferencesDefaultValues.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebView.mm