Summary: | [Cocoa] Attachment dropped from one web view to another is missing its file wrapper | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | mitz | ||||||||||||||||||
Component: | HTML Editing | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||||
Severity: | Normal | CC: | bdakin, commit-queue, mitz, thorton, webkit-bug-importer, wenson_hsieh | ||||||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||
Version: | Other | ||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||
Attachments: |
|
Description
mitz
2018-10-12 11:32:06 PDT
Seems to also happen with copy and paste! Created attachment 353411 [details]
Patch
Created attachment 353417 [details]
Try to fix macOS builds
Created attachment 353435 [details]
Try to fix the Windows build
Comment on attachment 353435 [details] Try to fix the Windows build View in context: https://bugs.webkit.org/attachment.cgi?id=353435&action=review > Source/WebCore/html/HTMLAttachmentElement.cpp:91 > + return URLParser(makeString("applewebdata://attachment/"_s, identifier)).result(); It feels weird/scary to build a URL by concatenating strings. But it seems like we don't have a mutable URL? What happens if identifier (which comes from where?) has non-path-safe characters? Comment on attachment 353435 [details] Try to fix the Windows build View in context: https://bugs.webkit.org/attachment.cgi?id=353435&action=review >> Source/WebCore/html/HTMLAttachmentElement.cpp:91 >> + return URLParser(makeString("applewebdata://attachment/"_s, identifier)).result(); > > It feels weird/scary to build a URL by concatenating strings. But it seems like we don't have a mutable URL? What happens if identifier (which comes from where?) has non-path-safe characters? Good point — the identifier _normally_ comes from within WebKit (createCanonicalUUIDString()) and it's only exposed as a readonly attribute to internal clients. That being said, we do have a mechanism for temporarily saving the identifier as an attribute on the attachment element (see "webkitattachmentid"). Using this, it should be possible to influence the identifier of a pasted/dropped attachment element by writing a webarchive to the pasteboard with an attachment element that contains this attribute... I've changed this to use URL::setPath() to set the path of the URL, and verified that non-path-safe characters (e.g. space) are URL-encoded. Created attachment 353456 [details]
Try to fix the Windows build (2)
Created attachment 353458 [details]
Try to fix the Windows build (3)
Created attachment 353459 [details]
Try to fix the Windows build (4)
Created attachment 353460 [details]
Try to fix the Windows build (4.1)
Created attachment 353461 [details]
Try to fix the Windows build (5)
Comment on attachment 353461 [details] Try to fix the Windows build (5) Clearing flags on attachment: 353461 Committed r237624: <https://trac.webkit.org/changeset/237624> All reviewed patches have been landed. Closing bug. *** Bug 188904 has been marked as a duplicate of this bug. *** |