Make handleAcceptedCandidate a public function
https://bugs.webkit.org/show_bug.cgi?id=157763
-and corresponding-
rdar://problem/26206397

Reviewed by Tim Horton.

Source/WebCore:

Define handleAcceptedCandidateWithSoftSpaces on EditorClient so that it can 
be invoked on any EditorClient. 
* loader/EmptyClients.h:
* page/EditorClient.h:
(WebCore::EditorClient::handleAcceptedCandidateWithSoftSpaces):

Source/WebKit/mac:

This patch re-names handleAcceptedCandidate to 
handleAcceptedCandidateWithSoftSpaces. The function now takes a 
WebCore::TextCheckingResult instead of an NSTextCheckingResult and it can be 
called from outside of WebEditorClient.

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::handleRequestedCandidates):
(WebEditorClient::handleAcceptedCandidateWithSoftSpaces):
(textCheckingResultFromNSTextCheckingResult): Deleted.
(WebEditorClient::handleAcceptedCandidate): Deleted.

Move showCandidates to WebViewPrivate so that it can be overridden by a test.
* WebView/WebViewInternal.h:
* WebView/WebViewPrivate.h:

Source/WebKit2:

This patch makes handleAcceptedCandidate a public member of WebViewImpl 
instead of a private member. 
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::createWeakPtr):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/autofocused-text-input.html: Added.
* TestWebKitAPI/Tests/mac/ViewWithEditableAreaLeak.mm: Added.
(-[DoNotLeakWebView dealloc]):
(-[DoNotLeakWebView showCandidates:forString:inRect:forSelectedRange:view:completionHandler:]):
(-[DoNotLeakFrameLoadDelegate webView:didFinishLoadForFrame:]):
(TestWebKitAPI::TEST):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@201056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/page/EditorClient.h b/Source/WebCore/page/EditorClient.h
index 9363de5..0b43a6b 100644
--- a/Source/WebCore/page/EditorClient.h
+++ b/Source/WebCore/page/EditorClient.h
@@ -100,6 +100,7 @@
     virtual void didWriteSelectionToPasteboard() = 0;
     virtual void getClientPasteboardDataForRange(Range*, Vector<String>& pasteboardTypes, Vector<RefPtr<SharedBuffer>>& pasteboardData) = 0;
     virtual void requestCandidatesForSelection(const VisibleSelection&) { }
+    virtual void handleAcceptedCandidateWithSoftSpaces(TextCheckingResult) { }
 
     // Notify an input method that a composition was voluntarily discarded by WebCore, so that it could clean up too.
     // This function is not called when a composition is closed per a request from an input method.