Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0ed894383eb476f3a6a2abda84a5f71c06d48c58
https://github.com/WebKit/WebKit/commit/0ed894383eb476f3a6a2abda84a5f71c06d48c58
Author: Aditya Keerthi <[email protected]>
Date: 2024-06-28 (Fri, 28 Jun 2024)
Changed paths:
M Source/WebCore/editing/markup.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/AdaptiveImageGlyph.mm
Log Message:
-----------
[Cocoa] Pasting a Genmoji into Mail does not create a HEIC attachment
https://bugs.webkit.org/show_bug.cgi?id=275982
rdar://129805233
Reviewed by Abrar Rahman Protyasha.
When dragging or copying an image element, attachment elements are preserved in
dropped/pasted fragment by writing a temporary "webkitattachmentid" attribute to
the serialized markup on copy. Then, upon deserialization an attachment element
with the same identifier is created under the image.
However, this logic was not being applied to <source> elements, which contain
the
data necessary to render a Genmoji. This resulted in Genmoji being lost, leaving
behind only a fallback PNG, when copying from another app, pasting into Mail and
then sending an email. No issues were observed simply when pasting, as the
<source>
element was still created. However, Mail is never notified of a new attachment,
so
their serialization upon sending fails to capture the full fidelity Genmoji.
Fix by generalizing the approach used to preserve image attachments, to
`AttachmentAssociatedElement`, which includes <image> and <source>.
* Source/WebCore/editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendCustomAttributes):
(WebCore::restoreAttachmentElementsInFragment):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/AdaptiveImageGlyph.mm:
(TestWebKitAPI::TEST(AdaptiveImageGlyph, InsertWKAttachmentsOnPaste)):
Canonical link: https://commits.webkit.org/280459@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes