Bug 176986 - iOS: Use blob URL instead of a WebKit fake URL when pasting an image
Summary: iOS: Use blob URL instead of a WebKit fake URL when pasting an image
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: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks: 124391 176772
  Show dependency treegraph
 
Reported: 2017-09-15 00:25 PDT by Ryosuke Niwa
Modified: 2017-10-03 01:29 PDT (History)
8 users (show)

See Also:


Attachments
Fixes the bug (10.07 KB, patch)
2017-09-15 00:36 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Fixed builds (10.48 KB, patch)
2017-09-15 02:20 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Don't remove fakeURLWithRelativePart (9.07 KB, patch)
2017-09-15 13:27 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2017-09-15 00:25:30 PDT
https://trac.webkit.org/changeset/208451 fixed the bug that we were using a fake WebKit URL
and not allowing authors to read the actual image content but not for iOS.

Fix this problem for iOS.
Comment 1 Radar WebKit Bug Importer 2017-09-15 00:29:33 PDT
<rdar://problem/34455052>
Comment 2 Ryosuke Niwa 2017-09-15 00:36:44 PDT
Created attachment 320876 [details]
Fixes the bug
Comment 3 Ryosuke Niwa 2017-09-15 02:20:32 PDT
Created attachment 320883 [details]
Fixed builds
Comment 4 Alexey Proskuryakov 2017-09-15 07:14:08 PDT
Comment on attachment 320883 [details]
Fixed builds

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

> Source/WebCore/ChangeLog:30
> +        (WebCore::URL::fakeURLWithRelativePart): Deleted.

Have you got rid of all uses of fake url? There used to be some in WebKit{Legacy}, which should use this function instead of duplicating code.
Comment 5 Ryosuke Niwa 2017-09-15 13:04:24 PDT
(In reply to Alexey Proskuryakov from comment #4)
> Comment on attachment 320883 [details]
> Fixed builds
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=320883&action=review
> 
> > Source/WebCore/ChangeLog:30
> > +        (WebCore::URL::fakeURLWithRelativePart): Deleted.
> 
> Have you got rid of all uses of fake url? There used to be some in
> WebKit{Legacy}, which should use this function instead of duplicating code.

Oh, interesting, we're exposing it as [NSURL uniqueURLWithRelativePart]. See WebNSURLExtras.mm and WebHTMLView.mm.

I don't think we should keep this function in WebCore because all uses of fake URL in WebCore breaks things. We can consolidate the definition of fake URLs in WebKitLegacy into one place instead.
Comment 6 Ryosuke Niwa 2017-09-15 13:13:00 PDT
It looks like the only use of this that fake URL on iOS (_documentFragmentForImageData) is no longer used. So we can probably get rid of it altogether as well.

On Mac, _web_documentFragmentFromPasteboard is used by _documentFragmentFromPasteboard and that still has some use outside WebKit.

So we can probably make this fake URL thing Mac only, and remove it in near future.
Comment 7 Ryosuke Niwa 2017-09-15 13:14:04 PDT
Note I'm going to do WebKitLegacy code change in a separate patch since that's somewhat orthogonal to what this patch tries to do, which is a bug fix in iOS.
Comment 8 Ryosuke Niwa 2017-09-15 13:26:19 PDT
Oh never mind. Just saw your patch on https://bugs.webkit.org/show_bug.cgi?id=176123. I guess we have to keep fakeURLWithRelativePart for the time being :(
Comment 9 Ryosuke Niwa 2017-09-15 13:27:55 PDT
Created attachment 320957 [details]
Don't remove fakeURLWithRelativePart
Comment 10 WebKit Commit Bot 2017-09-15 16:59:39 PDT
Comment on attachment 320957 [details]
Don't remove fakeURLWithRelativePart

Clearing flags on attachment: 320957

Committed r222119: <http://trac.webkit.org/changeset/222119>
Comment 11 WebKit Commit Bot 2017-09-15 16:59:41 PDT
All reviewed patches have been landed.  Closing bug.