Diff
Modified: trunk/Source/WebCore/ChangeLog (286704 => 286705)
--- trunk/Source/WebCore/ChangeLog 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebCore/ChangeLog 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1,3 +1,16 @@
+2021-12-08 Truitt Savell <tsav...@apple.com>
+
+ Unreviewed, reverting r286632.
+
+ Broke 3 tests on iOS
+
+ Reverted changeset:
+
+ "Add a `DOMPasteAccessCategory` to control which pasteboard
+ the WebProcess is granted access to when pasting"
+ https://bugs.webkit.org/show_bug.cgi?id=233939
+ https://commits.webkit.org/r286632
+
2021-12-08 Philippe Normand <pnorm...@igalia.com>
[GStreamer] Fill in client-name property on audio sinks
Modified: trunk/Source/WebCore/dom/DOMPasteAccess.h (286704 => 286705)
--- trunk/Source/WebCore/dom/DOMPasteAccess.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebCore/dom/DOMPasteAccess.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -29,10 +29,6 @@
namespace WebCore {
-enum class DOMPasteAccessCategory : uint8_t {
- General,
-};
-
enum class DOMPasteAccessPolicy : uint8_t {
NotRequestedYet,
Denied,
@@ -49,13 +45,6 @@
namespace WTF {
-template<> struct EnumTraits<WebCore::DOMPasteAccessCategory> {
- using values = EnumValues<
- WebCore::DOMPasteAccessCategory,
- WebCore::DOMPasteAccessCategory::General
- >;
-};
-
template<> struct EnumTraits<WebCore::DOMPasteAccessResponse> {
using values = EnumValues<
WebCore::DOMPasteAccessResponse,
Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (286704 => 286705)
--- trunk/Source/WebCore/loader/EmptyClients.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -286,7 +286,7 @@
void registerRedoStep(UndoStep&) final;
void clearUndoRedoOperations() final { }
- DOMPasteAccessResponse requestDOMPasteAccess(DOMPasteAccessCategory, const String&) final { return DOMPasteAccessResponse::DeniedForGesture; }
+ DOMPasteAccessResponse requestDOMPasteAccess(const String&) final { return DOMPasteAccessResponse::DeniedForGesture; }
bool canCopyCut(Frame*, bool defaultValue) const final { return defaultValue; }
bool canPaste(Frame*, bool defaultValue) const final { return defaultValue; }
Modified: trunk/Source/WebCore/page/EditorClient.h (286704 => 286705)
--- trunk/Source/WebCore/page/EditorClient.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebCore/page/EditorClient.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -36,7 +36,6 @@
namespace WebCore {
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
class DocumentFragment;
@@ -102,7 +101,7 @@
virtual void requestCandidatesForSelection(const VisibleSelection&) { }
virtual void handleAcceptedCandidateWithSoftSpaces(TextCheckingResult) { }
- virtual DOMPasteAccessResponse requestDOMPasteAccess(DOMPasteAccessCategory, const String& originIdentifier) = 0;
+ virtual DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier) = 0;
// Notify an input method that a composition was voluntarily discarded by WebCore, so that it could clean up too.
// This function is not called when a composition is closed per a request from an input method.
Modified: trunk/Source/WebCore/page/Frame.cpp (286704 => 286705)
--- trunk/Source/WebCore/page/Frame.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebCore/page/Frame.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -561,7 +561,7 @@
}
#endif // PLATFORM(IOS_FAMILY)
-bool Frame::requestDOMPasteAccess(DOMPasteAccessCategory pasteAccessCategory)
+bool Frame::requestDOMPasteAccess()
{
if (m_settings->_javascript_CanAccessClipboard() && m_settings->domPasteAllowed())
return true;
@@ -589,7 +589,7 @@
if (!client)
return false;
- auto response = client->requestDOMPasteAccess(pasteAccessCategory, m_doc->originIdentifierForPasteboard());
+ auto response = client->requestDOMPasteAccess(m_doc->originIdentifierForPasteboard());
gestureToken->didRequestDOMPasteAccess(response);
switch (response) {
case DOMPasteAccessResponse::GrantedForCommand:
Modified: trunk/Source/WebCore/page/Frame.h (286704 => 286705)
--- trunk/Source/WebCore/page/Frame.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebCore/page/Frame.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -176,7 +176,7 @@
bool hasHadUserInteraction() const { return m_hasHadUserInteraction; }
void setHasHadUserInteraction() { m_hasHadUserInteraction = true; }
- bool requestDOMPasteAccess(DOMPasteAccessCategory = DOMPasteAccessCategory::General);
+ bool requestDOMPasteAccess();
String debugDescription() const;
Modified: trunk/Source/WebKit/ChangeLog (286704 => 286705)
--- trunk/Source/WebKit/ChangeLog 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/ChangeLog 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1,3 +1,16 @@
+2021-12-08 Truitt Savell <tsav...@apple.com>
+
+ Unreviewed, reverting r286632.
+
+ Broke 3 tests on iOS
+
+ Reverted changeset:
+
+ "Add a `DOMPasteAccessCategory` to control which pasteboard
+ the WebProcess is granted access to when pasting"
+ https://bugs.webkit.org/show_bug.cgi?id=233939
+ https://commits.webkit.org/r286632
+
2021-12-08 Per Arne Vollan <pvol...@apple.com>
[iOS][WP] Block unused sys calls
Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (286704 => 286705)
--- trunk/Source/WebKit/Scripts/webkit/messages.py 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py 2021-12-08 20:34:03 UTC (rev 286705)
@@ -758,7 +758,6 @@
'WebCore::COOPDisposition': ['<WebCore/CrossOriginOpenerPolicy.h>'],
'WebCore::CompositeOperator': ['<WebCore/GraphicsTypes.h>'],
'WebCore::CreateNewGroupForHighlight': ['<WebCore/AppHighlight.h>'],
- 'WebCore::DOMPasteAccessCategory': ['<WebCore/DOMPasteAccess.h>'],
'WebCore::DOMPasteAccessResponse': ['<WebCore/DOMPasteAccess.h>'],
'WebCore::DestinationColorSpace': ['<WebCore/ColorSpace.h>'],
'WebCore::DisplayList::ItemBufferIdentifier': ['<WebCore/DisplayList.h>'],
Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -548,7 +548,7 @@
}
#endif
-void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
Modified: trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -160,7 +160,7 @@
void isPlayingAudioWillChange() final { }
void isPlayingAudioDidChange() final { }
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
#if ENABLE(VIDEO) && USE(GSTREAMER)
bool decidePolicyForInstallMissingMediaPluginsPermissionRequest(InstallMissingMediaPluginsPermissionRequest&) override;
Modified: trunk/Source/WebKit/UIProcess/API/mac/WKView.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/API/mac/WKView.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/API/mac/WKView.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -912,6 +912,11 @@
return _data->_impl->namesOfPromisedFilesDroppedAtDestination(dropDestination);
}
+- (void)_web_grantDOMPasteAccess
+{
+ _data->_impl->handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::GrantedForGesture);
+}
+
- (void)maybeInstallIconLoadingClient
{
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
Modified: trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1232,6 +1232,11 @@
[self _gestureEventWasNotHandledByWebCore:event];
}
+- (void)_web_grantDOMPasteAccess
+{
+ _impl->handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::GrantedForGesture);
+}
+
- (void)_takeFindStringFromSelectionInternal:(id)sender
{
[self takeFindStringFromSelection:sender];
Modified: trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -415,7 +415,7 @@
#endif // ENABLE(FULLSCREEN_API)
-void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
Modified: trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -36,7 +36,6 @@
}
namespace WebCore {
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
}
@@ -159,7 +158,7 @@
#endif
IPC::Attachment hostFileDescriptor() final;
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -135,6 +135,8 @@
- (void)_web_didPerformDragOperation:(BOOL)handled;
#endif
+- (void)_web_grantDOMPasteAccess;
+
@optional
- (void)_web_didAddMediaControlsManager:(id)controlsManager;
- (void)_web_didRemoveMediaControlsManager;
@@ -650,10 +652,9 @@
void takeFocus(WebCore::FocusDirection);
void clearPromisedDragImage();
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
- void handleDOMPasteRequestForCategoryWithResult(WebCore::DOMPasteAccessCategory, WebCore::DOMPasteAccessResponse);
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
+ void handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse);
NSMenu *domPasteMenu() const { return m_domPasteMenu.get(); }
- void hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse);
#if HAVE(TRANSLATION_UI_SERVICES) && ENABLE(CONTEXT_MENUS)
bool canHandleContextMenuTranslation() const;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1007,21 +1007,19 @@
@end
@interface WKDOMPasteMenuDelegate : NSObject<NSMenuDelegate>
-- (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl pasteAccessCategory:(WebCore::DOMPasteAccessCategory)category;
+- (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl;
@end
@implementation WKDOMPasteMenuDelegate {
WeakPtr<WebKit::WebViewImpl> _impl;
- WebCore::DOMPasteAccessCategory _category;
}
-- (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl pasteAccessCategory:(WebCore::DOMPasteAccessCategory)category
+- (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl
{
if (!(self = [super init]))
return nil;
_impl = impl;
- _category = category;
return self;
}
@@ -1029,7 +1027,7 @@
{
RunLoop::main().dispatch([impl = _impl] {
if (impl)
- impl->hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);
+ impl->handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);
});
}
@@ -1045,11 +1043,6 @@
return confinementRect;
}
-- (void)_web_grantDOMPasteAccess
-{
- _impl->handleDOMPasteRequestForCategoryWithResult(_category, WebCore::DOMPasteAccessResponse::GrantedForGesture);
-}
-
@end
namespace WebKit {
@@ -1610,7 +1603,7 @@
updateRemoteAccessibilityRegistration(false);
- hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);
+ handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
void WebViewImpl::processWillSwap()
@@ -4585,58 +4578,34 @@
return @[[path lastPathComponent]];
}
-static NSPasteboardName pasteboardNameForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory)
+void WebViewImpl::requestDOMPasteAccess(const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion)
{
- switch (pasteAccessCategory) {
- case WebCore::DOMPasteAccessCategory::General:
- return NSPasteboardNameGeneral;
- }
-}
-
-static NSPasteboard *pasteboardForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory)
-{
- switch (pasteAccessCategory) {
- case WebCore::DOMPasteAccessCategory::General:
- return NSPasteboard.generalPasteboard;
- }
-}
-
-void WebViewImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion)
-{
ASSERT(!m_domPasteRequestHandler);
- hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);
+ handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);
- NSData *data = "" dataForType:@(WebCore::PasteboardCustomData::cocoaType())];
+ NSData *data = "" dataForType:@(WebCore::PasteboardCustomData::cocoaType())];
auto buffer = WebCore::SharedBuffer::create(data);
if (WebCore::PasteboardCustomData::fromSharedBuffer(buffer.get()).origin() == originIdentifier) {
- m_page->grantAccessToCurrentPasteboardData(pasteboardNameForAccessCategory(pasteAccessCategory));
+ m_page->grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral);
completion(WebCore::DOMPasteAccessResponse::GrantedForGesture);
return;
}
- m_domPasteMenuDelegate = adoptNS([[WKDOMPasteMenuDelegate alloc] initWithWebViewImpl:*this pasteAccessCategory:pasteAccessCategory]);
+ m_domPasteMenuDelegate = adoptNS([[WKDOMPasteMenuDelegate alloc] initWithWebViewImpl:*this]);
m_domPasteRequestHandler = WTFMove(completion);
m_domPasteMenu = adoptNS([[NSMenu alloc] initWithTitle:WebCore::contextMenuItemTagPaste()]);
[m_domPasteMenu setDelegate:m_domPasteMenuDelegate.get()];
[m_domPasteMenu setAllowsContextMenuPlugIns:NO];
-
- auto pasteMenuItem = RetainPtr([m_domPasteMenu insertItemWithTitle:WebCore::contextMenuItemTagPaste() action:@selector(_web_grantDOMPasteAccess) keyEquivalent:emptyString() atIndex:0]);
- [pasteMenuItem setTarget:m_domPasteMenuDelegate.get()];
-
+ [m_domPasteMenu insertItemWithTitle:WebCore::contextMenuItemTagPaste() action:@selector(_web_grantDOMPasteAccess) keyEquivalent:emptyString() atIndex:0];
[NSMenu popUpContextMenu:m_domPasteMenu.get() withEvent:m_lastMouseDownEvent.get() forView:m_view.getAutoreleased()];
}
-void WebViewImpl::handleDOMPasteRequestForCategoryWithResult(WebCore::DOMPasteAccessCategory pasteAccessCategory, WebCore::DOMPasteAccessResponse response)
+void WebViewImpl::handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse response)
{
if (response == WebCore::DOMPasteAccessResponse::GrantedForCommand || response == WebCore::DOMPasteAccessResponse::GrantedForGesture)
- m_page->grantAccessToCurrentPasteboardData(pasteboardNameForAccessCategory(pasteAccessCategory));
+ m_page->grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral);
- hideDOMPasteMenuWithResult(response);
-}
-
-void WebViewImpl::hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse response)
-{
if (auto handler = std::exchange(m_domPasteRequestHandler, { }))
handler(response);
[m_domPasteMenu removeAllItems];
Modified: trunk/Source/WebKit/UIProcess/PageClient.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/PageClient.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/PageClient.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -110,7 +110,6 @@
enum class ScrollbarStyle : uint8_t;
enum class TextIndicatorLifetime : uint8_t;
enum class TextIndicatorDismissalAnimation : uint8_t;
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
enum class ScrollIsAnimated : uint8_t;
@@ -600,7 +599,7 @@
virtual void didChangeDragCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) = 0;
#endif
- virtual void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) = 0;
+ virtual void requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) = 0;
#if ENABLE(ATTACHMENT_ELEMENT)
virtual void didInsertAttachment(API::Attachment&, const String& source) { }
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -2510,20 +2510,15 @@
send(Messages::WebPage::SelectAll());
}
-static std::optional<DOMPasteAccessCategory> pasteAccessCategoryForCommand(const String& commandName)
+static bool isPasteCommandName(const String& commandName)
{
- static NeverDestroyed<HashMap<String, DOMPasteAccessCategory, ASCIICaseInsensitiveHash>> pasteCommandNames = HashMap<String, DOMPasteAccessCategory, ASCIICaseInsensitiveHash> {
- { "Paste", DOMPasteAccessCategory::General },
- { "PasteAndMatchStyle", DOMPasteAccessCategory::General },
- { "PasteAsQuotation", DOMPasteAccessCategory::General },
- { "PasteAsPlainText", DOMPasteAccessCategory::General },
+ static NeverDestroyed<HashSet<String, ASCIICaseInsensitiveHash>> pasteCommandNames = HashSet<String, ASCIICaseInsensitiveHash> {
+ "Paste",
+ "PasteAndMatchStyle",
+ "PasteAsQuotation",
+ "PasteAsPlainText"
};
-
- auto it = pasteCommandNames->find(commandName);
- if (it != pasteCommandNames->end())
- return it->value;
-
- return std::nullopt;
+ return pasteCommandNames->contains(commandName);
}
void WebPageProxy::executeEditCommand(const String& commandName, const String& argument, CompletionHandler<void()>&& callbackFunction)
@@ -2533,8 +2528,8 @@
return;
}
- if (auto pasteAccessCategory = pasteAccessCategoryForCommand(commandName))
- willPerformPasteCommand(*pasteAccessCategory);
+ if (isPasteCommandName(commandName))
+ willPerformPasteCommand();
sendWithAsyncReply(Messages::WebPage::ExecuteEditCommandWithCallback(commandName, argument), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::executeEditCommand"_s)] () mutable {
callbackFunction();
@@ -2548,8 +2543,8 @@
if (!hasRunningProcess())
return;
- if (auto pasteAccessCategory = pasteAccessCategoryForCommand(commandName))
- willPerformPasteCommand(*pasteAccessCategory);
+ if (isPasteCommandName(commandName))
+ willPerformPasteCommand();
if (commandName == ignoreSpellingCommandName)
++m_pendingLearnOrIgnoreWordMessageCount;
@@ -6616,9 +6611,9 @@
#endif
-void WebPageProxy::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
+void WebPageProxy::requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
- m_pageClient->requestDOMPasteAccess(pasteAccessCategory, elementRect, originIdentifier, WTFMove(completionHandler));
+ m_pageClient->requestDOMPasteAccess(elementRect, originIdentifier, WTFMove(completionHandler));
}
// BackForwardList
@@ -10819,7 +10814,7 @@
#if !PLATFORM(COCOA)
-void WebPageProxy::willPerformPasteCommand(DOMPasteAccessCategory)
+void WebPageProxy::willPerformPasteCommand()
{
}
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -267,7 +267,6 @@
enum class AutoplayEvent : uint8_t;
enum class CookieConsentDecisionResult : uint8_t;
enum class CreateNewGroupForHighlight : bool;
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
enum class EventMakesGamepadsVisible : bool;
enum class LockBackForwardList : bool;
@@ -2261,8 +2260,8 @@
void setIsNeverRichlyEditableForTouchBar(bool);
#endif
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
- void willPerformPasteCommand(WebCore::DOMPasteAccessCategory);
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);
+ void willPerformPasteCommand();
// Back/Forward list management
void backForwardAddItem(BackForwardListItemState&&);
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2021-12-08 20:34:03 UTC (rev 286705)
@@ -232,7 +232,7 @@
SetIsNeverRichlyEditableForTouchBar(bool isNeverRichlyEditable)
#endif
- RequestDOMPasteAccess(enum:uint8_t WebCore::DOMPasteAccessCategory pasteAccessCategory, WebCore::IntRect elementRect, String originIdentifier) -> (enum:uint8_t WebCore::DOMPasteAccessResponse response) Synchronous
+ RequestDOMPasteAccess(WebCore::IntRect elementRect, String originIdentifier) -> (enum:uint8_t WebCore::DOMPasteAccessResponse response) Synchronous
# Find messages
DidCountStringMatches(String string, uint32_t matchCount)
Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -38,7 +38,6 @@
OBJC_CLASS WKEditorUndoTarget;
namespace WebCore {
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
struct PromisedAttachmentInfo;
}
@@ -267,7 +266,7 @@
void requestPasswordForQuickLookDocument(const String& fileName, WTF::Function<void(const String&)>&&) override;
#endif
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect& elementRect, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
#if ENABLE(DRAG_SUPPORT)
void didPerformDragOperation(bool handled) override;
Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -951,9 +951,9 @@
}
#endif
-void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
- [m_contentView _requestDOMPasteAccessForCategory:pasteAccessCategory elementRect:elementRect originIdentifier:originIdentifier completionHandler:WTFMove(completionHandler)];
+ [m_contentView _requestDOMPasteAccessWithElementRect:elementRect originIdentifier:originIdentifier completionHandler:WTFMove(completionHandler)];
}
void PageClientImpl::cancelPointersForGestureRecognizer(UIGestureRecognizer* gestureRecognizer)
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -90,7 +90,6 @@
struct PromisedAttachmentInfo;
struct ShareDataWithParsedURL;
struct TextRecognitionResult;
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
enum class MouseEventPolicy : uint8_t;
enum class RouteSharingPolicy : uint8_t;
@@ -676,7 +675,7 @@
- (void)updateFocusedElementSelectedIndex:(uint32_t)index allowsMultipleSelection:(bool)allowsMultipleSelection;
- (void)updateFocusedElementFocusedWithDataListDropdown:(BOOL)value;
-- (void)_requestDOMPasteAccessForCategory:(WebCore::DOMPasteAccessCategory)pasteAccessCategory elementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler;
+- (void)_requestDOMPasteAccessWithElementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler;
- (void)doAfterPositionInformationUpdate:(void (^)(WebKit::InteractionInformationAtPosition))action forRequest:(WebKit::InteractionInformationRequest)request;
- (BOOL)ensurePositionInformationIsUpToDate:(WebKit::InteractionInformationRequest)request;
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1269,7 +1269,7 @@
_suppressSelectionAssistantReasons = { };
[self _resetPanningPreventionFlags];
- [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
[self _cancelPendingKeyEventHandler];
_cachedSelectedTextRange = nil;
@@ -1658,7 +1658,7 @@
bool superDidResign = [super resignFirstResponder];
if (superDidResign) {
- [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
_page->activityStateDidChange(WebCore::ActivityState::IsFocused, WebKit::WebPageProxy::ActivityStateChangeDispatchMode::Immediate);
if (_keyWebEventHandler) {
@@ -1726,7 +1726,7 @@
_lastInteractionLocation = lastTouchEvent->locationInDocumentCoordinates;
if (lastTouchEvent->type == UIWebTouchEventTouchBegin) {
- [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
_layerTreeTransactionIdAtLastInteractionStart = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).lastCommittedLayerTreeTransactionID();
#if ENABLE(TOUCH_EVENTS)
@@ -3990,7 +3990,7 @@
- (void)_willHideMenu:(NSNotification *)notification
{
- [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
}
- (void)_didHideMenu:(NSNotification *)notification
@@ -4018,7 +4018,7 @@
- (void)pasteForWebView:(id)sender
{
- if (sender == UIMenuController.sharedMenuController && [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::GrantedForGesture])
+ if (sender == UIMenuController.sharedMenuController && [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::GrantedForGesture])
return;
_page->executeEditCommand("paste"_s);
@@ -4164,24 +4164,11 @@
_page->storeSelectionForAccessibility(false);
}
-static UIPasteboardName pasteboardNameForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory)
+- (BOOL)_handleDOMPasteRequestWithResult:(WebCore::DOMPasteAccessResponse)response
{
- switch (pasteAccessCategory) {
- case WebCore::DOMPasteAccessCategory::General:
- return UIPasteboardNameGeneral;
- }
-}
+ if (response == WebCore::DOMPasteAccessResponse::GrantedForCommand || response == WebCore::DOMPasteAccessResponse::GrantedForGesture)
+ _page->grantAccessToCurrentPasteboardData(UIPasteboardNameGeneral);
-static UIPasteboard *pasteboardForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory)
-{
- switch (pasteAccessCategory) {
- case WebCore::DOMPasteAccessCategory::General:
- return UIPasteboard.generalPasteboard;
- }
-}
-
-- (BOOL)_hidePasteMenuWithResult:(WebCore::DOMPasteAccessResponse)response
-{
if (auto pasteHandler = WTFMove(_domPasteRequestHandler)) {
[UIMenuController.sharedMenuController hideMenuFromView:self];
pasteHandler(response);
@@ -4190,24 +4177,16 @@
return NO;
}
-- (BOOL)_handleDOMPasteRequestForCategory:(WebCore::DOMPasteAccessCategory)pasteAccessCategory result:(WebCore::DOMPasteAccessResponse)response
-{
- if (response == WebCore::DOMPasteAccessResponse::GrantedForCommand || response == WebCore::DOMPasteAccessResponse::GrantedForGesture)
- _page->grantAccessToCurrentPasteboardData(pasteboardNameForAccessCategory(pasteAccessCategory));
-
- return [self _hidePasteMenuWithResult:response];
-}
-
- (void)_willPerformAction:(SEL)action sender:(id)sender
{
if (action != @selector(paste:))
- [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
}
- (void)_didPerformAction:(SEL)action sender:(id)sender
{
if (action == @selector(paste:))
- [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
}
// UIWKInteractionViewProtocol
@@ -5867,7 +5846,7 @@
return;
}
- [self _hidePasteMenuWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::DeniedForGesture];
using HandledByInputMethod = WebKit::NativeWebKeyboardEvent::HandledByInputMethod;
auto* keyboard = [UIKeyboardImpl sharedInstance];
@@ -6656,7 +6635,7 @@
return foundAtLeastOneMatchingIdentifier;
}
-- (void)_requestDOMPasteAccessForCategory:(WebCore::DOMPasteAccessCategory)pasteAccessCategory elementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler
+- (void)_requestDOMPasteAccessWithElementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler
{
if (auto existingCompletionHandler = std::exchange(_domPasteRequestHandler, WTFMove(completionHandler))) {
ASSERT_NOT_REACHED();
@@ -6663,8 +6642,8 @@
existingCompletionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
- if (allPasteboardItemOriginsMatchOrigin(pasteboardForAccessCategory(pasteAccessCategory), originIdentifier)) {
- [self _handleDOMPasteRequestForCategory:pasteAccessCategory result:WebCore::DOMPasteAccessResponse::GrantedForCommand];
+ if (allPasteboardItemOriginsMatchOrigin(UIPasteboard.generalPasteboard, originIdentifier)) {
+ [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::GrantedForCommand];
return;
}
Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1544,13 +1544,9 @@
}
#endif
-void WebPageProxy::willPerformPasteCommand(DOMPasteAccessCategory pasteAccessCategory)
+void WebPageProxy::willPerformPasteCommand()
{
- switch (pasteAccessCategory) {
- case DOMPasteAccessCategory::General:
- grantAccessToCurrentPasteboardData(UIPasteboardNameGeneral);
- return;
- }
+ grantAccessToCurrentPasteboardData(UIPasteboardNameGeneral);
}
void WebPageProxy::setDeviceHasAGXCompilerServiceForTesting() const
Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -225,7 +225,7 @@
void willRecordNavigationSnapshot(WebBackForwardListItem&) override;
void didRemoveNavigationGestureSnapshot() override;
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
void makeViewBlank(bool) final;
Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1000,9 +1000,9 @@
m_impl->takeFocus(direction);
}
-void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion)
+void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion)
{
- m_impl->requestDOMPasteAccess(pasteAccessCategory, elementRect, originIdentifier, WTFMove(completion));
+ m_impl->requestDOMPasteAccess(elementRect, originIdentifier, WTFMove(completion));
}
Modified: trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm 2021-12-08 20:34:03 UTC (rev 286705)
@@ -651,13 +651,9 @@
#endif
-void WebPageProxy::willPerformPasteCommand(DOMPasteAccessCategory pasteAccessCategory)
+void WebPageProxy::willPerformPasteCommand()
{
- switch (pasteAccessCategory) {
- case DOMPasteAccessCategory::General:
- grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral);
- return;
- }
+ grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral);
}
PlatformView* WebPageProxy::platformView() const
Modified: trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.cpp (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -317,7 +317,7 @@
return WebCore::UserInterfaceLayoutDirection::LTR;
}
-void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
Modified: trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -149,7 +149,7 @@
WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) override;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) override;
PlayStationWebView& m_view;
};
Modified: trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -373,7 +373,7 @@
return m_view.window();
}
-void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
+void PageClientImpl::requestDOMPasteAccess(const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)
{
completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture);
}
Modified: trunk/Source/WebKit/UIProcess/win/PageClientImpl.h (286704 => 286705)
--- trunk/Source/WebKit/UIProcess/win/PageClientImpl.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/UIProcess/win/PageClientImpl.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -35,7 +35,6 @@
#include <WebCore/IntSize.h>
namespace WebCore {
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
}
@@ -149,7 +148,7 @@
WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; }
- void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
+ void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
// Members of PageClientImpl class
DefaultUndoController m_undoController;
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp (286704 => 286705)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -332,9 +332,9 @@
m_page->sendSync(Messages::WebPageProxy::ExecuteUndoRedo(UndoOrRedo::Redo), Messages::WebPageProxy::ExecuteUndoRedo::Reply());
}
-WebCore::DOMPasteAccessResponse WebEditorClient::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const String& originIdentifier)
+WebCore::DOMPasteAccessResponse WebEditorClient::requestDOMPasteAccess(const String& originIdentifier)
{
- return m_page->requestDOMPasteAccess(pasteAccessCategory, originIdentifier);
+ return m_page->requestDOMPasteAccess(originIdentifier);
}
#if !PLATFORM(COCOA) && !USE(GLIB)
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h (286704 => 286705)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -29,7 +29,6 @@
#include <WebCore/TextCheckerClient.h>
namespace WebCore {
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
}
@@ -94,7 +93,7 @@
void registerRedoStep(WebCore::UndoStep&) final;
void clearUndoRedoOperations() final;
- WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String& originIdentifier) final;
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier) final;
bool canCopyCut(WebCore::Frame*, bool defaultValue) const final;
bool canPaste(WebCore::Frame*, bool defaultValue) const final;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (286704 => 286705)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2021-12-08 20:34:03 UTC (rev 286705)
@@ -7207,7 +7207,7 @@
sendWithAsyncReply(Messages::WebPageProxy::ShowContactPicker(requestData), WTFMove(callback));
}
-WebCore::DOMPasteAccessResponse WebPage::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const String& originIdentifier)
+WebCore::DOMPasteAccessResponse WebPage::requestDOMPasteAccess(const String& originIdentifier)
{
auto response = WebCore::DOMPasteAccessResponse::DeniedForGesture;
#if PLATFORM(IOS_FAMILY)
@@ -7217,7 +7217,7 @@
// should be removed once <rdar://problem/16207002> is resolved.
send(Messages::WebPageProxy::HandleAutocorrectionContext(autocorrectionContext()));
#endif
- sendSyncWithDelayedReply(Messages::WebPageProxy::RequestDOMPasteAccess(pasteAccessCategory, rectForElementAtInteractionLocation(), originIdentifier), Messages::WebPageProxy::RequestDOMPasteAccess::Reply(response));
+ sendSyncWithDelayedReply(Messages::WebPageProxy::RequestDOMPasteAccess(rectForElementAtInteractionLocation(), originIdentifier), Messages::WebPageProxy::RequestDOMPasteAccess::Reply(response));
return response;
}
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (286704 => 286705)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -224,7 +224,6 @@
enum SyntheticClickType : int8_t;
enum class COEPDisposition : bool;
enum class CreateNewGroupForHighlight : bool;
-enum class DOMPasteAccessCategory : uint8_t;
enum class DOMPasteAccessResponse : uint8_t;
enum class DragApplicationFlags : uint8_t;
enum class DragHandlingMethod : uint8_t;
@@ -1340,7 +1339,7 @@
return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), sendSyncOptions);
}
- WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String& originIdentifier);
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String& originIdentifier);
WebCore::IntRect rectForElementAtInteractionLocation() const;
const std::optional<WebCore::Color>& backgroundColor() const { return m_backgroundColor; }
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (286704 => 286705)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1,3 +1,16 @@
+2021-12-08 Truitt Savell <tsav...@apple.com>
+
+ Unreviewed, reverting r286632.
+
+ Broke 3 tests on iOS
+
+ Reverted changeset:
+
+ "Add a `DOMPasteAccessCategory` to control which pasteboard
+ the WebProcess is granted access to when pasting"
+ https://bugs.webkit.org/show_bug.cgi?id=233939
+ https://commits.webkit.org/r286632
+
2021-12-07 Wenson Hsieh <wenson_hs...@apple.com>
Add support for `navigator.requestCookieConsent()` behind a disabled feature flag
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h (286704 => 286705)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -83,7 +83,7 @@
void getClientPasteboardData(const std::optional<WebCore::SimpleRange>&, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) final;
void setInsertionPasteboard(const String&) final;
- WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }
#if USE(APPKIT)
void uppercaseWord() final;
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (286704 => 286705)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2021-12-08 20:34:03 UTC (rev 286705)
@@ -1,3 +1,16 @@
+2021-12-08 Truitt Savell <tsav...@apple.com>
+
+ Unreviewed, reverting r286632.
+
+ Broke 3 tests on iOS
+
+ Reverted changeset:
+
+ "Add a `DOMPasteAccessCategory` to control which pasteboard
+ the WebProcess is granted access to when pasting"
+ https://bugs.webkit.org/show_bug.cgi?id=233939
+ https://commits.webkit.org/r286632
+
2021-12-07 Wenson Hsieh <wenson_hs...@apple.com>
Add support for `navigator.requestCookieConsent()` behind a disabled feature flag
Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h (286704 => 286705)
--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h 2021-12-08 20:31:41 UTC (rev 286704)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h 2021-12-08 20:34:03 UTC (rev 286705)
@@ -117,7 +117,7 @@
void requestCheckingOfString(WebCore::TextCheckingRequest&, const WebCore::VisibleSelection&) final { }
bool performTwoStepDrop(WebCore::DocumentFragment&, const WebCore::SimpleRange&, bool) final { return false; }
- WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }
+ WebCore::DOMPasteAccessResponse requestDOMPasteAccess(const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }
WebCore::TextCheckerClient* textChecker() final { return this; }