iOS: Use blob URL instead of a WebKit fake URL when pasting an image
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 23:59:35 +0000 (23:59 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 23:59:35 +0000 (23:59 +0000)
commite5fcf822c157f33d4bdd402f67d979c226b46735
treeb16432600bbceccc7109dad52b074d5dcb76666b
parent192efbc010314a2ac2763f55095ac01ad3f50e84
iOS: Use blob URL instead of a WebKit fake URL when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=176986
<rdar://problem/34455052>

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug that pasting an image on iOS resulted in an img element with src attribute
set to a WebKit fake URL so that the Web content could never save it.

Like r208451 on Mac, use a Blob URL instead.

This patch also removes createFragmentForImageResourceAndAddResource since it's no longer used.

Tests: LayoutTests/editing/pasteboard/paste-image-as-blob-url.html

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readImage): Moved the code here from WebContentReaderMac.mm.
* editing/ios/WebContentReaderIOS.mm:
(WebCore::WebContentReader::readImage): Deleted. This is the code
* editing/mac/WebContentReaderMac.mm:
(WebCore::WebContentReader::readImage): Moved to WebContentReaderCocoa.mm. Note that
typeAsFilenameWithExtension was dead code after r208451
* editing/markup.cpp:
(WebCore::createFragmentForImageResourceAndAddResource): Deleted.
* editing/markup.h:

LayoutTests:

Removed the failing expectation on the test added by r208451 now that it passes on iOS.

* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/editing/ios/WebContentReaderIOS.mm
Source/WebCore/editing/mac/WebContentReaderMac.mm
Source/WebCore/editing/markup.cpp
Source/WebCore/editing/markup.h