Make TextInputController.legacyAttributedString take DOM nodes and offsets
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2018 03:54:13 +0000 (03:54 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2018 03:54:13 +0000 (03:54 +0000)
commit1a67c3429e5b7efc9bda51f19c22f489decdcb39
tree6d8b8b9705ebfbbdf8e7d8d7ebf87c3fc30cb0e7
parent988cb394fccb1b22212b1b1bd573ac171a427bdb
Make TextInputController.legacyAttributedString take DOM nodes and offsets
https://bugs.webkit.org/show_bug.cgi?id=192653

Reviewed by Wenson Hsieh.

Source/WebCore:

No new tests since there should be no observable behavioral change other than
TextInputController API in DumpRenderTree.

* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(WebCore::attributedStringFromSelection):
(WebCore::attributedStringBetweenStartAndEnd): Added.

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView _legacyAttributedStringFrom:offset:to:offset:]):

Tools:

Updated TextInputController.legacyAttributedString to take DOM nodes and offsets instead of
a DOM Range object in preparation to add layout tests for HTMLConverter which crosses
shadow boundaries.

* DumpRenderTree/mac/TextInputControllerMac.m:
(+[TextInputController isSelectorExcludedFromWebScript:]): Updated the selector signature.
(+[TextInputController webScriptNameForSelector:]): Ditto.
(-[TextInputController legacyAttributedString:offset:to:offset:]): Made this function take
start node and offset then end node and offset pairs.

LayoutTests:

Updated the tests per API change.

* editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html:
* editing/mac/attributed-string/resources/dump-attributed-string.js:
(dumpAttributedString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html
LayoutTests/editing/mac/attributed-string/resources/dump-attributed-string.js
Source/WebCore/ChangeLog
Source/WebCore/editing/cocoa/HTMLConverter.h
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/TextInputControllerMac.m