WebContentReader::readWebArchive doesn't need to handle image MIME type
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Sep 2017 23:43:55 +0000 (23:43 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Sep 2017 23:43:55 +0000 (23:43 +0000)
commitbaeaff73d5b30f603f985ac509dc90f30fd2548a
treeac74828723aef4cc2e70495309b7869bb6a11dd2
parentca4d4cfc882bb7aa8ec80b7169c3daa2e676f565
WebContentReader::readWebArchive doesn't need to handle image MIME type
https://bugs.webkit.org/show_bug.cgi?id=176884

Reviewed by Sam Weinig.

Remove the code to handle image MIME types in the web archive on macOS since we have a separate code path
to handle images in the pasteboard directly. As far as I can tell, this code is never used in practice.

This allows merging iOS and macOS code to read web archive from the pasteboard. Also merged member functions
for handling RTFD and RTF in iOS and macOS in WebContentReaderCocoa.mm.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/WebContentReader.cpp: Added.
(WebCore::WebContentReader::addFragment): Moved from WebContentReaderIOS.mm and simplified since appendChild
knows how to add a DocumentFragment.
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentAndAddResources):
(WebCore::WebContentReader::readWebArchive): Merged iOS / macOS code here.
(WebCore::WebContentReader::readRTFD): Ditto.
(WebCore::WebContentReader::readRTF): Ditto.
(WebCore::WebContentReader::readPlainText): Ditto.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard):
* editing/ios/WebContentReaderIOS.mm:
(WebCore::WebContentReader::readImage):
(WebCore::WebContentReader::readURL):
(WebCore::WebContentReader::readWebArchive): Moved to WebContentReaderCocoa.mm.
(WebCore::WebContentReader::readRTFD): Ditto.
(WebCore::WebContentReader::readRTF): Ditto.
(WebCore::WebContentReader::readPlainText): Ditto.
* editing/mac/WebContentReaderMac.mm:
(WebCore::WebContentReader::readWebArchive): Ditto.
(WebCore::WebContentReader::readRTFD): Ditto.
(WebCore::WebContentReader::readRTF): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/WebContentReader.cpp [new file with mode: 0644]
Source/WebCore/editing/WebContentReader.h
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/editing/ios/EditorIOS.mm
Source/WebCore/editing/ios/WebContentReaderIOS.mm
Source/WebCore/editing/mac/WebContentReaderMac.mm