Bug 181637 - Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
Summary: Add injected bundle SPI to replace subresource URLs when dropping or pasting ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-14 12:43 PST by Wenson Hsieh
Modified: 2018-01-17 09:08 PST (History)
6 users (show)

See Also:


Attachments
First pass (38.00 KB, patch)
2018-01-14 13:24 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Try to fix Windows builds (40.43 KB, patch)
2018-01-14 14:27 PST, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Bump WKBundlePageEditorClient version (41.49 KB, patch)
2018-01-16 19:19 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Bump WKBundlePageEditorClient version (41.85 KB, patch)
2018-01-16 19:29 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2018-01-14 12:43:47 PST
<rdar://problem/36508471>
Comment 1 Wenson Hsieh 2018-01-14 13:24:38 PST
Created attachment 331309 [details]
First pass
Comment 2 Wenson Hsieh 2018-01-14 14:27:43 PST
Created attachment 331312 [details]
Try to fix Windows builds
Comment 3 Tim Horton 2018-01-16 16:53:38 PST
Comment on attachment 331312 [details]
Try to fix Windows builds

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

> Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:293
> +    HashMap<AtomicString, AtomicString> subresourceURLToClientURLMap;

Don’t see the need for AtomicString?

> Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:110
> +    WKBundlePageReplacementURLForResource                               replacementURLForResource;

This is a big no-no. You need to make a new version and append this to the bottom.
Comment 4 Wenson Hsieh 2018-01-16 19:09:09 PST
Comment on attachment 331312 [details]
Try to fix Windows builds

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

>> Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:293
>> +    HashMap<AtomicString, AtomicString> subresourceURLToClientURLMap;
> 
> Don’t see the need for AtomicString?

Just spoke with Ryosuke about this — since the keys and values of this dictionary are either element attribute values or going to become attribute values after replacement, we'll end up making AtomicStrings for these anyways. For this reason, the existing blobURLMaps also in this file are HashMap<AtomicString, AtomicString>, so it seems like this should also be a HashMap<AtomicString, AtomicString>.

>> Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:110
>> +    WKBundlePageReplacementURLForResource                               replacementURLForResource;
> 
> This is a big no-no. You need to make a new version and append this to the bottom.

Got it — fixed!
Comment 5 Wenson Hsieh 2018-01-16 19:19:40 PST
Created attachment 331450 [details]
Bump WKBundlePageEditorClient version
Comment 6 Wenson Hsieh 2018-01-16 19:29:00 PST
Created attachment 331452 [details]
Bump WKBundlePageEditorClient version
Comment 7 WebKit Commit Bot 2018-01-17 09:07:51 PST
Comment on attachment 331452 [details]
Bump WKBundlePageEditorClient version

Clearing flags on attachment: 331452

Committed r227068: <https://trac.webkit.org/changeset/227068>