<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195081] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195081">195081</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2016-01-14 16:07:36 -0800 (Thu, 14 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>WK1 and WK2 should share more candidate request code
https://bugs.webkit.org/show_bug.cgi?id=153108

Reviewed by Simon Fraser.

requestCandidatesForSelection() does not need to be exposed as an 
EditorClient function. WK1 can just call invoke this code from the existing 
respondToChangedSelection EditorClient function, which is what WK2 does.
Source/WebCore:

* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
* loader/EmptyClients.h:
* page/EditorClient.h:
(WebCore::EditorClient::supportsGlobalSelection):

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::respondToChangedSelection):

Cleanup — use some code that was moved to WebCore::Editor.
(WebEditorClient::requestCandidatesForSelection):
(WebEditorClient::handleRequestedCandidates):
(textCheckingResultFromNSTextCheckingResult):
(WebEditorClient::handleAcceptedCandidate):
(candidateRangeForSelection): Deleted.
(candidateWouldReplaceText): Deleted.

Source/WebKit2:

* WebProcess/WebCoreSupport/WebEditorClient.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCorepageEditorClienth">trunk/Source/WebCore/page/EditorClient.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebEditorClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebEditorClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebEditorClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebCore/ChangeLog        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2016-01-14  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        WK1 and WK2 should share more candidate request code
+        https://bugs.webkit.org/show_bug.cgi?id=153108
+
+        Reviewed by Simon Fraser.
+
+        requestCandidatesForSelection() does not need to be exposed as an 
+        EditorClient function. WK1 can just call invoke this code from the existing 
+        respondToChangedSelection EditorClient function, which is what WK2 does.
+        * editing/Editor.cpp:
+        (WebCore::Editor::respondToChangedSelection):
+        * loader/EmptyClients.h:
+        * page/EditorClient.h:
+        (WebCore::EditorClient::supportsGlobalSelection):
+
+2016-01-14  Beth Dakin  &lt;bdakin@apple.com&gt;
+
</ins><span class="cx">         WK2: Request completion candidates when needed
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=153040
</span><span class="cx">         -and corresponding-
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebCore/editing/Editor.cpp        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -3264,11 +3264,6 @@
</span><span class="cx">     if (client())
</span><span class="cx">         client()-&gt;respondToChangedSelection(&amp;m_frame);
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
-    if (client() &amp;&amp; canEdit())
-        client()-&gt;requestCandidatesForSelection(m_frame.selection().selection());
-#endif
-
</del><span class="cx"> #if ENABLE(TELEPHONE_NUMBER_DETECTION) &amp;&amp; !PLATFORM(IOS)
</span><span class="cx">     if (shouldDetectTelephoneNumbers())
</span><span class="cx">         m_telephoneNumberDetectionUpdateTimer.startOneShot(0);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -537,10 +537,6 @@
</span><span class="cx">     virtual void willSetInputMethodState() override { }
</span><span class="cx">     virtual void setInputMethodState(bool) override { }
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
-    virtual void requestCandidatesForSelection(const VisibleSelection&amp;) override { }
-#endif
-
</del><span class="cx"> private:
</span><span class="cx">     EmptyTextCheckerClient m_textCheckerClient;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageEditorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EditorClient.h (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EditorClient.h        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebCore/page/EditorClient.h        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -186,10 +186,6 @@
</span><span class="cx">     // Support for global selections, used on platforms like the X Window System that treat
</span><span class="cx">     // selection as a type of clipboard.
</span><span class="cx">     virtual bool supportsGlobalSelection() { return false; }
</span><del>-
-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
-    virtual void requestCandidatesForSelection(const VisibleSelection&amp;) = 0;
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-01-14  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        WK1 and WK2 should share more candidate request code
+        https://bugs.webkit.org/show_bug.cgi?id=153108
+
+        Reviewed by Simon Fraser.
+
+        requestCandidatesForSelection() does not need to be exposed as an 
+        EditorClient function. WK1 can just call invoke this code from the existing 
+        respondToChangedSelection EditorClient function, which is what WK2 does.
+        * WebCoreSupport/WebEditorClient.h:
+        * WebCoreSupport/WebEditorClient.mm:
+        (WebEditorClient::respondToChangedSelection):
+
+        Cleanup — use some code that was moved to WebCore::Editor.
+        (WebEditorClient::requestCandidatesForSelection):
+        (WebEditorClient::handleRequestedCandidates):
+        (textCheckingResultFromNSTextCheckingResult):
+        (WebEditorClient::handleAcceptedCandidate):
+        (candidateRangeForSelection): Deleted.
+        (candidateWouldReplaceText): Deleted.
+
</ins><span class="cx"> 2016-01-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r194900.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebEditorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx">     virtual void requestCheckingOfString(PassRefPtr&lt;WebCore::TextCheckingRequest&gt;) override;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
</span><del>-    virtual void requestCandidatesForSelection(const WebCore::VisibleSelection&amp;) override;
</del><ins>+    void requestCandidatesForSelection(const WebCore::VisibleSelection&amp;);
</ins><span class="cx">     void handleRequestedCandidates(NSInteger, NSArray&lt;NSTextCheckingResult *&gt; *);
</span><span class="cx">     void handleAcceptedCandidate(NSTextCheckingResult *);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebEditorClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -367,6 +367,11 @@
</span><span class="cx">     if (![m_webView _isClosing])
</span><span class="cx">         WebThreadPostNotification(WebViewDidChangeSelectionNotification, m_webView, nil);
</span><span class="cx"> #endif
</span><ins>+
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    if (frame-&gt;editor().canEdit())
+        requestCandidatesForSelection(frame-&gt;selection().selection());
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebEditorClient::discardedComposition(Frame*)
</span><span class="lines">@@ -1124,15 +1129,12 @@
</span><span class="cx"> 
</span><span class="cx">     VisiblePosition selectionStart = selection.visibleStart();
</span><span class="cx">     VisiblePosition selectionEnd = selection.visibleEnd();
</span><del>-
-    // Use the surrounding paragraphs of text as context.
</del><span class="cx">     VisiblePosition paragraphStart = startOfParagraph(selectionStart);
</span><span class="cx">     VisiblePosition paragraphEnd = endOfParagraph(selectionEnd);
</span><span class="cx"> 
</span><span class="cx">     int lengthToSelectionStart = TextIterator::rangeLength(makeRange(paragraphStart, selectionStart).get());
</span><span class="cx">     int lengthToSelectionEnd = TextIterator::rangeLength(makeRange(paragraphStart, selectionEnd).get());
</span><span class="cx">     NSRange rangeForCandidates = NSMakeRange(lengthToSelectionStart, lengthToSelectionEnd - lengthToSelectionStart);
</span><del>-
</del><span class="cx">     String fullPlainTextStringOfParagraph = plainText(makeRange(paragraphStart, paragraphEnd).get());
</span><span class="cx"> 
</span><span class="cx">     NSTextCheckingTypes checkingTypes = NSTextCheckingTypeSpelling | NSTextCheckingTypeReplacement | NSTextCheckingTypeCorrection;
</span><span class="lines">@@ -1146,20 +1148,6 @@
</span><span class="cx">     }];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;Range&gt; candidateRangeForSelection(const VisibleSelection&amp; selection, Frame* frame)
-{
-    return selection.isCaret() ? wordRangeFromPosition(selection.start()) : frame-&gt;selection().toNormalizedRange();
-}
-
-static bool candidateWouldReplaceText(const VisibleSelection&amp; selection)
-{
-    // If the character behind the caret in the current selection is anything but a space or a newline then we should
-    // replace the whole current word with the candidate.
-    UChar32 characterAfterSelection, characterBeforeSelection, twoCharacterBeforeSelection = 0;
-    charactersAroundPosition(selection.visibleStart(), characterAfterSelection, characterBeforeSelection, twoCharacterBeforeSelection);
-    return !(characterBeforeSelection == '\0' || characterBeforeSelection == '\n' || characterBeforeSelection == ' ');
-}
-
</del><span class="cx"> void WebEditorClient::handleRequestedCandidates(NSInteger sequenceNumber, NSArray&lt;NSTextCheckingResult *&gt; *candidates)
</span><span class="cx"> {
</span><span class="cx">     Frame* frame = core([m_webView _selectedOrMainFrame]);
</span><span class="lines">@@ -1170,14 +1158,7 @@
</span><span class="cx">     if (selection != m_lastSelectionForRequestedCandidates)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Range&gt; rangeForCurrentlyTypedString = candidateRangeForSelection(selection, frame);
-    NSString *currentlyTypedString;
-    if (rangeForCurrentlyTypedString &amp;&amp; candidateWouldReplaceText(selection))
-        currentlyTypedString = plainText(rangeForCurrentlyTypedString.get());
-    else
-        currentlyTypedString = @&quot;&quot;;
-
-    RefPtr&lt;Range&gt; selectedRange = frame-&gt;selection().selection().toNormalizedRange();
</del><ins>+    RefPtr&lt;Range&gt; selectedRange = selection.toNormalizedRange();
</ins><span class="cx">     if (!selectedRange)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1188,7 +1169,7 @@
</span><span class="cx">         rectForSelectionCandidates = frame-&gt;view()-&gt;contentsToWindow(quads[0].enclosingBoundingBox());
</span><span class="cx"> 
</span><span class="cx">     auto weakEditor = m_weakPtrFactory.createWeakPtr();
</span><del>-    [[NSSpellChecker sharedSpellChecker] showCandidates:candidates forString:currentlyTypedString inRect:rectForSelectionCandidates view:m_webView completionHandler:[weakEditor](NSTextCheckingResult *acceptedCandidate) {
</del><ins>+    [[NSSpellChecker sharedSpellChecker] showCandidates:candidates forString:frame-&gt;editor().stringForCandidateRequest() inRect:rectForSelectionCandidates view:m_webView completionHandler:[weakEditor](NSTextCheckingResult *acceptedCandidate) {
</ins><span class="cx">         dispatch_async(dispatch_get_main_queue(), ^{
</span><span class="cx">             if (!weakEditor)
</span><span class="cx">                 return;
</span><span class="lines">@@ -1198,6 +1179,32 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static WebCore::TextCheckingResult textCheckingResultFromNSTextCheckingResult(NSTextCheckingResult *nsResult)
+{
+    WebCore::TextCheckingResult result;
+
+    switch ([nsResult resultType]) {
+    case NSTextCheckingTypeSpelling:
+        result.type = WebCore::TextCheckingTypeSpelling;
+        break;
+    case NSTextCheckingTypeReplacement:
+        result.type = WebCore::TextCheckingTypeReplacement;
+        break;
+    case NSTextCheckingTypeCorrection:
+        result.type = WebCore::TextCheckingTypeCorrection;
+        break;
+    default:
+        result.type = WebCore::TextCheckingTypeNone;
+    }
+
+    NSRange resultRange = [nsResult range];
+    result.location = resultRange.location;
+    result.length = resultRange.length;
+    result.replacement = [nsResult replacementString];
+
+    return result;
+}
+
</ins><span class="cx"> void WebEditorClient::handleAcceptedCandidate(NSTextCheckingResult *acceptedCandidate)
</span><span class="cx"> {
</span><span class="cx">     Frame* frame = core([m_webView _selectedOrMainFrame]);
</span><span class="lines">@@ -1208,16 +1215,7 @@
</span><span class="cx">     if (selection != m_lastSelectionForRequestedCandidates)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Range&gt; candidateRange = candidateRangeForSelection(selection, frame);
-
-    frame-&gt;editor().setIgnoreCompositionSelectionChange(true);
-
-    if (candidateWouldReplaceText(selection))
-        frame-&gt;selection().setSelectedRange(candidateRange.get(), UPSTREAM, true);
-
-    frame-&gt;editor().insertText(acceptedCandidate.replacementString, 0);
-    frame-&gt;editor().insertText(String(&quot; &quot;), 0);
-    frame-&gt;editor().setIgnoreCompositionSelectionChange(false);
</del><ins>+    frame-&gt;editor().handleAcceptedCandidate(textCheckingResultFromNSTextCheckingResult(acceptedCandidate));
</ins><span class="cx"> }
</span><span class="cx"> #endif // PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2016-01-14  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        WK1 and WK2 should share more candidate request code
+        https://bugs.webkit.org/show_bug.cgi?id=153108
+
+        Reviewed by Simon Fraser.
+
+        requestCandidatesForSelection() does not need to be exposed as an 
+        EditorClient function. WK1 can just call invoke this code from the existing 
+        respondToChangedSelection EditorClient function, which is what WK2 does.
+        * WebProcess/WebCoreSupport/WebEditorClient.h:
+
+2016-01-14  Beth Dakin  &lt;bdakin@apple.com&gt;
+
</ins><span class="cx">         WK2: Request completion candidates when needed
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=153040
</span><span class="cx">         -and corresponding-
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebEditorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h (195080 => 195081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h        2016-01-14 23:07:44 UTC (rev 195080)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h        2016-01-15 00:07:36 UTC (rev 195081)
</span><span class="lines">@@ -150,10 +150,6 @@
</span><span class="cx">     virtual void setInputMethodState(bool enabled) override;
</span><span class="cx">     virtual void requestCheckingOfString(WTF::PassRefPtr&lt;WebCore::TextCheckingRequest&gt;) override;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
-    virtual void requestCandidatesForSelection(const WebCore::VisibleSelection&amp;) override { }
-#endif
-
</del><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx">     virtual bool shouldShowUnicodeMenu() override;
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>