Bug 180892

Summary: [Attachment Support] Support representing pasted or dropped content using attachment elements
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mitz, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 180853    
Bug Blocks: 180924    
Attachments:
Description Flags
Depends on https://bugs.webkit.org/show_bug.cgi?id=180853
thorton: review+
Rebase on master
none
Rebase on master again none

Description Wenson Hsieh 2017-12-15 16:36:45 PST
<rdar://problem/36064210>
Comment 1 Wenson Hsieh 2017-12-15 22:44:23 PST
Created attachment 329561 [details]
Depends on https://bugs.webkit.org/show_bug.cgi?id=180853
Comment 2 Tim Horton 2017-12-18 13:18:56 PST
Comment on attachment 329561 [details]
Depends on https://bugs.webkit.org/show_bug.cgi?id=180853

View in context: https://bugs.webkit.org/attachment.cgi?id=329561&action=review

> Source/WebCore/ChangeLog:10
> +        replaceRichContentWithAttachmentsIfNecessary to replace object elements with attachments; see comments below for

Still slightly concerned about all <object>s becoming <attachment>s.

> Source/WebCore/ChangeLog:28
> +        of generating markup from NSTextAttachments; this currently causes the web process to crash on an unrecognized
> +        selector.

Crazy
Comment 3 Wenson Hsieh 2017-12-18 13:49:08 PST
Comment on attachment 329561 [details]
Depends on https://bugs.webkit.org/show_bug.cgi?id=180853

View in context: https://bugs.webkit.org/attachment.cgi?id=329561&action=review

>> Source/WebCore/ChangeLog:10
>> +        replaceRichContentWithAttachmentsIfNecessary to replace object elements with attachments; see comments below for
> 
> Still slightly concerned about all <object>s becoming <attachment>s.

True, it's...kinda weird.

One caveat is that we only do this replacement for objects whose `data` have already been replaced by blob URLs. And for pasted/dropped <object>s that don't have data URLs or haven't been blob-replaced, we'll simply remove them from the inserted fragment.

>> Source/WebCore/ChangeLog:28
>> +        selector.
> 
> Crazy

🙃

Thankfully less so after this change.
Comment 4 Wenson Hsieh 2017-12-18 16:35:16 PST
Created attachment 329707 [details]
Rebase on master
Comment 5 Wenson Hsieh 2017-12-18 18:49:00 PST
Created attachment 329724 [details]
Rebase on master again
Comment 6 WebKit Commit Bot 2017-12-18 20:03:25 PST
Comment on attachment 329724 [details]
Rebase on master again

Clearing flags on attachment: 329724

Committed r226093: <https://trac.webkit.org/changeset/226093>