Changeset 286825 in webkit
- Timestamp:
- Dec 9, 2021, 7:08:53 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 40 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/dom/DOMPasteAccess.h (modified) (2 diffs)
-
WebCore/loader/EmptyClients.cpp (modified) (1 diff)
-
WebCore/page/EditorClient.h (modified) (2 diffs)
-
WebCore/page/Frame.cpp (modified) (2 diffs)
-
WebCore/page/Frame.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Scripts/webkit/messages.py (modified) (1 diff)
-
WebKit/UIProcess/API/gtk/PageClientImpl.cpp (modified) (1 diff)
-
WebKit/UIProcess/API/gtk/PageClientImpl.h (modified) (1 diff)
-
WebKit/UIProcess/API/mac/WKView.mm (modified) (1 diff)
-
WebKit/UIProcess/API/mac/WKWebViewMac.mm (modified) (1 diff)
-
WebKit/UIProcess/API/wpe/PageClientImpl.cpp (modified) (1 diff)
-
WebKit/UIProcess/API/wpe/PageClientImpl.h (modified) (2 diffs)
-
WebKit/UIProcess/Cocoa/WebViewImpl.h (modified) (2 diffs)
-
WebKit/UIProcess/Cocoa/WebViewImpl.mm (modified) (7 diffs)
-
WebKit/UIProcess/PageClient.h (modified) (2 diffs)
-
WebKit/UIProcess/WebPageProxy.cpp (modified) (5 diffs)
-
WebKit/UIProcess/WebPageProxy.h (modified) (2 diffs)
-
WebKit/UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
WebKit/UIProcess/ios/PageClientImplIOS.h (modified) (2 diffs)
-
WebKit/UIProcess/ios/PageClientImplIOS.mm (modified) (1 diff)
-
WebKit/UIProcess/ios/WKContentViewInteraction.h (modified) (3 diffs)
-
WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (3 diffs)
-
WebKit/UIProcess/ios/WebPageProxyIOS.mm (modified) (1 diff)
-
WebKit/UIProcess/mac/PageClientImplMac.h (modified) (1 diff)
-
WebKit/UIProcess/mac/PageClientImplMac.mm (modified) (1 diff)
-
WebKit/UIProcess/mac/WebPageProxyMac.mm (modified) (1 diff)
-
WebKit/UIProcess/playstation/PageClientImpl.cpp (modified) (1 diff)
-
WebKit/UIProcess/playstation/PageClientImpl.h (modified) (1 diff)
-
WebKit/UIProcess/win/PageClientImpl.cpp (modified) (1 diff)
-
WebKit/UIProcess/win/PageClientImpl.h (modified) (2 diffs)
-
WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp (modified) (1 diff)
-
WebKit/WebProcess/WebCoreSupport/WebEditorClient.h (modified) (2 diffs)
-
WebKit/WebProcess/WebPage/WebPage.cpp (modified) (2 diffs)
-
WebKit/WebProcess/WebPage/WebPage.h (modified) (2 diffs)
-
WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h (modified) (1 diff)
-
WebKitLegacy/win/ChangeLog (modified) (1 diff)
-
WebKitLegacy/win/WebCoreSupport/WebEditorClient.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r286824 r286825 1 2021-12-09 Devin Rousso <drousso@apple.com> 2 3 Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting 4 https://bugs.webkit.org/show_bug.cgi?id=233939 5 6 Reviewed by Wenson Hsieh. 7 8 Implementing `-pasteFont:` <https://webkit.org/b/191379> requires that we read from the font 9 pasteboard instead of the general pasteboard. In order to allow web content to trigger this 10 (e.g. `document.execCommand("PasteFont"))`) we must have a way for the WebProcess to signal 11 that it wishes to read from the font pasteboard instead of the general pasteboard. As such, 12 create and pass along a `DOMPasteAccessCategory` to `requestDOMPasteAccess`. 13 14 No change in behavior. 15 16 * dom/DOMPasteAccess.h: 17 Create `DOMPasteAccessCategory`. 18 19 * page/EditorClient.h: 20 * page/Frame.h: 21 * page/Frame.cpp: 22 (WebCore::Frame::requestDOMPasteAccess): 23 * loader/EmptyClients.cpp: 24 (WebCore::EmptyEditorClient::requestDOMPasteAccess): 25 Pass along the `DOMPasteAccessCategory`. 26 1 27 2021-12-09 Said Abou-Hallawa <said@apple.com> 2 28 -
trunk/Source/WebCore/dom/DOMPasteAccess.h
r286705 r286825 30 30 namespace WebCore { 31 31 32 enum class DOMPasteAccessCategory : uint8_t { 33 General, 34 }; 35 32 36 enum class DOMPasteAccessPolicy : uint8_t { 33 37 NotRequestedYet, … … 46 50 namespace WTF { 47 51 52 template<> struct EnumTraits<WebCore::DOMPasteAccessCategory> { 53 using values = EnumValues< 54 WebCore::DOMPasteAccessCategory, 55 WebCore::DOMPasteAccessCategory::General 56 >; 57 }; 58 48 59 template<> struct EnumTraits<WebCore::DOMPasteAccessResponse> { 49 60 using values = EnumValues< -
trunk/Source/WebCore/loader/EmptyClients.cpp
r286705 r286825 287 287 void clearUndoRedoOperations() final { } 288 288 289 DOMPasteAccessResponse requestDOMPasteAccess( const String&) final { return DOMPasteAccessResponse::DeniedForGesture; }289 DOMPasteAccessResponse requestDOMPasteAccess(DOMPasteAccessCategory, const String&) final { return DOMPasteAccessResponse::DeniedForGesture; } 290 290 291 291 bool canCopyCut(Frame*, bool defaultValue) const final { return defaultValue; } -
trunk/Source/WebCore/page/EditorClient.h
r286705 r286825 37 37 namespace WebCore { 38 38 39 enum class DOMPasteAccessCategory : uint8_t; 39 40 enum class DOMPasteAccessResponse : uint8_t; 40 41 … … 102 103 virtual void handleAcceptedCandidateWithSoftSpaces(TextCheckingResult) { } 103 104 104 virtual DOMPasteAccessResponse requestDOMPasteAccess( const String& originIdentifier) = 0;105 virtual DOMPasteAccessResponse requestDOMPasteAccess(DOMPasteAccessCategory, const String& originIdentifier) = 0; 105 106 106 107 // Notify an input method that a composition was voluntarily discarded by WebCore, so that it could clean up too. -
trunk/Source/WebCore/page/Frame.cpp
r286705 r286825 562 562 #endif // PLATFORM(IOS_FAMILY) 563 563 564 bool Frame::requestDOMPasteAccess( )564 bool Frame::requestDOMPasteAccess(DOMPasteAccessCategory pasteAccessCategory) 565 565 { 566 566 if (m_settings->javaScriptCanAccessClipboard() && m_settings->domPasteAllowed()) … … 590 590 return false; 591 591 592 auto response = client->requestDOMPasteAccess( m_doc->originIdentifierForPasteboard());592 auto response = client->requestDOMPasteAccess(pasteAccessCategory, m_doc->originIdentifierForPasteboard()); 593 593 gestureToken->didRequestDOMPasteAccess(response); 594 594 switch (response) { -
trunk/Source/WebCore/page/Frame.h
r286705 r286825 177 177 void setHasHadUserInteraction() { m_hasHadUserInteraction = true; } 178 178 179 bool requestDOMPasteAccess( );179 bool requestDOMPasteAccess(DOMPasteAccessCategory = DOMPasteAccessCategory::General); 180 180 181 181 String debugDescription() const; -
trunk/Source/WebKit/ChangeLog
r286824 r286825 1 2021-12-09 Devin Rousso <drousso@apple.com> 2 3 Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting 4 https://bugs.webkit.org/show_bug.cgi?id=233939 5 6 Reviewed by Wenson Hsieh. 7 8 Implementing `-pasteFont:` <https://webkit.org/b/191379> requires that we read from the font 9 pasteboard instead of the general pasteboard. In order to allow web content to trigger this 10 (e.g. `document.execCommand("PasteFont"))`) we must have a way for the WebProcess to signal 11 that it wishes to read from the font pasteboard instead of the general pasteboard. As such, 12 create and pass along a `DOMPasteAccessCategory` to `requestDOMPasteAccess`. 13 14 No change in behavior. 15 16 * Scripts/webkit/messages.py: 17 (headers_for_type): 18 Indicate which header is associated with `DOMPasteAccessCategory`. 19 20 * UIProcess/Cocoa/WebViewImpl.h: 21 * UIProcess/Cocoa/WebViewImpl.mm: 22 (-[WKDOMPasteMenuDelegate initWithWebViewImpl:pasteAccessCategory:]): Added. 23 (-[WKDOMPasteMenuDelegate menuDidClose:]): 24 (-[WKDOMPasteMenuDelegate _web_grantDOMPasteAccess]): Added. 25 (WebKit::WebViewImpl::handleProcessSwapOrExit): 26 (WebKit::pasteboardNameForAccessCategory): Added. 27 (WebKit::pasteboardForAccessCategory): Added. 28 (WebKit::WebViewImpl::requestDOMPasteAccess): 29 (WebKit::WebViewImpl::handleDOMPasteRequestForCategoryWithResult): 30 (WebKit::WebViewImpl::hideDOMPasteMenuWithResult): Added. 31 (-[WKDOMPasteMenuDelegate initWithWebViewImpl:]): Deleted. 32 (WebKit::WebViewImpl::handleDOMPasteRequestWithResult): Deleted. 33 * UIProcess/API/mac/WKView.mm: 34 (-[WKView _web_grantDOMPasteAccess]): Deleted. 35 * UIProcess/API/mac/WKWebViewMac.mm: 36 (-[WKWebView _web_grantDOMPasteAccess]): Deleted. 37 Pass the `DOMPasteAccessCategory` to the `WKDOMPasteMenuDelegate` and use it as the `target` 38 of the `NSMenuItem` so that we can pass along the `DOMPasteAccessCategory` in the `action`. 39 40 * UIProcess/ios/WKContentViewInteraction.h: 41 * UIProcess/ios/WKContentViewInteraction.mm: 42 (pasteboardNameForAccessCategory): Added. 43 (pasteboardForAccessCategory): Added. 44 (-[WKContentView _handleDOMPasteRequestWithResult:]): 45 (-[WKContentView _requestDOMPasteAccessForCategory:elementRect:originIdentifier:completionHandler:]): Added. 46 (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]): Deleted. 47 * UIProcess/PageClient.h: 48 * UIProcess/API/gtk/PageClientImpl.h: 49 * UIProcess/API/gtk/PageClientImpl.cpp: 50 (WebKit::PageClientImpl::requestDOMPasteAccess): 51 * UIProcess/API/wpe/PageClientImpl.h: 52 * UIProcess/API/wpe/PageClientImpl.cpp: 53 (WebKit::PageClientImpl::requestDOMPasteAccess): 54 * UIProcess/ios/PageClientImplIOS.h: 55 * UIProcess/ios/PageClientImplIOS.mm: 56 (WebKit::PageClientImpl::requestDOMPasteAccess): 57 * UIProcess/mac/PageClientImplMac.h: 58 * UIProcess/mac/PageClientImplMac.mm: 59 (WebKit::PageClientImpl::requestDOMPasteAccess): 60 * UIProcess/playstation/PageClientImpl.h: 61 * UIProcess/playstation/PageClientImpl.cpp: 62 (WebKit::PageClientImpl::requestDOMPasteAccess): 63 * UIProcess/win/PageClientImpl.h: 64 * UIProcess/win/PageClientImpl.cpp: 65 (WebKit::PageClientImpl::requestDOMPasteAccess): 66 * WebProcess/WebCoreSupport/WebEditorClient.h: 67 * WebProcess/WebCoreSupport/WebEditorClient.cpp: 68 (WebKit::WebEditorClient::requestDOMPasteAccess): 69 * WebProcess/WebPage/WebPage.h: 70 * WebProcess/WebPage/WebPage.cpp: 71 (WebKit::WebPage::requestDOMPasteAccess): 72 Pass along the `DOMPasteAccessCategory`. 73 74 * UIProcess/WebPageProxy.messages.in: 75 * UIProcess/WebPageProxy.h: 76 * UIProcess/WebPageProxy.cpp: 77 (WebKit::pasteAccessCategoryForCommand): Added. 78 (WebKit::WebPageProxy::executeEditCommand): 79 (WebKit::WebPageProxy::requestDOMPasteAccess): 80 (WebKit::WebPageProxy::willPerformPasteCommand): 81 (WebKit::isPasteCommandName): Deleted. 82 * UIProcess/ios/WebPageProxyIOS.mm: 83 (WebKit::WebPageProxy::willPerformPasteCommand): 84 * UIProcess/mac/WebPageProxyMac.mm: 85 (WebKit::WebPageProxy::willPerformPasteCommand) 86 Create a mapping between paste command name and `DOMPasteAccessCategory`. 87 1 88 2021-12-09 Said Abou-Hallawa <said@apple.com> 2 89 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r286705 r286825 759 759 'WebCore::CompositeOperator': ['<WebCore/GraphicsTypes.h>'], 760 760 'WebCore::CreateNewGroupForHighlight': ['<WebCore/AppHighlight.h>'], 761 'WebCore::DOMPasteAccessCategory': ['<WebCore/DOMPasteAccess.h>'], 761 762 'WebCore::DOMPasteAccessResponse': ['<WebCore/DOMPasteAccess.h>'], 762 763 'WebCore::DestinationColorSpace': ['<WebCore/ColorSpace.h>'], -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
r286705 r286825 549 549 #endif 550 550 551 void PageClientImpl::requestDOMPasteAccess( const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)551 void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler) 552 552 { 553 553 completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture); -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
r286705 r286825 161 161 void isPlayingAudioDidChange() final { } 162 162 163 void requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;163 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; 164 164 165 165 #if ENABLE(VIDEO) && USE(GSTREAMER) -
trunk/Source/WebKit/UIProcess/API/mac/WKView.mm
r286705 r286825 913 913 } 914 914 915 - (void)_web_grantDOMPasteAccess916 {917 _data->_impl->handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::GrantedForGesture);918 }919 920 915 - (void)maybeInstallIconLoadingClient 921 916 { -
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
r286705 r286825 1233 1233 } 1234 1234 1235 - (void)_web_grantDOMPasteAccess1236 {1237 _impl->handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::GrantedForGesture);1238 }1239 1240 1235 - (void)_takeFindStringFromSelectionInternal:(id)sender 1241 1236 { -
trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp
r286705 r286825 416 416 #endif // ENABLE(FULLSCREEN_API) 417 417 418 void PageClientImpl::requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)418 void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler) 419 419 { 420 420 completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture); -
trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
r286705 r286825 37 37 38 38 namespace WebCore { 39 enum class DOMPasteAccessCategory : uint8_t; 39 40 enum class DOMPasteAccessResponse : uint8_t; 40 41 } … … 159 160 160 161 IPC::Attachment hostFileDescriptor() final; 161 void requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;162 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; 162 163 163 164 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override; -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
r286705 r286825 136 136 #endif 137 137 138 - (void)_web_grantDOMPasteAccess;139 140 138 @optional 141 139 - (void)_web_didAddMediaControlsManager:(id)controlsManager; … … 653 651 void clearPromisedDragImage(); 654 652 655 void requestDOMPasteAccess( const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);656 void handleDOMPasteRequest WithResult(WebCore::DOMPasteAccessResponse);653 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&); 654 void handleDOMPasteRequestForCategoryWithResult(WebCore::DOMPasteAccessCategory, WebCore::DOMPasteAccessResponse); 657 655 NSMenu *domPasteMenu() const { return m_domPasteMenu.get(); } 656 void hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse); 658 657 659 658 #if HAVE(TRANSLATION_UI_SERVICES) && ENABLE(CONTEXT_MENUS) -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r286705 r286825 1008 1008 1009 1009 @interface WKDOMPasteMenuDelegate : NSObject<NSMenuDelegate> 1010 - (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl ;1010 - (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl pasteAccessCategory:(WebCore::DOMPasteAccessCategory)category; 1011 1011 @end 1012 1012 1013 1013 @implementation WKDOMPasteMenuDelegate { 1014 1014 WeakPtr<WebKit::WebViewImpl> _impl; 1015 } 1016 1017 - (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl 1015 WebCore::DOMPasteAccessCategory _category; 1016 } 1017 1018 - (instancetype)initWithWebViewImpl:(WebKit::WebViewImpl&)impl pasteAccessCategory:(WebCore::DOMPasteAccessCategory)category 1018 1019 { 1019 1020 if (!(self = [super init])) … … 1021 1022 1022 1023 _impl = impl; 1024 _category = category; 1023 1025 return self; 1024 1026 } … … 1028 1030 RunLoop::main().dispatch([impl = _impl] { 1029 1031 if (impl) 1030 impl->h andleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);1032 impl->hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture); 1031 1033 }); 1032 1034 } … … 1042 1044 confinementRect.move(0, -confinementRect.height()); 1043 1045 return confinementRect; 1046 } 1047 1048 - (void)_web_grantDOMPasteAccess 1049 { 1050 _impl->handleDOMPasteRequestForCategoryWithResult(_category, WebCore::DOMPasteAccessResponse::GrantedForGesture); 1044 1051 } 1045 1052 … … 1604 1611 updateRemoteAccessibilityRegistration(false); 1605 1612 1606 h andleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);1613 hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture); 1607 1614 } 1608 1615 … … 4579 4586 } 4580 4587 4581 void WebViewImpl::requestDOMPasteAccess(const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion) 4588 static NSPasteboardName pasteboardNameForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory) 4589 { 4590 switch (pasteAccessCategory) { 4591 case WebCore::DOMPasteAccessCategory::General: 4592 return NSPasteboardNameGeneral; 4593 } 4594 } 4595 4596 static NSPasteboard *pasteboardForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory) 4597 { 4598 switch (pasteAccessCategory) { 4599 case WebCore::DOMPasteAccessCategory::General: 4600 return NSPasteboard.generalPasteboard; 4601 } 4602 } 4603 4604 void WebViewImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect&, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion) 4582 4605 { 4583 4606 ASSERT(!m_domPasteRequestHandler); 4584 h andleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture);4585 4586 NSData *data = [ NSPasteboard.generalPasteboarddataForType:@(WebCore::PasteboardCustomData::cocoaType())];4607 hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture); 4608 4609 NSData *data = [pasteboardForAccessCategory(pasteAccessCategory) dataForType:@(WebCore::PasteboardCustomData::cocoaType())]; 4587 4610 auto buffer = WebCore::SharedBuffer::create(data); 4588 4611 if (WebCore::PasteboardCustomData::fromSharedBuffer(buffer.get()).origin() == originIdentifier) { 4589 m_page->grantAccessToCurrentPasteboardData( NSPasteboardNameGeneral);4612 m_page->grantAccessToCurrentPasteboardData(pasteboardNameForAccessCategory(pasteAccessCategory)); 4590 4613 completion(WebCore::DOMPasteAccessResponse::GrantedForGesture); 4591 4614 return; 4592 4615 } 4593 4616 4594 m_domPasteMenuDelegate = adoptNS([[WKDOMPasteMenuDelegate alloc] initWithWebViewImpl:*this ]);4617 m_domPasteMenuDelegate = adoptNS([[WKDOMPasteMenuDelegate alloc] initWithWebViewImpl:*this pasteAccessCategory:pasteAccessCategory]); 4595 4618 m_domPasteRequestHandler = WTFMove(completion); 4596 4619 m_domPasteMenu = adoptNS([[NSMenu alloc] initWithTitle:WebCore::contextMenuItemTagPaste()]); … … 4598 4621 [m_domPasteMenu setDelegate:m_domPasteMenuDelegate.get()]; 4599 4622 [m_domPasteMenu setAllowsContextMenuPlugIns:NO]; 4600 [m_domPasteMenu insertItemWithTitle:WebCore::contextMenuItemTagPaste() action:@selector(_web_grantDOMPasteAccess) keyEquivalent:emptyString() atIndex:0]; 4623 4624 auto pasteMenuItem = RetainPtr([m_domPasteMenu insertItemWithTitle:WebCore::contextMenuItemTagPaste() action:@selector(_web_grantDOMPasteAccess) keyEquivalent:emptyString() atIndex:0]); 4625 [pasteMenuItem setTarget:m_domPasteMenuDelegate.get()]; 4626 4601 4627 [NSMenu popUpContextMenu:m_domPasteMenu.get() withEvent:m_lastMouseDownEvent.get() forView:m_view.getAutoreleased()]; 4602 4628 } 4603 4629 4604 void WebViewImpl::handleDOMPasteRequest WithResult(WebCore::DOMPasteAccessResponse response)4630 void WebViewImpl::handleDOMPasteRequestForCategoryWithResult(WebCore::DOMPasteAccessCategory pasteAccessCategory, WebCore::DOMPasteAccessResponse response) 4605 4631 { 4606 4632 if (response == WebCore::DOMPasteAccessResponse::GrantedForCommand || response == WebCore::DOMPasteAccessResponse::GrantedForGesture) 4607 m_page->grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral); 4608 4633 m_page->grantAccessToCurrentPasteboardData(pasteboardNameForAccessCategory(pasteAccessCategory)); 4634 4635 hideDOMPasteMenuWithResult(response); 4636 } 4637 4638 void WebViewImpl::hideDOMPasteMenuWithResult(WebCore::DOMPasteAccessResponse response) 4639 { 4609 4640 if (auto handler = std::exchange(m_domPasteRequestHandler, { })) 4610 4641 handler(response); -
trunk/Source/WebKit/UIProcess/PageClient.h
r286705 r286825 111 111 enum class TextIndicatorLifetime : uint8_t; 112 112 enum class TextIndicatorDismissalAnimation : uint8_t; 113 enum class DOMPasteAccessCategory : uint8_t; 113 114 enum class DOMPasteAccessResponse : uint8_t; 114 115 enum class ScrollIsAnimated : uint8_t; … … 600 601 #endif 601 602 602 virtual void requestDOMPasteAccess( const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) = 0;603 virtual void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) = 0; 603 604 604 605 #if ENABLE(ATTACHMENT_ELEMENT) -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r286815 r286825 2511 2511 } 2512 2512 2513 static bool isPasteCommandName(const String& commandName)2514 { 2515 static NeverDestroyed<Hash Set<String, ASCIICaseInsensitiveHash>> pasteCommandNames = HashSet<String, ASCIICaseInsensitiveHash> {2516 "Paste",2517 "PasteAndMatchStyle",2518 "PasteAsQuotation",2519 "PasteAsPlainText"2513 static std::optional<DOMPasteAccessCategory> pasteAccessCategoryForCommand(const String& commandName) 2514 { 2515 static NeverDestroyed<HashMap<String, DOMPasteAccessCategory, ASCIICaseInsensitiveHash>> pasteCommandNames = HashMap<String, DOMPasteAccessCategory, ASCIICaseInsensitiveHash> { 2516 { "Paste", DOMPasteAccessCategory::General }, 2517 { "PasteAndMatchStyle", DOMPasteAccessCategory::General }, 2518 { "PasteAsQuotation", DOMPasteAccessCategory::General }, 2519 { "PasteAsPlainText", DOMPasteAccessCategory::General }, 2520 2520 }; 2521 return pasteCommandNames->contains(commandName); 2521 2522 auto it = pasteCommandNames->find(commandName); 2523 if (it != pasteCommandNames->end()) 2524 return it->value; 2525 2526 return std::nullopt; 2522 2527 } 2523 2528 … … 2529 2534 } 2530 2535 2531 if ( isPasteCommandName(commandName))2532 willPerformPasteCommand( );2536 if (auto pasteAccessCategory = pasteAccessCategoryForCommand(commandName)) 2537 willPerformPasteCommand(*pasteAccessCategory); 2533 2538 2534 2539 sendWithAsyncReply(Messages::WebPage::ExecuteEditCommandWithCallback(commandName, argument), [callbackFunction = WTFMove(callbackFunction), backgroundActivity = m_process->throttler().backgroundActivity("WebPageProxy::executeEditCommand"_s)] () mutable { … … 2544 2549 return; 2545 2550 2546 if ( isPasteCommandName(commandName))2547 willPerformPasteCommand( );2551 if (auto pasteAccessCategory = pasteAccessCategoryForCommand(commandName)) 2552 willPerformPasteCommand(*pasteAccessCategory); 2548 2553 2549 2554 if (commandName == ignoreSpellingCommandName) … … 6617 6622 #endif 6618 6623 6619 void WebPageProxy::requestDOMPasteAccess( const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)6620 { 6621 m_pageClient->requestDOMPasteAccess( elementRect, originIdentifier, WTFMove(completionHandler));6624 void WebPageProxy::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler) 6625 { 6626 m_pageClient->requestDOMPasteAccess(pasteAccessCategory, elementRect, originIdentifier, WTFMove(completionHandler)); 6622 6627 } 6623 6628 … … 10823 10828 #if !PLATFORM(COCOA) 10824 10829 10825 void WebPageProxy::willPerformPasteCommand( )10830 void WebPageProxy::willPerformPasteCommand(DOMPasteAccessCategory) 10826 10831 { 10827 10832 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r286751 r286825 268 268 enum class CookieConsentDecisionResult : uint8_t; 269 269 enum class CreateNewGroupForHighlight : bool; 270 enum class DOMPasteAccessCategory : uint8_t; 270 271 enum class DOMPasteAccessResponse : uint8_t; 271 272 enum class EventMakesGamepadsVisible : bool; … … 2262 2263 #endif 2263 2264 2264 void requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&);2265 void willPerformPasteCommand( );2265 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&); 2266 void willPerformPasteCommand(WebCore::DOMPasteAccessCategory); 2266 2267 2267 2268 // Back/Forward list management -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r286705 r286825 233 233 #endif 234 234 235 RequestDOMPasteAccess( WebCore::IntRect elementRect, String originIdentifier) -> (enum:uint8_t WebCore::DOMPasteAccessResponse response) Synchronous235 RequestDOMPasteAccess(enum:uint8_t WebCore::DOMPasteAccessCategory pasteAccessCategory, WebCore::IntRect elementRect, String originIdentifier) -> (enum:uint8_t WebCore::DOMPasteAccessResponse response) Synchronous 236 236 237 237 # Find messages -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r286705 r286825 39 39 40 40 namespace WebCore { 41 enum class DOMPasteAccessCategory : uint8_t; 41 42 enum class DOMPasteAccessResponse : uint8_t; 42 43 struct PromisedAttachmentInfo; … … 267 268 #endif 268 269 269 void requestDOMPasteAccess( const WebCore::IntRect& elementRect, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;270 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect& elementRect, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; 270 271 271 272 #if ENABLE(DRAG_SUPPORT) -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r286705 r286825 952 952 #endif 953 953 954 void PageClientImpl::requestDOMPasteAccess( const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)955 { 956 [m_contentView _requestDOMPasteAccess WithElementRect:elementRect originIdentifier:originIdentifier completionHandler:WTFMove(completionHandler)];954 void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler) 955 { 956 [m_contentView _requestDOMPasteAccessForCategory:pasteAccessCategory elementRect:elementRect originIdentifier:originIdentifier completionHandler:WTFMove(completionHandler)]; 957 957 } 958 958 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r286823 r286825 91 91 struct ShareDataWithParsedURL; 92 92 struct TextRecognitionResult; 93 enum class DOMPasteAccessCategory : uint8_t; 93 94 enum class DOMPasteAccessResponse : uint8_t; 94 95 enum class MouseEventPolicy : uint8_t; … … 460 461 NSInteger _suppressNonEditableSingleTapTextInteractionCount; 461 462 CompletionHandler<void(WebCore::DOMPasteAccessResponse)> _domPasteRequestHandler; 463 std::optional<WebCore::DOMPasteAccessCategory> _domPasteRequestCategory; 462 464 BlockPtr<void(UIWKAutocorrectionContext *)> _pendingAutocorrectionContextHandler; 463 465 CompletionHandler<void()> _pendingRunModalJavaScriptDialogCallback; … … 679 681 - (void)updateFocusedElementFocusedWithDataListDropdown:(BOOL)value; 680 682 681 - (void)_requestDOMPasteAccess WithElementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler;683 - (void)_requestDOMPasteAccessForCategory:(WebCore::DOMPasteAccessCategory)pasteAccessCategory elementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler; 682 684 683 685 - (void)doAfterPositionInformationUpdate:(void (^)(WebKit::InteractionInformationAtPosition))action forRequest:(WebKit::InteractionInformationRequest)request; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r286823 r286825 4165 4165 } 4166 4166 4167 static UIPasteboardName pasteboardNameForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory) 4168 { 4169 switch (pasteAccessCategory) { 4170 case WebCore::DOMPasteAccessCategory::General: 4171 return UIPasteboardNameGeneral; 4172 } 4173 } 4174 4175 static UIPasteboard *pasteboardForAccessCategory(WebCore::DOMPasteAccessCategory pasteAccessCategory) 4176 { 4177 switch (pasteAccessCategory) { 4178 case WebCore::DOMPasteAccessCategory::General: 4179 return UIPasteboard.generalPasteboard; 4180 } 4181 } 4182 4167 4183 - (BOOL)_handleDOMPasteRequestWithResult:(WebCore::DOMPasteAccessResponse)response 4168 4184 { 4169 if (response == WebCore::DOMPasteAccessResponse::GrantedForCommand || response == WebCore::DOMPasteAccessResponse::GrantedForGesture) 4170 _page->grantAccessToCurrentPasteboardData(UIPasteboardNameGeneral); 4185 if (auto pasteAccessCategory = std::exchange(_domPasteRequestCategory, std::nullopt)) { 4186 if (response == WebCore::DOMPasteAccessResponse::GrantedForCommand || response == WebCore::DOMPasteAccessResponse::GrantedForGesture) 4187 _page->grantAccessToCurrentPasteboardData(pasteboardNameForAccessCategory(*pasteAccessCategory)); 4188 } 4171 4189 4172 4190 if (auto pasteHandler = WTFMove(_domPasteRequestHandler)) { … … 6636 6654 } 6637 6655 6638 - (void)_requestDOMPasteAccess WithElementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler6656 - (void)_requestDOMPasteAccessForCategory:(WebCore::DOMPasteAccessCategory)pasteAccessCategory elementRect:(const WebCore::IntRect&)elementRect originIdentifier:(const String&)originIdentifier completionHandler:(CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&)completionHandler 6639 6657 { 6640 6658 if (auto existingCompletionHandler = std::exchange(_domPasteRequestHandler, WTFMove(completionHandler))) { … … 6643 6661 } 6644 6662 6645 if (allPasteboardItemOriginsMatchOrigin(UIPasteboard.generalPasteboard, originIdentifier)) { 6663 _domPasteRequestCategory = pasteAccessCategory; 6664 6665 if (allPasteboardItemOriginsMatchOrigin(pasteboardForAccessCategory(pasteAccessCategory), originIdentifier)) { 6646 6666 [self _handleDOMPasteRequestWithResult:WebCore::DOMPasteAccessResponse::GrantedForCommand]; 6647 6667 return; -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r286705 r286825 1545 1545 #endif 1546 1546 1547 void WebPageProxy::willPerformPasteCommand() 1548 { 1549 grantAccessToCurrentPasteboardData(UIPasteboardNameGeneral); 1547 void WebPageProxy::willPerformPasteCommand(DOMPasteAccessCategory pasteAccessCategory) 1548 { 1549 switch (pasteAccessCategory) { 1550 case DOMPasteAccessCategory::General: 1551 grantAccessToCurrentPasteboardData(UIPasteboardNameGeneral); 1552 return; 1553 } 1550 1554 } 1551 1555 -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h
r286705 r286825 226 226 void didRemoveNavigationGestureSnapshot() override; 227 227 228 void requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;228 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; 229 229 230 230 void makeViewBlank(bool) final; -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
r286705 r286825 1001 1001 } 1002 1002 1003 void PageClientImpl::requestDOMPasteAccess( const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion)1004 { 1005 m_impl->requestDOMPasteAccess( elementRect, originIdentifier, WTFMove(completion));1003 void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const WebCore::IntRect& elementRect, const String& originIdentifier, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completion) 1004 { 1005 m_impl->requestDOMPasteAccess(pasteAccessCategory, elementRect, originIdentifier, WTFMove(completion)); 1006 1006 } 1007 1007 -
trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r286815 r286825 652 652 #endif 653 653 654 void WebPageProxy::willPerformPasteCommand() 655 { 656 grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral); 654 void WebPageProxy::willPerformPasteCommand(DOMPasteAccessCategory pasteAccessCategory) 655 { 656 switch (pasteAccessCategory) { 657 case DOMPasteAccessCategory::General: 658 grantAccessToCurrentPasteboardData(NSPasteboardNameGeneral); 659 return; 660 } 657 661 } 658 662 -
trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.cpp
r286705 r286825 318 318 } 319 319 320 void PageClientImpl::requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)320 void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler) 321 321 { 322 322 completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture); -
trunk/Source/WebKit/UIProcess/playstation/PageClientImpl.h
r286705 r286825 150 150 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override; 151 151 152 void requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) override;152 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) override; 153 153 154 154 PlayStationWebView& m_view; -
trunk/Source/WebKit/UIProcess/win/PageClientImpl.cpp
r286705 r286825 374 374 } 375 375 376 void PageClientImpl::requestDOMPasteAccess( const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler)376 void PageClientImpl::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&& completionHandler) 377 377 { 378 378 completionHandler(WebCore::DOMPasteAccessResponse::DeniedForGesture); -
trunk/Source/WebKit/UIProcess/win/PageClientImpl.h
r286705 r286825 36 36 37 37 namespace WebCore { 38 enum class DOMPasteAccessCategory : uint8_t; 38 39 enum class DOMPasteAccessResponse : uint8_t; 39 40 } … … 149 150 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; } 150 151 151 void requestDOMPasteAccess( const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;152 void requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; 152 153 153 154 // Members of PageClientImpl class -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp
r286705 r286825 333 333 } 334 334 335 WebCore::DOMPasteAccessResponse WebEditorClient::requestDOMPasteAccess( const String& originIdentifier)336 { 337 return m_page->requestDOMPasteAccess( originIdentifier);335 WebCore::DOMPasteAccessResponse WebEditorClient::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const String& originIdentifier) 336 { 337 return m_page->requestDOMPasteAccess(pasteAccessCategory, originIdentifier); 338 338 } 339 339 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h
r286705 r286825 30 30 31 31 namespace WebCore { 32 enum class DOMPasteAccessCategory : uint8_t; 32 33 enum class DOMPasteAccessResponse : uint8_t; 33 34 } … … 94 95 void clearUndoRedoOperations() final; 95 96 96 WebCore::DOMPasteAccessResponse requestDOMPasteAccess( const String& originIdentifier) final;97 WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String& originIdentifier) final; 97 98 98 99 bool canCopyCut(WebCore::Frame*, bool defaultValue) const final; -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r286815 r286825 7208 7208 } 7209 7209 7210 WebCore::DOMPasteAccessResponse WebPage::requestDOMPasteAccess( const String& originIdentifier)7210 WebCore::DOMPasteAccessResponse WebPage::requestDOMPasteAccess(WebCore::DOMPasteAccessCategory pasteAccessCategory, const String& originIdentifier) 7211 7211 { 7212 7212 auto response = WebCore::DOMPasteAccessResponse::DeniedForGesture; … … 7218 7218 send(Messages::WebPageProxy::HandleAutocorrectionContext(autocorrectionContext())); 7219 7219 #endif 7220 sendSyncWithDelayedReply(Messages::WebPageProxy::RequestDOMPasteAccess( rectForElementAtInteractionLocation(), originIdentifier), Messages::WebPageProxy::RequestDOMPasteAccess::Reply(response));7220 sendSyncWithDelayedReply(Messages::WebPageProxy::RequestDOMPasteAccess(pasteAccessCategory, rectForElementAtInteractionLocation(), originIdentifier), Messages::WebPageProxy::RequestDOMPasteAccess::Reply(response)); 7221 7221 return response; 7222 7222 } -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r286812 r286825 225 225 enum class COEPDisposition : bool; 226 226 enum class CreateNewGroupForHighlight : bool; 227 enum class DOMPasteAccessCategory : uint8_t; 227 228 enum class DOMPasteAccessResponse : uint8_t; 228 229 enum class DragApplicationFlags : uint8_t; … … 1341 1342 } 1342 1343 1343 WebCore::DOMPasteAccessResponse requestDOMPasteAccess( const String& originIdentifier);1344 WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String& originIdentifier); 1344 1345 WebCore::IntRect rectForElementAtInteractionLocation() const; 1345 1346 -
trunk/Source/WebKitLegacy/mac/ChangeLog
r286772 r286825 1 2021-12-09 Devin Rousso <drousso@apple.com> 2 3 Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting 4 https://bugs.webkit.org/show_bug.cgi?id=233939 5 6 Reviewed by Wenson Hsieh. 7 8 Implementing `-pasteFont:` <https://webkit.org/b/191379> requires that we read from the font 9 pasteboard instead of the general pasteboard. In order to allow web content to trigger this 10 (e.g. `document.execCommand("PasteFont"))`) we must have a way for the WebProcess to signal 11 that it wishes to read from the font pasteboard instead of the general pasteboard. As such, 12 create and pass along a `DOMPasteAccessCategory` to `requestDOMPasteAccess`. 13 14 No change in behavior. 15 16 * WebCoreSupport/WebEditorClient.h: 17 (WebEditorClient::requestDOMPasteAccess): 18 1 19 2021-12-09 Myles C. Maxfield <mmaxfield@apple.com> and Don Olmstead <don.olmstead@sony.com> 2 20 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h
r286705 r286825 84 84 85 85 void setInsertionPasteboard(const String&) final; 86 WebCore::DOMPasteAccessResponse requestDOMPasteAccess( const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }86 WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; } 87 87 88 88 #if USE(APPKIT) -
trunk/Source/WebKitLegacy/win/ChangeLog
r286772 r286825 1 2021-12-09 Devin Rousso <drousso@apple.com> 2 3 Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting 4 https://bugs.webkit.org/show_bug.cgi?id=233939 5 6 Reviewed by Wenson Hsieh. 7 8 Implementing `-pasteFont:` <https://webkit.org/b/191379> requires that we read from the font 9 pasteboard instead of the general pasteboard. In order to allow web content to trigger this 10 (e.g. `document.execCommand("PasteFont"))`) we must have a way for the WebProcess to signal 11 that it wishes to read from the font pasteboard instead of the general pasteboard. As such, 12 create and pass along a `DOMPasteAccessCategory` to `requestDOMPasteAccess`. 13 14 No change in behavior. 15 16 * WebCoreSupport/WebEditorClient.h: 17 (WebEditorClient::requestDOMPasteAccess): 18 1 19 2021-12-09 Myles C. Maxfield <mmaxfield@apple.com> and Don Olmstead <don.olmstead@sony.com> 2 20 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h
r286705 r286825 118 118 bool performTwoStepDrop(WebCore::DocumentFragment&, const WebCore::SimpleRange&, bool) final { return false; } 119 119 120 WebCore::DOMPasteAccessResponse requestDOMPasteAccess( const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; }120 WebCore::DOMPasteAccessResponse requestDOMPasteAccess(WebCore::DOMPasteAccessCategory, const String&) final { return WebCore::DOMPasteAccessResponse::DeniedForGesture; } 121 121 122 122 WebCore::TextCheckerClient* textChecker() final { return this; }
Note:
See TracChangeset
for help on using the changeset viewer.