<!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>[210355] branches/safari-603-branch</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/210355">210355</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-01-05 09:09:49 -0800 (Thu, 05 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/210266">r210266</a>. rdar://problem/29447824</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsChangeLog">branches/safari-603-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari603branchLayoutTestseditingeditingjs">branches/safari-603-branch/LayoutTests/editing/editing.js</a></li>
<li><a href="#branchessafari603branchLayoutTestsplatformmacwk2TestExpectations">branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations</a></li>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCoreeditingAlternativeTextControllercpp">branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCoreeditingAlternativeTextControllerh">branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.h</a></li>
<li><a href="#branchessafari603branchSourceWebCoreeditingEditorcpp">branches/safari-603-branch/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCorepageAlternativeTextClienth">branches/safari-603-branch/Source/WebCore/page/AlternativeTextClient.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacChangeLog">branches/safari-603-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebCoreSupportCorrectionPanelh">branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebCoreSupportCorrectionPanelmm">branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebCoreSupportWebAlternativeTextClienth">branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebCoreSupportWebAlternativeTextClientmm">branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2ChangeLog">branches/safari-603-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessPageClienth">branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessWebPageProxycpp">branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessWebPageProxymessagesin">branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessmacCorrectionPanelh">branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessmacCorrectionPanelmm">branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessmacPageClientImplh">branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessmacPageClientImplmm">branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessWebCoreSupportWebAlternativeTextClienth">branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessWebCoreSupportmacWebAlternativeTextClientcpp">branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp</a></li>
<li><a href="#branchessafari603branchToolsChangeLog">branches/safari-603-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreeDumpRenderTreexcodeprojprojectpbxproj">branches/safari-603-branch/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreeTestRunnercpp">branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.cpp</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreeTestRunnerh">branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.h</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreemacDumpRenderTreemm">branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreemacTestRunnerMacmm">branches/safari-603-branch/Tools/DumpRenderTree/mac/TestRunnerMac.mm</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreewinTestRunnerWincpp">branches/safari-603-branch/Tools/DumpRenderTree/win/TestRunnerWin.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestseditingmacspellingacceptunseencandidaterecordsacceptanceexpectedtxt">branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestseditingmacspellingacceptunseencandidaterecordsacceptancehtml">branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance.html</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreemacDumpRenderTreeSpellCheckerh">branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.h</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreemacDumpRenderTreeSpellCheckermm">branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/ChangeLog (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/ChangeLog        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/LayoutTests/ChangeLog        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210266. rdar://problem/29447824
+
+    2017-01-03  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            NSSpellChecker's recordResponse isn't called for unseen automatic corrections
+            https://bugs.webkit.org/show_bug.cgi?id=166450
+            &lt;rdar://problem/29447824&gt;
+
+            Reviewed by Darin Adler.
+
+            * editing/editing.js:
+            (runEditingTest):
+            (runEditingTestWithCallbackLogging):
+            Add a way to run an editing test without enabling noisy editing callback logging.
+
+            * editing/mac/spelling/accept-unseen-candidate-records-acceptance-expected.txt: Added.
+            * editing/mac/spelling/accept-unseen-candidate-records-acceptance.html: Added.
+            Add a test that ensures that we correctly inform NSSpellChecker of an
+            accepted unseen correction.
+
+            * platform/mac-wk2/TestExpectations:
+            Disable the test because spelling tests don't work in WebKit2 at all.
+
+2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210142. rdar://problem/29109053
</span><span class="cx"> 
</span><span class="cx">     2016-12-23  Andreas Kling  &lt;akling@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestseditingeditingjs"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/editing/editing.js (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/editing/editing.js        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/LayoutTests/editing/editing.js        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -894,7 +894,11 @@
</span><span class="cx"> })();
</span><span class="cx"> 
</span><span class="cx"> function runEditingTest() {
</span><del>-    if (window.testRunner)
</del><ins>+    runEditingTestWithCallbackLogging(true);
+}
+
+function runEditingTestWithCallbackLogging(enableCallbackLogging) {
+    if (window.testRunner &amp;&amp; enableCallbackLogging)
</ins><span class="cx">         testRunner.dumpEditingCallbacks();
</span><span class="cx"> 
</span><span class="cx">     var elem = document.getElementById(&quot;test&quot;);
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestseditingmacspellingacceptunseencandidaterecordsacceptanceexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance-expected.txt (0 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance-expected.txt        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+NSSpellChecker recordResponseToCorrection: notationl -&gt; notational (response: accepted)
+This test verifies that accepted candidates that were accepted immediately and unseen by the user still trigger NSSpellChecker reporting. A single &quot;recordResponseToCorrection&quot; logging should be output by this test, correcting &quot;notationl&quot; to &quot;notational&quot;, and should be accepted.
+
+the notational 
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestseditingmacspellingacceptunseencandidaterecordsacceptancehtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance.html (0 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/editing/mac/spelling/accept-unseen-candidate-records-acceptance.html        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;html&gt; 
+&lt;head&gt;
+&lt;script src=../../editing.js language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot; &gt;&lt;/script&gt;
+&lt;script&gt;
+function editingTest() {
+    if (window.testRunner) {
+        testRunner.setSpellCheckerLoggingEnabled(true);
+        testRunner.dumpAsText();
+    }
+
+    typeCharacterCommand('t');
+    typeCharacterCommand('h');
+    typeCharacterCommand('e');
+    typeCharacterCommand(' ');
+    typeCharacterCommand('n');
+    typeCharacterCommand('o');
+    typeCharacterCommand('t');
+    typeCharacterCommand('a');
+    typeCharacterCommand('t');
+    typeCharacterCommand('i');
+    typeCharacterCommand('o');
+    typeCharacterCommand('n');
+    typeCharacterCommand('l');
+    typeCharacterCommand(' ');
+}
+&lt;/script&gt;
+
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;This test verifies that accepted candidates that were accepted immediately and unseen by the user still trigger NSSpellChecker reporting. A single &quot;recordResponseToCorrection&quot; logging should be output by this test, correcting &quot;notationl&quot; to &quot;notational&quot;, and should be accepted.&lt;/p&gt;
+&lt;div contenteditable id=&quot;root&quot; class=&quot;editing&quot;&gt;
+&lt;span id=&quot;test&quot;&gt;&lt;/span&gt;
+&lt;/div&gt;
+
+&lt;script&gt;
+runEditingTestWithCallbackLogging(false);
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsplatformmacwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/LayoutTests/platform/mac-wk2/TestExpectations        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -171,6 +171,7 @@
</span><span class="cx"> webkit.org/b/105616 editing/mac/spelling/move-cursor-to-beginning-of-autocorrected-word.html [ Failure ]
</span><span class="cx"> webkit.org/b/105616 editing/mac/spelling/removing-underline-after-accepting-autocorrection-using-punctuation.html [ Failure ]
</span><span class="cx"> webkit.org/b/105616 editing/mac/spelling/accept-candidate-allows-autocorrect-on-next-word.html [ Failure ]
</span><ins>+webkit.org/b/105616 editing/mac/spelling/accept-unseen-candidate-records-acceptance.html [ Failure ]
</ins><span class="cx"> 
</span><span class="cx"> # [WK2] [Mac] Support drag in mouse events for WebKit2 EventSender
</span><span class="cx"> # &lt;https://bugs.webkit.org/show_bug.cgi?id=68552&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -1,5 +1,37 @@
</span><span class="cx"> 2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210266. rdar://problem/29447824
+
+    2017-01-03  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            NSSpellChecker's recordResponse isn't called for unseen automatic corrections
+            https://bugs.webkit.org/show_bug.cgi?id=166450
+            &lt;rdar://problem/29447824&gt;
+
+            Reviewed by Darin Adler.
+
+            Test: editing/mac/spelling/accept-unseen-candidate-records-acceptance.html
+
+            * editing/AlternativeTextController.cpp:
+            (WebCore::AlternativeTextController::recordAutocorrectionResponse):
+            (WebCore::AlternativeTextController::recordAutocorrectionResponseReversed): Deleted.
+            * editing/AlternativeTextController.h:
+            Add recordAutocorrectionResponse, which takes a AutocorrectionResponseType, instead of having
+            a function specifically for reverted autocorrections. Also, get rid of the unnecessary indirection
+            of the private overload of recordAutocorrectionResponseReversed, since there's only one caller.
+
+            * editing/Editor.cpp:
+            (WebCore::Editor::markAndReplaceFor):
+            Call recordAutocorrectionResponse with Accepted when performing an auto-autocorrection.
+
+            (WebCore::Editor::changeBackToReplacedString):
+            Adopt recordAutocorrectionResponse.
+
+            * page/AlternativeTextClient.h:
+            Add an &quot;AutocorrectionAccepted&quot; response type.
+
+2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210142. rdar://problem/29109053
</span><span class="cx"> 
</span><span class="cx">     2016-12-23  Andreas Kling  &lt;akling@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreeditingAlternativeTextControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.cpp (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.cpp        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.cpp        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -314,7 +314,7 @@
</span><span class="cx"> void AlternativeTextController::respondToUnappliedSpellCorrection(const VisibleSelection&amp; selectionOfCorrected, const String&amp; corrected, const String&amp; correction)
</span><span class="cx"> {
</span><span class="cx">     if (AlternativeTextClient* client = alternativeTextClient())
</span><del>-        client-&gt;recordAutocorrectionResponse(AutocorrectionReverted, corrected, correction);
</del><ins>+        client-&gt;recordAutocorrectionResponse(AutocorrectionResponse::Reverted, corrected, correction);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;Frame&gt; protector(m_frame);
</span><span class="cx">     m_frame.document()-&gt;updateLayout();
</span><span class="lines">@@ -516,17 +516,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AlternativeTextController::recordAutocorrectionResponseReversed(const String&amp; replacedString, const String&amp; replacementString)
</del><ins>+void AlternativeTextController::recordAutocorrectionResponse(AutocorrectionResponse response, const String&amp; replacedString, PassRefPtr&lt;Range&gt; replacementRange)
</ins><span class="cx"> {
</span><del>-    if (AlternativeTextClient* client = alternativeTextClient())
-        client-&gt;recordAutocorrectionResponse(AutocorrectionReverted, replacedString, replacementString);
</del><ins>+    if (auto client = alternativeTextClient())
+        client-&gt;recordAutocorrectionResponse(response, replacedString, plainText(replacementRange.get()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AlternativeTextController::recordAutocorrectionResponseReversed(const String&amp; replacedString, PassRefPtr&lt;Range&gt; replacementRange)
-{
-    recordAutocorrectionResponseReversed(replacedString, plainText(replacementRange.get()));
-}
-
</del><span class="cx"> void AlternativeTextController::markReversed(PassRefPtr&lt;Range&gt; changedRange)
</span><span class="cx"> {
</span><span class="cx">     changedRange-&gt;startContainer().document().markers().removeMarkers(changedRange.get(), DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
</span><span class="lines">@@ -557,9 +552,9 @@
</span><span class="cx">         // Spelling corrected text has been edited. We need to determine whether user has reverted it to original text or
</span><span class="cx">         // edited it to something else, and notify spellchecker accordingly.
</span><span class="cx">         if (markersHaveIdenticalDescription(correctedOnceMarkers) &amp;&amp; correctedOnceMarkers[0]-&gt;description() == corrected)
</span><del>-            client-&gt;recordAutocorrectionResponse(AutocorrectionReverted, corrected, correction);
</del><ins>+            client-&gt;recordAutocorrectionResponse(AutocorrectionResponse::Reverted, corrected, correction);
</ins><span class="cx">         else
</span><del>-            client-&gt;recordAutocorrectionResponse(AutocorrectionEdited, corrected, correction);
</del><ins>+            client-&gt;recordAutocorrectionResponse(AutocorrectionResponse::Edited, corrected, correction);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     markers.removeMarkers(rangeOfCorrection, DocumentMarker::Autocorrected, DocumentMarkerController::RemovePartiallyOverlappingMarker);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreeditingAlternativeTextControllerh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebCore/editing/AlternativeTextController.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     bool isAutomaticSpellingCorrectionEnabled() UNLESS_ENABLED({ return false; })
</span><span class="cx">     bool shouldRemoveMarkersUponEditing();
</span><span class="cx"> 
</span><del>-    void recordAutocorrectionResponseReversed(const String&amp; replacedString, PassRefPtr&lt;Range&gt; replacementRange) UNLESS_ENABLED({ UNUSED_PARAM(replacedString); UNUSED_PARAM(replacementRange); })
</del><ins>+    void recordAutocorrectionResponse(AutocorrectionResponse, const String&amp; replacedString, PassRefPtr&lt;Range&gt; replacementRange) UNLESS_ENABLED({ UNUSED_PARAM(replacedString); UNUSED_PARAM(replacementRange); })
</ins><span class="cx">     void markReversed(PassRefPtr&lt;Range&gt; changedRange) UNLESS_ENABLED({ UNUSED_PARAM(changedRange); })
</span><span class="cx">     void markCorrection(PassRefPtr&lt;Range&gt; replacedRange, const String&amp; replacedString) UNLESS_ENABLED({ UNUSED_PARAM(replacedRange); UNUSED_PARAM(replacedString); })
</span><span class="cx"> 
</span><span class="lines">@@ -138,7 +138,6 @@
</span><span class="cx">     String dismissSoon(ReasonForDismissingAlternativeText);
</span><span class="cx">     void applyAlternativeTextToRange(const Range*, const String&amp; alternative, AlternativeTextType, const Vector&lt;DocumentMarker::MarkerType&gt;&amp;);
</span><span class="cx">     void timerFired();
</span><del>-    void recordAutocorrectionResponseReversed(const String&amp; replacedString, const String&amp; replacementString);
</del><span class="cx">     void recordSpellcheckerResponseForModifiedCorrection(Range* rangeOfCorrection, const String&amp; corrected, const String&amp; correction);
</span><span class="cx">     String markerDescriptionForAppliedAlternativeText(AlternativeTextType, DocumentMarker::MarkerType);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/editing/Editor.cpp (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/editing/Editor.cpp        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebCore/editing/Editor.cpp        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -2577,9 +2577,13 @@
</span><span class="cx">                 if (resultLocation &lt; selectionOffset)
</span><span class="cx">                     selectionOffset += replacement.length() - resultLength;
</span><span class="cx"> 
</span><del>-                // Add a marker so that corrections can easily be undone and won't be re-corrected.
-                if (resultType == TextCheckingTypeCorrection)
-                    m_alternativeTextController-&gt;markCorrection(paragraph.subrange(resultLocation, replacement.length()), replacedString);
</del><ins>+                if (resultType == TextCheckingTypeCorrection) {
+                    RefPtr&lt;Range&gt; replacementRange = paragraph.subrange(resultLocation, replacement.length());
+                    m_alternativeTextController-&gt;recordAutocorrectionResponse(AutocorrectionResponse::Accepted, replacedString, replacementRange);
+
+                    // Add a marker so that corrections can easily be undone and won't be re-corrected.
+                    m_alternativeTextController-&gt;markCorrection(WTFMove(replacementRange), replacedString);
+                }
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2613,7 +2617,7 @@
</span><span class="cx">     if (!shouldInsertText(replacedString, selection.get(), EditorInsertActionPasted))
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    m_alternativeTextController-&gt;recordAutocorrectionResponseReversed(replacedString, selection);
</del><ins>+    m_alternativeTextController-&gt;recordAutocorrectionResponse(AutocorrectionResponse::Reverted, replacedString, selection);
</ins><span class="cx">     TextCheckingParagraph paragraph(selection);
</span><span class="cx">     replaceSelectionWithText(replacedString, false, false, EditActionInsert);
</span><span class="cx">     RefPtr&lt;Range&gt; changedRange = paragraph.subrange(paragraph.checkingStart(), replacedString.length());
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorepageAlternativeTextClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/page/AlternativeTextClient.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/page/AlternativeTextClient.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebCore/page/AlternativeTextClient.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -50,9 +50,10 @@
</span><span class="cx">     AlternativeTextTypeDictationAlternatives
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum AutocorrectionResponseType {
-    AutocorrectionEdited,
-    AutocorrectionReverted
</del><ins>+enum class AutocorrectionResponse {
+    Edited,
+    Reverted,
+    Accepted
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class AlternativeTextClient {
</span><span class="lines">@@ -63,7 +64,7 @@
</span><span class="cx">     virtual void showCorrectionAlternative(AlternativeTextType, const FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacmentString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings) = 0;
</span><span class="cx">     virtual void dismissAlternative(ReasonForDismissingAlternativeText) = 0;
</span><span class="cx">     virtual String dismissAlternativeSoon(ReasonForDismissingAlternativeText) = 0;
</span><del>-    virtual void recordAutocorrectionResponse(AutocorrectionResponseType, const String&amp; replacedString, const String&amp; replacementString) = 0;
</del><ins>+    virtual void recordAutocorrectionResponse(AutocorrectionResponse, const String&amp; replacedString, const String&amp; replacementString) = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><span class="cx">     virtual void showDictationAlternativeUI(const WebCore::FloatRect&amp; boundingBoxOfDictatedText, uint64_t dictationContext) = 0;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/ChangeLog (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/ChangeLog        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit/mac/ChangeLog        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r210266. rdar://problem/29447824
+
+    2017-01-03  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            NSSpellChecker's recordResponse isn't called for unseen automatic corrections
+            https://bugs.webkit.org/show_bug.cgi?id=166450
+            &lt;rdar://problem/29447824&gt;
+
+            Reviewed by Darin Adler.
+
+            * WebCoreSupport/CorrectionPanel.h:
+            * WebCoreSupport/CorrectionPanel.mm:
+            (CorrectionPanel::recordAutocorrectionResponse):
+            (CorrectionPanel::handleAcceptedReplacement):
+            * WebCoreSupport/WebAlternativeTextClient.mm:
+            (toCorrectionResponse):
+            (WebAlternativeTextClient::recordAutocorrectionResponse):
+            Funnel all calls to recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
+            through recordAutocorrectionResponse, for debugging's sake.
+            Drop the NSView parameter because we don't need it, just the tag.
+            Convert the new AutocorrectionResponseType value to its corresponding
+            NSCorrectionResponse value.
+
</ins><span class="cx"> 2016-12-19  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge another patch for rdar://problem/29466493.
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebCoreSupportCorrectionPanelh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">     ~CorrectionPanel();
</span><span class="cx">     void show(WebView*, WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings);
</span><span class="cx">     String dismiss(WebCore::ReasonForDismissingAlternativeText);
</span><del>-    static void recordAutocorrectionResponse(WebView*, NSCorrectionResponse, const String&amp; replacedString, const String&amp; replacementString);
</del><ins>+    static void recordAutocorrectionResponse(NSInteger spellCheckerDocumentTag, NSCorrectionResponse, const String&amp; replacedString, const String&amp; replacementString);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool isShowing() const { return m_view; }
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebCoreSupportCorrectionPanelmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -99,9 +99,9 @@
</span><span class="cx">     return m_resultForDismissal.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CorrectionPanel::recordAutocorrectionResponse(WebView* view, NSCorrectionResponse response, const String&amp; replacedString, const String&amp; replacementString)
</del><ins>+void CorrectionPanel::recordAutocorrectionResponse(NSInteger spellCheckerDocumentTag, NSCorrectionResponse response, const String&amp; replacedString, const String&amp; replacementString)
</ins><span class="cx"> {
</span><del>-    [[NSSpellChecker sharedSpellChecker] recordResponse:response toCorrection:replacementString forWord:replacedString language:nil inSpellDocumentWithTag:[view spellCheckerDocumentTag]];
</del><ins>+    [[NSSpellChecker sharedSpellChecker] recordResponse:response toCorrection:replacementString forWord:replacedString language:nil inSpellDocumentWithTag:spellCheckerDocumentTag];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement,  NSCorrectionIndicatorType correctionIndicatorType)
</span><span class="lines">@@ -109,27 +109,26 @@
</span><span class="cx">     if (!m_view)
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker];
</del><span class="cx">     NSInteger documentTag = [m_view.get() spellCheckerDocumentTag];
</span><span class="cx"> 
</span><span class="cx">     switch (correctionIndicatorType) {
</span><span class="cx">     case NSCorrectionIndicatorTypeDefault:
</span><span class="cx">         if (acceptedReplacement)
</span><del>-            [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag];
</del><ins>+            recordAutocorrectionResponse(documentTag, NSCorrectionResponseAccepted, replaced, acceptedReplacement);
</ins><span class="cx">         else {
</span><span class="cx">             if (!m_wasDismissedExternally || m_reasonForDismissing == ReasonForDismissingAlternativeTextCancelled)
</span><del>-                [spellChecker recordResponse:NSCorrectionResponseRejected toCorrection:proposedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag];
</del><ins>+                recordAutocorrectionResponse(documentTag, NSCorrectionResponseRejected, replaced, proposedReplacement);
</ins><span class="cx">             else
</span><del>-                [spellChecker recordResponse:NSCorrectionResponseIgnored toCorrection:proposedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag];
</del><ins>+                recordAutocorrectionResponse(documentTag, NSCorrectionResponseIgnored, replaced, proposedReplacement);
</ins><span class="cx">         }
</span><span class="cx">         break;
</span><span class="cx">     case NSCorrectionIndicatorTypeReversion:
</span><span class="cx">         if (acceptedReplacement)
</span><del>-            [spellChecker recordResponse:NSCorrectionResponseReverted toCorrection:replaced forWord:acceptedReplacement language:nil inSpellDocumentWithTag:documentTag];
</del><ins>+            recordAutocorrectionResponse(documentTag, NSCorrectionResponseReverted, replaced, acceptedReplacement);
</ins><span class="cx">         break;
</span><span class="cx">     case NSCorrectionIndicatorTypeGuesses:
</span><span class="cx">         if (acceptedReplacement)
</span><del>-            [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag];
</del><ins>+            recordAutocorrectionResponse(documentTag, NSCorrectionResponseAccepted, replaced, acceptedReplacement);
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebCoreSupportWebAlternativeTextClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">     void showCorrectionAlternative(WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings) override;
</span><span class="cx">     void dismissAlternative(WebCore::ReasonForDismissingAlternativeText) override;
</span><span class="cx">     String dismissAlternativeSoon(WebCore::ReasonForDismissingAlternativeText) override;
</span><del>-    void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String&amp; replacedString, const String&amp; replacementString) override;
</del><ins>+    void recordAutocorrectionResponse(WebCore::AutocorrectionResponse, const String&amp; replacedString, const String&amp; replacementString) override;
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><span class="cx">     void showDictationAlternativeUI(const WebCore::FloatRect&amp; boundingBoxOfDictatedText, uint64_t dictationContext) override;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebCoreSupportWebAlternativeTextClientmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.mm (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.mm        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit/mac/WebCoreSupport/WebAlternativeTextClient.mm        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -62,11 +62,25 @@
</span><span class="cx">     return m_correctionPanel.dismiss(reason);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAlternativeTextClient::recordAutocorrectionResponse(AutocorrectionResponseType responseType, const String&amp; replacedString, const String&amp; replacementString)
</del><ins>+static inline NSCorrectionResponse toCorrectionResponse(AutocorrectionResponse response)
</ins><span class="cx"> {
</span><del>-    NSCorrectionResponse response = responseType == AutocorrectionReverted ? NSCorrectionResponseReverted : NSCorrectionResponseEdited;
-    CorrectionPanel::recordAutocorrectionResponse(m_webView, response, replacedString, replacementString);
</del><ins>+    switch (response) {
+    case WebCore::AutocorrectionResponse::Reverted:
+        return NSCorrectionResponseReverted;
+    case WebCore::AutocorrectionResponse::Edited:
+        return NSCorrectionResponseEdited;
+    case WebCore::AutocorrectionResponse::Accepted:
+        return NSCorrectionResponseAccepted;
+    }
+
+    ASSERT_NOT_REACHED();
+    return NSCorrectionResponseAccepted;
</ins><span class="cx"> }
</span><ins>+
+void WebAlternativeTextClient::recordAutocorrectionResponse(AutocorrectionResponse response, const String&amp; replacedString, const String&amp; replacementString)
+{
+    CorrectionPanel::recordAutocorrectionResponse([m_webView spellCheckerDocumentTag], toCorrectionResponse(response), replacedString, replacementString);
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210266. rdar://problem/29447824
+
+    2017-01-03  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            NSSpellChecker's recordResponse isn't called for unseen automatic corrections
+            https://bugs.webkit.org/show_bug.cgi?id=166450
+            &lt;rdar://problem/29447824&gt;
+
+            Reviewed by Darin Adler.
+
+            * UIProcess/mac/CorrectionPanel.h:
+            * UIProcess/mac/CorrectionPanel.mm:
+            (WebKit::CorrectionPanel::recordAutocorrectionResponse):
+            (WebKit::CorrectionPanel::handleAcceptedReplacement):
+            Funnel all calls to recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
+            through recordAutocorrectionResponse, for debugging's sake.
+            Drop the NSView parameter because we don't need it, just the tag.
+
+            * UIProcess/mac/PageClientImpl.mm:
+            (WebKit::toCorrectionResponse):
+            (WebKit::PageClientImpl::recordAutocorrectionResponse):
+            Convert the new AutocorrectionResponseType value to its corresponding
+            NSCorrectionResponse value.
+
+2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210118. rdar://problem/29732407
</span><span class="cx"> 
</span><span class="cx">     2016-12-22  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/PageClient.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">     virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings) = 0;
</span><span class="cx">     virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) = 0;
</span><span class="cx">     virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText) = 0;
</span><del>-    virtual void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String&amp; replacedString, const String&amp; replacementString) = 0;
</del><ins>+    virtual void recordAutocorrectionResponse(WebCore::AutocorrectionResponse, const String&amp; replacedString, const String&amp; replacementString) = 0;
</ins><span class="cx">     virtual void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle) = 0;
</span><span class="cx">     virtual void removeNavigationGestureSnapshot() = 0;
</span><span class="cx">     virtual void handleControlledElementIDResponse(const String&amp;) = 0;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -6101,9 +6101,9 @@
</span><span class="cx">     result = m_pageClient.dismissCorrectionPanelSoon((ReasonForDismissingAlternativeText)reason);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::recordAutocorrectionResponse(int32_t responseType, const String&amp; replacedString, const String&amp; replacementString)
</del><ins>+void WebPageProxy::recordAutocorrectionResponse(int32_t response, const String&amp; replacedString, const String&amp; replacementString)
</ins><span class="cx"> {
</span><del>-    m_pageClient.recordAutocorrectionResponse((AutocorrectionResponseType)responseType, replacedString, replacementString);
</del><ins>+    m_pageClient.recordAutocorrectionResponse(static_cast&lt;AutocorrectionResponse&gt;(response), replacedString, replacementString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::handleAlternativeTextUIResult(const String&amp; result)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -358,7 +358,7 @@
</span><span class="cx">     ShowCorrectionPanel(int32_t panelType, WebCore::FloatRect boundingBoxOfReplacedString, String replacedString, String replacementString, Vector&lt;String&gt; alternativeReplacementStrings)
</span><span class="cx">     DismissCorrectionPanel(int32_t reason)
</span><span class="cx">     DismissCorrectionPanelSoon(int32_t reason) -&gt; (String result)
</span><del>-    RecordAutocorrectionResponse(int32_t responseType, String replacedString, String replacementString);
</del><ins>+    RecordAutocorrectionResponse(int32_t response, String replacedString, String replacementString);
</ins><span class="cx"> 
</span><span class="cx">     SetEditableElementIsFocused(bool editableElementIsFocused)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessmacCorrectionPanelh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     ~CorrectionPanel();
</span><span class="cx">     void show(NSView *, WebViewImpl&amp;, WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings);
</span><span class="cx">     String dismiss(WebCore::ReasonForDismissingAlternativeText);
</span><del>-    static void recordAutocorrectionResponse(NSView *, NSInteger spellCheckerDocumentTag, NSCorrectionResponse, const String&amp; replacedString, const String&amp; replacementString);
</del><ins>+    static void recordAutocorrectionResponse(NSInteger spellCheckerDocumentTag, NSCorrectionResponse, const String&amp; replacedString, const String&amp; replacementString);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool isShowing() const { return m_view; }
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessmacCorrectionPanelmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/mac/CorrectionPanel.mm        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">     return m_resultForDismissal.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CorrectionPanel::recordAutocorrectionResponse(NSView *view, NSInteger spellCheckerDocumentTag, NSCorrectionResponse response, const String&amp; replacedString, const String&amp; replacementString)
</del><ins>+void CorrectionPanel::recordAutocorrectionResponse(NSInteger spellCheckerDocumentTag, NSCorrectionResponse response, const String&amp; replacedString, const String&amp; replacementString)
</ins><span class="cx"> {
</span><span class="cx">     [[NSSpellChecker sharedSpellChecker] recordResponse:response toCorrection:replacementString forWord:replacedString language:nil inSpellDocumentWithTag:spellCheckerDocumentTag];
</span><span class="cx"> }
</span><span class="lines">@@ -119,26 +119,24 @@
</span><span class="cx">     if (!m_view)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker];
-    
</del><span class="cx">     switch (correctionIndicatorType) {
</span><span class="cx">     case NSCorrectionIndicatorTypeDefault:
</span><span class="cx">         if (acceptedReplacement)
</span><del>-            [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:m_spellCheckerDocumentTag];
</del><ins>+            recordAutocorrectionResponse(m_spellCheckerDocumentTag, NSCorrectionResponseAccepted, replaced, acceptedReplacement);
</ins><span class="cx">         else {
</span><span class="cx">             if (!m_wasDismissedExternally || m_reasonForDismissing == ReasonForDismissingAlternativeTextCancelled)
</span><del>-                [spellChecker recordResponse:NSCorrectionResponseRejected toCorrection:proposedReplacement forWord:replaced language:nil inSpellDocumentWithTag:m_spellCheckerDocumentTag];
</del><ins>+                recordAutocorrectionResponse(m_spellCheckerDocumentTag, NSCorrectionResponseRejected, replaced, proposedReplacement);
</ins><span class="cx">             else
</span><del>-                [spellChecker recordResponse:NSCorrectionResponseIgnored toCorrection:proposedReplacement forWord:replaced language:nil inSpellDocumentWithTag:m_spellCheckerDocumentTag];
</del><ins>+                recordAutocorrectionResponse(m_spellCheckerDocumentTag, NSCorrectionResponseIgnored, replaced, proposedReplacement);
</ins><span class="cx">         }
</span><span class="cx">         break;
</span><span class="cx">     case NSCorrectionIndicatorTypeReversion:
</span><span class="cx">         if (acceptedReplacement)
</span><del>-            [spellChecker recordResponse:NSCorrectionResponseReverted toCorrection:replaced forWord:acceptedReplacement language:nil inSpellDocumentWithTag:m_spellCheckerDocumentTag];
</del><ins>+            recordAutocorrectionResponse(m_spellCheckerDocumentTag, NSCorrectionResponseReverted, replaced, acceptedReplacement);
</ins><span class="cx">         break;
</span><span class="cx">     case NSCorrectionIndicatorTypeGuesses:
</span><span class="cx">         if (acceptedReplacement)
</span><del>-            [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:m_spellCheckerDocumentTag];
</del><ins>+            recordAutocorrectionResponse(m_spellCheckerDocumentTag, NSCorrectionResponseAccepted, replaced, acceptedReplacement);
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx">     void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings) override;
</span><span class="cx">     void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) override;
</span><span class="cx">     String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText) override;
</span><del>-    void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String&amp; replacedString, const String&amp; replacementString) override;
</del><ins>+    void recordAutocorrectionResponse(WebCore::AutocorrectionResponse, const String&amp; replacedString, const String&amp; replacementString) override;
</ins><span class="cx"> 
</span><span class="cx">     void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -568,12 +568,26 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::recordAutocorrectionResponse(AutocorrectionResponseType responseType, const String&amp; replacedString, const String&amp; replacementString)
</del><ins>+static inline NSCorrectionResponse toCorrectionResponse(AutocorrectionResponse response)
</ins><span class="cx"> {
</span><del>-    NSCorrectionResponse response = responseType == AutocorrectionReverted ? NSCorrectionResponseReverted : NSCorrectionResponseEdited;
-    CorrectionPanel::recordAutocorrectionResponse(m_view, m_impl-&gt;spellCheckerDocumentTag(), response, replacedString, replacementString);
</del><ins>+    switch (response) {
+    case WebCore::AutocorrectionResponse::Reverted:
+        return NSCorrectionResponseReverted;
+    case WebCore::AutocorrectionResponse::Edited:
+        return NSCorrectionResponseEdited;
+    case WebCore::AutocorrectionResponse::Accepted:
+        return NSCorrectionResponseAccepted;
+    }
+
+    ASSERT_NOT_REACHED();
+    return NSCorrectionResponseAccepted;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::recordAutocorrectionResponse(AutocorrectionResponse response, const String&amp; replacedString, const String&amp; replacementString)
+{
+    CorrectionPanel::recordAutocorrectionResponse(m_impl-&gt;spellCheckerDocumentTag(), toCorrectionResponse(response), replacedString, replacementString);
+}
+
</ins><span class="cx"> void PageClientImpl::recommendedScrollbarStyleDidChange(ScrollbarStyle newStyle)
</span><span class="cx"> {
</span><span class="cx">     // Now re-create a tracking area with the appropriate options given the new scrollbar style
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessWebCoreSupportWebAlternativeTextClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">     void showCorrectionAlternative(WebCore::AlternativeTextType, const WebCore::FloatRect&amp; boundingBoxOfReplacedString, const String&amp; replacedString, const String&amp; replacementString, const Vector&lt;String&gt;&amp; alternativeReplacementStrings) override;
</span><span class="cx">     void dismissAlternative(WebCore::ReasonForDismissingAlternativeText) override;
</span><span class="cx">     String dismissAlternativeSoon(WebCore::ReasonForDismissingAlternativeText) override;
</span><del>-    void recordAutocorrectionResponse(WebCore::AutocorrectionResponseType, const String&amp; replacedString, const String&amp; replacementString) override;
</del><ins>+    void recordAutocorrectionResponse(WebCore::AutocorrectionResponse, const String&amp; replacedString, const String&amp; replacementString) override;
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><span class="cx">     void showDictationAlternativeUI(const WebCore::FloatRect&amp; boundingBoxOfDictatedText, uint64_t dictationContext) override;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessWebCoreSupportmacWebAlternativeTextClientcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -69,9 +69,9 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebAlternativeTextClient::recordAutocorrectionResponse(AutocorrectionResponseType responseType, const String&amp; replacedString, const String&amp; replacementString)
</del><ins>+void WebAlternativeTextClient::recordAutocorrectionResponse(AutocorrectionResponse response, const String&amp; replacedString, const String&amp; replacementString)
</ins><span class="cx"> {
</span><del>-    m_page-&gt;send(Messages::WebPageProxy::RecordAutocorrectionResponse(responseType, replacedString, replacementString));
</del><ins>+    m_page-&gt;send(Messages::WebPageProxy::RecordAutocorrectionResponse(static_cast&lt;int32_t&gt;(response), replacedString, replacementString));
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/ChangeLog (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/ChangeLog        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Tools/ChangeLog        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -1,5 +1,37 @@
</span><span class="cx"> 2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210266. rdar://problem/29447824
+
+    2017-01-03  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            NSSpellChecker's recordResponse isn't called for unseen automatic corrections
+            https://bugs.webkit.org/show_bug.cgi?id=166450
+            &lt;rdar://problem/29447824&gt;
+
+            Reviewed by Darin Adler.
+
+            * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+            * DumpRenderTree/TestRunner.cpp:
+            (TestRunner::staticFunctions):
+            * DumpRenderTree/mac/TestRunnerMac.mm:
+            (setSpellCheckerLoggingEnabledCallback):
+            * DumpRenderTree/win/TestRunnerWin.cpp:
+            (setSpellCheckerLoggingEnabledCallback):
+            * DumpRenderTree/mac/DumpRenderTree.mm:
+            (resetWebViewToConsistentStateBeforeTesting):
+            * DumpRenderTree/mac/DumpRenderTreeSpellChecker.h: Added.
+            * DumpRenderTree/mac/DumpRenderTreeSpellChecker.mm: Added.
+            (stringForCorrectionResponse):
+            (drt_NSSpellChecker_recordResponseToCorrection):
+            (swizzleNSSpellCheckerMethodsIfNeeded):
+            (setSpellCheckerLoggingEnabled):
+            Add a new testRunner method, setSpellCheckerLoggingEnabled, which, when
+            set to true, logs to stdout (which ends up in the test result) whenever
+            NSSpellChecker recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
+            is called, and then calls the original method. It is reset to false between tests.
+
+2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210101. rdar://problem/28475977
</span><span class="cx"> 
</span><span class="cx">     2016-12-22  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreeDumpRenderTreexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx">                 29CFBA2E12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */; };
</span><span class="cx">                 2CE88FA217124D8C00734FC0 /* JavaScriptThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CE88FA117124CEE00734FC0 /* JavaScriptThreading.cpp */; };
</span><span class="cx">                 2D403F1B15087209005358D2 /* LayoutTestHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D403EA215087142005358D2 /* LayoutTestHelper.m */; };
</span><ins>+                2DA2E3A51E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DA2E3A41E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm */; };
</ins><span class="cx">                 31117B3D15D9A56A00163BC8 /* MockWebNotificationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */; };
</span><span class="cx">                 440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */; };
</span><span class="cx">                 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */; };
</span><span class="lines">@@ -291,6 +292,8 @@
</span><span class="cx">                 2CE88FA117124CEE00734FC0 /* JavaScriptThreading.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptThreading.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D403EA215087142005358D2 /* LayoutTestHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LayoutTestHelper.m; path = mac/LayoutTestHelper.m; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D403F19150871F9005358D2 /* LayoutTestHelper */ = {isa = PBXFileReference; explicitFileType = &quot;compiled.mach-o.executable&quot;; includeInIndex = 0; path = LayoutTestHelper; sourceTree = BUILT_PRODUCTS_DIR; };
</span><ins>+                2DA2E3A31E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DumpRenderTreeSpellChecker.h; path = mac/DumpRenderTreeSpellChecker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2DA2E3A41E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DumpRenderTreeSpellChecker.mm; path = mac/DumpRenderTreeSpellChecker.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 31117B3A15D9A56A00163BC8 /* MockWebNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockWebNotificationProvider.h; path = mac/MockWebNotificationProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockWebNotificationProvider.mm; path = mac/MockWebNotificationProvider.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -786,6 +789,8 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 A8B91ADF0CF3B372008F91FF /* DumpRenderTreePasteboard.h */,
</span><span class="cx">                                 A8B91AD70CF3B32F008F91FF /* DumpRenderTreePasteboard.m */,
</span><ins>+                                2DA2E3A31E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.h */,
+                                2DA2E3A41E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm */,
</ins><span class="cx">                                 A8B91ADD0CF3B372008F91FF /* DumpRenderTreeWindow.h */,
</span><span class="cx">                                 A8B91AD90CF3B32F008F91FF /* DumpRenderTreeWindow.mm */,
</span><span class="cx">                         );
</span><span class="lines">@@ -1096,6 +1101,7 @@
</span><span class="cx">                         files = (
</span><span class="cx">                                 A134E53618905EFF00901D06 /* AccessibilityCommonMac.mm in Sources */,
</span><span class="cx">                                 BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */,
</span><ins>+                                2DA2E3A51E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm in Sources */,
</ins><span class="cx">                                 AA5A15EF16E15CD000F7C561 /* AccessibilityControllerIOS.mm in Sources */,
</span><span class="cx">                                 BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */,
</span><span class="cx">                                 80045AEE147718E7008290A8 /* AccessibilityNotificationHandler.mm in Sources */,
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreeTestRunnercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.cpp (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.cpp        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.cpp        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -1779,6 +1779,15 @@
</span><span class="cx">     return JSValueMakeNumber(context, controller-&gt;imageCountInGeneralPasteboard());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef setSpellCheckerLoggingEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount &lt; 1)
+        return JSValueMakeUndefined(context);
+    TestRunner* controller = static_cast&lt;TestRunner*&gt;(JSObjectGetPrivate(thisObject));
+    controller-&gt;setSpellCheckerLoggingEnabled(JSValueToBoolean(context, arguments[0]));
+    return JSValueMakeUndefined(context);
+}
+
</ins><span class="cx"> // Static Values
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getTimeoutCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="lines">@@ -2225,6 +2234,7 @@
</span><span class="cx">         { &quot;accummulateLogsForChannel&quot;, accummulateLogsForChannel, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;runUIScript&quot;, runUIScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;imageCountInGeneralPasteboard&quot;, imageCountInGeneralPasteboardCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><ins>+        { &quot;setSpellCheckerLoggingEnabled&quot;, setSpellCheckerLoggingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx">         { 0, 0, 0 }
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreeTestRunnerh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.h (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.h        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Tools/DumpRenderTree/TestRunner.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -373,6 +373,8 @@
</span><span class="cx">     void setDumpJSConsoleLogInStdErr(bool inStdErr) { m_dumpJSConsoleLogInStdErr = inStdErr; }
</span><span class="cx">     bool dumpJSConsoleLogInStdErr() const { return m_dumpJSConsoleLogInStdErr; }
</span><span class="cx"> 
</span><ins>+    void setSpellCheckerLoggingEnabled(bool);
+
</ins><span class="cx"> private:
</span><span class="cx">     TestRunner(const std::string&amp; testURL, const std::string&amp; expectedPixelHash);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #import &quot;DefaultPolicyDelegate.h&quot;
</span><span class="cx"> #import &quot;DumpRenderTreeDraggingInfo.h&quot;
</span><span class="cx"> #import &quot;DumpRenderTreePasteboard.h&quot;
</span><ins>+#import &quot;DumpRenderTreeSpellChecker.h&quot;
</ins><span class="cx"> #import &quot;DumpRenderTreeWindow.h&quot;
</span><span class="cx"> #import &quot;EditingDelegate.h&quot;
</span><span class="cx"> #import &quot;EventSendingController.h&quot;
</span><span class="lines">@@ -1896,6 +1897,8 @@
</span><span class="cx"> 
</span><span class="cx">     [mainFrame _clearOpener];
</span><span class="cx"> 
</span><ins>+    setSpellCheckerLoggingEnabled(false);
+
</ins><span class="cx">     resetAccumulatedLogs();
</span><span class="cx">     WebCoreTestSupport::initializeLogChannelsIfNecessary();
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreemacDumpRenderTreeSpellCheckerh"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.h (0 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.h                                (rev 0)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.h        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+void setSpellCheckerLoggingEnabled(bool);
</ins></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreemacDumpRenderTreeSpellCheckermm"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.mm (0 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.mm                                (rev 0)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTreeSpellChecker.mm        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;DumpRenderTreeSpellChecker.h&quot;
+
+#if PLATFORM(MAC)
+
+#import &lt;AppKit/NSSpellChecker.h&gt;
+#import &lt;wtf/Assertions.h&gt;
+#import &lt;wtf/ObjcRuntimeExtras.h&gt;
+
+static bool spellCheckerLoggingEnabled;
+static IMP appKitRecordResponseIMP;
+
+static const char *stringForCorrectionResponse(NSCorrectionResponse correctionResponse)
+{
+    switch (correctionResponse) {
+    case NSCorrectionResponseNone:
+        return &quot;none&quot;;
+    case NSCorrectionResponseAccepted:
+        return &quot;accepted&quot;;
+    case NSCorrectionResponseRejected:
+        return &quot;rejected&quot;;
+    case NSCorrectionResponseIgnored:
+        return &quot;ignored&quot;;
+    case NSCorrectionResponseEdited:
+        return &quot;edited&quot;;
+    case NSCorrectionResponseReverted:
+        return &quot;reverted&quot;;
+    }
+
+    return &quot;invalid&quot;;
+}
+
+static void drt_NSSpellChecker_recordResponseToCorrection(id self, SEL _cmd, NSCorrectionResponse response, NSString *correction, NSString *word, NSString *language, NSInteger spellDocumentTag)
+{
+    if (spellCheckerLoggingEnabled)
+        printf(&quot;NSSpellChecker recordResponseToCorrection: %s -&gt; %s (response: %s)\n&quot;, [word UTF8String], [correction UTF8String], stringForCorrectionResponse(response));
+
+    wtfCallIMP&lt;void, NSCorrectionResponse, NSString *, NSString *, NSString *, NSInteger&gt;(appKitRecordResponseIMP, self, _cmd, response, correction, word, language, spellDocumentTag);
+}
+
+static void swizzleNSSpellCheckerMethodsIfNeeded()
+{
+    static bool hasSwizzled;
+    if (hasSwizzled)
+        return;
+    hasSwizzled = true;
+
+    Method recordResponseMethod = class_getInstanceMethod(objc_getClass(&quot;NSSpellChecker&quot;), @selector(recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:));
+
+    appKitRecordResponseIMP = method_setImplementation(recordResponseMethod, (IMP)drt_NSSpellChecker_recordResponseToCorrection);
+}
+
+void setSpellCheckerLoggingEnabled(bool enabled)
+{
+    swizzleNSSpellCheckerMethodsIfNeeded();
+
+    spellCheckerLoggingEnabled = enabled;
+}
+
+#else // PLATFORM(MAC)
+
+void setSpellCheckerLoggingEnabled(bool)
+{
+}
+
+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreemacTestRunnerMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/mac/TestRunnerMac.mm (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/mac/TestRunnerMac.mm        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/TestRunnerMac.mm        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #import &quot;TestRunner.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &quot;DefaultPolicyDelegate.h&quot;
</span><ins>+#import &quot;DumpRenderTreeSpellChecker.h&quot;
</ins><span class="cx"> #import &quot;EditingDelegate.h&quot;
</span><span class="cx"> #import &quot;MockGeolocationProvider.h&quot;
</span><span class="cx"> #import &quot;MockWebNotificationProvider.h&quot;
</span><span class="lines">@@ -210,6 +211,11 @@
</span><span class="cx">     [WebStorageManager setStorageDatabaseIdleInterval:interval];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestRunner::setSpellCheckerLoggingEnabled(bool enabled)
+{
+    ::setSpellCheckerLoggingEnabled(enabled);
+}
+
</ins><span class="cx"> void TestRunner::closeIdleLocalStorageDatabases()
</span><span class="cx"> {
</span><span class="cx">     [WebStorageManager closeIdleLocalStorageDatabases];
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreewinTestRunnerWincpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/win/TestRunnerWin.cpp (210354 => 210355)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2017-01-05 17:09:38 UTC (rev 210354)
+++ branches/safari-603-branch/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2017-01-05 17:09:49 UTC (rev 210355)
</span><span class="lines">@@ -1392,3 +1392,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestRunner::setSpellCheckerLoggingEnabled(bool enabled)
+{
+    printf(&quot;ERROR: TestRunner::setSpellCheckerLoggingEnabled() not implemented\n&quot;);
+}
</ins></span></pre>
</div>
</div>

</body>
</html>