WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
236405
Mail attachment switched to TIFF and balloons in size after markup.
https://bugs.webkit.org/show_bug.cgi?id=236405
Summary
Mail attachment switched to TIFF and balloons in size after markup.
Megan Gardner
Reported
2022-02-09 13:46:33 PST
Mail attachment switched to TIFF and baloons in size after markup.
Attachments
Patch
(6.71 KB, patch)
2022-02-09 14:46 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Patch
(7.38 KB, patch)
2022-02-09 15:34 PST
,
Megan Gardner
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch for landing
(7.38 KB, patch)
2022-02-09 19:47 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Patch
(6.81 KB, patch)
2022-02-09 20:23 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Patch for landing
(6.81 KB, patch)
2022-02-10 08:31 PST
,
Megan Gardner
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Megan Gardner
Comment 1
2022-02-09 14:46:00 PST
Created
attachment 451446
[details]
Patch
Tim Horton
Comment 2
2022-02-09 15:08:54 PST
Comment on
attachment 451446
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451446&action=review
> Source/WebKit/ChangeLog:3 > + Mail attachment switched to TIFF and baloons in size after markup.
"balloons"
> Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm:157 > +NSData* Attachment::enclosingImageNSData() const
all your nsdata stars are on the wrong side
> Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm:160 > + return NULL;
nil in a variety of places
> Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:216 > + auto attachment = page()->attachmentForIdentifier(m_context.controlledImageAttachmentID()); > + auto itemProvider = adoptNS([[NSItemProvider alloc] initWithItem:attachment->enclosingImageNSData() typeIdentifier:attachment->utiType()]);
I think there might be cases where we don't have an API attachment backing a controlled image? but I'm not sure. Maybe fall back to the old thing if you fail to get the attachment? Or maybe Wenson will tell you I'm wrong.
Wenson Hsieh
Comment 3
2022-02-09 15:20:21 PST
Comment on
attachment 451446
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451446&action=review
> Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm:171 > + NSData *data = [fileWrapper regularFileContents]; > + if (!data) > + return NULL; > + > + return data;
Nit - I would just write this `return fileWrapper.regularFileContents;`
>> Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:216 >> + auto itemProvider = adoptNS([[NSItemProvider alloc] initWithItem:attachment->enclosingImageNSData() typeIdentifier:attachment->utiType()]); > > I think there might be cases where we don't have an API attachment backing a controlled image? but I'm not sure. Maybe fall back to the old thing if you fail to get the attachment? Or maybe Wenson will tell you I'm wrong.
My understanding was that we would only allow mark up on images that are attachment-backed (i.e., backed by <object> in legacy WK1 compose). I did verify that in legacy Mail compose, remote images cannot be marked up (by replying to an email with remote images). But at any rate, using the image bitmap data as a fallback seems sensible!
Megan Gardner
Comment 4
2022-02-09 15:34:37 PST
Created
attachment 451455
[details]
Patch
Wenson Hsieh
Comment 5
2022-02-09 16:22:29 PST
Comment on
attachment 451455
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451455&action=review
> Source/WebKit/UIProcess/API/APIAttachment.cpp:106 > +NSData* Attachment::enclosingImageNSData() const
Nit - * is still on the wrong side here.
> Source/WebKit/UIProcess/API/APIAttachment.cpp:108 > + return nullptr;
Nit - `return nil;`
Megan Gardner
Comment 6
2022-02-09 19:47:01 PST
Created
attachment 451487
[details]
Patch for landing
Wenson Hsieh
Comment 7
2022-02-09 20:00:12 PST
The Windows build failures in
https://ews-build.webkit.org/#/builders/12/builds/72990
seem legit.
Megan Gardner
Comment 8
2022-02-09 20:23:32 PST
Created
attachment 451490
[details]
Patch
Megan Gardner
Comment 9
2022-02-10 08:31:42 PST
Created
attachment 451540
[details]
Patch for landing
EWS
Comment 10
2022-02-10 09:05:34 PST
Committed
r289541
(
247072@main
): <
https://commits.webkit.org/247072@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 451540
[details]
.
Radar WebKit Bug Importer
Comment 11
2022-02-10 09:06:28 PST
<
rdar://problem/88758362
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug