[Cocoa] Implement SPI on WKWebView to increase and decrease list levels
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2018 22:50:47 +0000 (22:50 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2018 22:50:47 +0000 (22:50 +0000)
commit3061b938d1445e8534a92d2b7cd080abd081a09c
treea1a937e8e6e184c49121487608fec43c2148a5f6
parent460a4e070c5fd9e5f6be632cd2139c133a2daf76
[Cocoa] Implement SPI on WKWebView to increase and decrease list levels
https://bugs.webkit.org/show_bug.cgi?id=191471
<rdar://problem/45952472>

Reviewed by Tim Horton.

Source/WebCore:

Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).

* editing/Editor.cpp:
(WebCore::Editor::canChangeSelectionListType):
(WebCore::Editor::changeSelectionListType):
* editing/Editor.h:

Source/WebKit:

Implement these method stubs by calling into Editor.

Test: WKWebViewEditActions.ModifyListLevel

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::increaseListLevel):
(WebKit::WebPage::decreaseListLevel):
(WebKit::WebPage::changeListType):

Tools:

Add an API test to ensure that list levels can be incremented and decremented via WKWebView SPI.

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEditActions.mm:
(TestWebKitAPI::webViewForEditActionTesting):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEditActions.mm