Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Dec 2018 21:20:10 +0000 (21:20 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Dec 2018 21:20:10 +0000 (21:20 +0000)
commit20a883ddc9cbd23863e87d115f55b9fb36f20a3e
tree2a1fd7758aa16ab18b05465b55ad52bda5147199
parent57bd4cbdb3ed72a1c734585d9f062acd3b6e8b2f
Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=192613

Reviewed by Darin Adler.

This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
a selection which spans across shadow boundaries in the future.

No new tests since there should be no observable behavioral change.

* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
(WebCore::Editor::writeSelection): Ditto.
* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::HTMLConverter): Now takes two Position's.
(HTMLConverter::convert): Updated to work with Position's.
(HTMLConverter::_processText): Ditto.
(HTMLConverter::_traverseNode): Ditto.
(HTMLConverter::_traverseFooterNode): Ditto.
(HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
(WebCore::attributedStringFromRange): Ditto.
(WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
in order to preserve the exact behavior.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/cocoa/EditorCocoa.mm
Source/WebCore/editing/cocoa/HTMLConverter.h
Source/WebCore/editing/cocoa/HTMLConverter.mm