RESOLVED FIXED 180853
[Attachment Support] Insert images as inline attachments when pasting and dropping
https://bugs.webkit.org/show_bug.cgi?id=180853
Summary [Attachment Support] Insert images as inline attachments when pasting and dro...
Wenson Hsieh
Reported 2017-12-14 17:24:20 PST
Attachments
First pass (39.64 KB, patch)
2017-12-14 19:36 PST, Wenson Hsieh
no flags
Slight test tweaks (39.71 KB, patch)
2017-12-15 13:34 PST, Wenson Hsieh
thorton: review+
Patch for EWS. (40.47 KB, patch)
2017-12-18 14:32 PST, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2017-12-14 19:36:59 PST
Created attachment 329447 [details] First pass
Wenson Hsieh
Comment 2 2017-12-15 13:34:45 PST
Created attachment 329514 [details] Slight test tweaks
Tim Horton
Comment 3 2017-12-18 13:13:52 PST
Comment on attachment 329514 [details] Slight test tweaks View in context: https://bugs.webkit.org/attachment.cgi?id=329514&action=review > Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:425 > + HashMap<AtomicString, RefPtr<Blob>> urlToBlobMap; Is it at all possible to factor this out? It seems like these same four lines show up a bunch of times. > Source/WebCore/html/HTMLAttachmentElement.cpp:127 > + setAttributeWithoutSynchronization(HTMLNames::titleAttr, m_file->name()); I swear I've seen this code before
Wenson Hsieh
Comment 4 2017-12-18 13:34:11 PST
Comment on attachment 329514 [details] Slight test tweaks View in context: https://bugs.webkit.org/attachment.cgi?id=329514&action=review >> Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:425 >> + HashMap<AtomicString, RefPtr<Blob>> urlToBlobMap; > > Is it at all possible to factor this out? It seems like these same four lines show up a bunch of times. Good idea — fixed. >> Source/WebCore/html/HTMLAttachmentElement.cpp:127 >> + setAttributeWithoutSynchronization(HTMLNames::titleAttr, m_file->name()); > > I swear I've seen this code before It's also in HTMLAttachmentElement::updateFileWithData. I'm not sure why I avoided refactoring that to use this new logic, but at a second glance, you're right — it totally should just call into this code instead. Fixed!
Wenson Hsieh
Comment 5 2017-12-18 14:32:05 PST
Created attachment 329685 [details] Patch for EWS.
WebKit Commit Bot
Comment 6 2017-12-18 16:19:22 PST
Comment on attachment 329685 [details] Patch for EWS. Clearing flags on attachment: 329685 Committed r226085: <https://trac.webkit.org/changeset/226085>
Note You need to log in before you can comment on or make changes to this bug.