REGRESSION: Copied content loses formatting on paste to external apps.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Mar 2011 22:13:13 +0000 (22:13 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Mar 2011 22:13:13 +0000 (22:13 +0000)
commit9f00bb0767fc16b3eaf6504e658ee7182510b91b
treef443cc9cc9e563772cbc679dd9bc6460489ae773
parent010e31248139ecf1118962bb4d87d3efbccfd963
REGRESSION: Copied content loses formatting on paste to external apps.
https://bugs.webkit.org/show_bug.cgi?id=47615
<rdar://problem/9001214>

Reviewed by Darin Adler.

This is a resubmission of a patch that was landed a while ago then rolled
back because of a build failure on SnowLeopard and Leopard.

This patch adds a way for WebKit2 to create NSAttributedStrings from
a DOM range without using the AppKit api initWithDOMRange that internally
needs to access the WebView. The NSAttributedString is needed to create
RTF formats in the pasteboard.
This is to be considered a first step, since in the future we want to have
an implementation based on the TextIterator.

* WebCore.xcodeproj/project.pbxproj: Added new file.
* platform/mac/HTMLConverter.h: Added.
* platform/mac/HTMLConverter.mm: Added.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeSelection): We now use WebHTMLConverter
class for WebKit2 to create the NSAttributedString from the DOM range.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/mac/HTMLConverter.h [new file with mode: 0644]
Source/WebCore/platform/mac/HTMLConverter.mm [new file with mode: 0644]
Source/WebCore/platform/mac/PasteboardMac.mm