⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287034 in webkit


Ignore:
Timestamp:
Dec 14, 2021, 11:23:07 AM (5 years ago)
Author:
Megan Gardner
Message:

Attachment does not update after markup.
https://bugs.webkit.org/show_bug.cgi?id=234266

Reviewed by Wenson Hsieh.

If we don't call the deligate to inform Mail about the new attachment data,
it will not update and the original image will be sent.

  • UIProcess/mac/WKSharingServicePickerDelegate.mm:

(-[WKSharingServicePickerDelegate sharingService:didShareItems:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r287030 r287034  
     12021-12-14  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Attachment does not update after markup.
     4        https://bugs.webkit.org/show_bug.cgi?id=234266
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        If we don't call the deligate to inform Mail about the new attachment data,
     9        it will not update and the original image will be sent.
     10
     11        * UIProcess/mac/WKSharingServicePickerDelegate.mm:
     12        (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
     13
    1142021-12-11  Dean Jackson  <dino@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/mac/WKSharingServicePickerDelegate.mm

    r286886 r287034  
    149149       
    150150        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    151         [itemProvider loadDataRepresentationForTypeIdentifier:(NSString *)kUTTypeData completionHandler:^(NSData *data, NSError *error) {
     151        WeakPtr weakPage = _menuProxy->page();
     152        [itemProvider loadDataRepresentationForTypeIdentifier:(NSString *)kUTTypeData completionHandler:[weakPage, attachmentID = _attachmentID](NSData *data, NSError *error) {
     153            RefPtr webPage = weakPage.get();
     154           
     155            if (!webPage)
     156                return;
     157           
    152158            if (error)
    153159                return;
    154160           
    155             auto apiAttachment = _menuProxy->page()->attachmentForIdentifier(_attachmentID);
     161            auto apiAttachment = webPage->attachmentForIdentifier(attachmentID);
     162            if (!apiAttachment)
     163                return;
     164           
    156165            auto attachment = wrapper(apiAttachment);
    157166            [attachment setData:data newContentType:String(NSPasteboardTypeTIFF)];
     167            webPage->didInvalidateDataForAttachment(*apiAttachment.get());
    158168        }];
    159169        ALLOW_DEPRECATED_DECLARATIONS_END
Note: See TracChangeset for help on using the changeset viewer.