Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8cbf542936d552ee9e32929e03410de79a255496
https://github.com/WebKit/WebKit/commit/8cbf542936d552ee9e32929e03410de79a255496
Author: Tim Nguyen <[email protected]>
Date: 2025-12-09 (Tue, 09 Dec 2025)
Changed paths:
A
LayoutTests/http/tests/pasteboard/copy-image-from-context-menu-expected.txt
A LayoutTests/http/tests/pasteboard/copy-image-from-context-menu.html
A LayoutTests/http/tests/pasteboard/resources/green-100.png
M LayoutTests/platform/ios/TestExpectations
M LayoutTests/platform/mac-wk1/TestExpectations
M Source/WebCore/platform/mac/PasteboardMac.mm
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
Log Message:
-----------
[macOS] Stop copying image URL when using "Copy Image" context menu item
https://bugs.webkit.org/show_bug.cgi?id=301889
rdar://76598990
Reviewed by Darin Adler.
Safari currently copies the image URL when using the "Copy Image" context menu
item.
That results in extra items in the clipboard DataTransfer object. This is
different from Chrome and Firefox which only copy the image.
This caused issues on Twitter, Facebook Messenger, Instagram and other sites,
where pasting an image after copying it
from Safari would paste the image URL as text instead of uploading the image.
To fix this, we stop including the image URL in the DataTransfer object when
using the "Copy Image" context menu item.
Test: http/tests/pasteboard/copy-image-from-context-menu.html
* LayoutTests/http/tests/pasteboard/copy-image-from-context-menu-expected.txt:
Added.
* LayoutTests/http/tests/pasteboard/copy-image-from-context-menu.html: Added.
* LayoutTests/http/tests/pasteboard/resources/green-100.png: Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/platform/mac/PasteboardMac.mm:
(WebCore::writableTypesForImage):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::copyImageAtLocation):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
Canonical link: https://commits.webkit.org/304166@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications