<!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>[208624] trunk</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/208624">208624</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2016-11-11 16:20:00 -0800 (Fri, 11 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
https://bugs.webkit.org/show_bug.cgi?id=164538
&lt;rdar://problem/8418711&gt;

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adds autocorrect and autocapitalize getters and setters to HTMLElements. These check the `autocorrect` and
`autocapitalize` attributes and return whether or not the element supports autocorrect, and the
autocapitalization type, respectively. By default, autocorrection is enabled and autocapitalization is enabled
on the sentence level for elements. Also refactors/renames WebAutocapitalizeType so that in WebCore, we deal
solely with AutocapitalizeTypes and WebKit1 converts from AutocapitalizeType to WebAutocapitalizeType as needed
for UIKit.

Tests: fast/events/ios/contenteditable-autocapitalize.html
       fast/events/ios/contenteditable-autocorrect.html

* WebCore.xcodeproj/project.pbxproj:
* html/Autocapitalize.cpp:
(WebCore::autocapitalizeTypeForAttributeValue):
(WebCore::stringForAutocapitalizeType):
* html/Autocapitalize.h:
* html/AutocapitalizeTypes.h: Renamed from Source/WebCore/html/WebAutocapitalize.h.

Move WebAutocapitalizeType into AutocapitalizeTypes.h as simply AutocapitalizeType.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::autocapitalize):
(WebCore::HTMLElement::autocapitalizeType):
(WebCore::HTMLElement::setAutocapitalize):
(WebCore::HTMLElement::shouldAutocorrect):
(WebCore::HTMLElement::setAutocorrect):
* html/HTMLElement.h:
(WebCore::HTMLElement::autocorrect):
* html/HTMLElement.idl:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::shouldAutocorrect):
(WebCore::HTMLFormControlElement::autocapitalizeType):
(WebCore::HTMLFormControlElement::autocorrect): Deleted.
(WebCore::HTMLFormControlElement::setAutocorrect): Deleted.
(WebCore::HTMLFormControlElement::autocapitalize): Deleted.
(WebCore::HTMLFormControlElement::setAutocapitalize): Deleted.

Fold autocorrect/autocapitalize member functions into HTMLElement and remove element-specific code in
HTML(FormControl|Form)Element.cpp.

* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::shouldAutocorrect):
(WebCore::HTMLFormElement::autocorrect): Deleted.
(WebCore::HTMLFormElement::setAutocorrect): Deleted.
(WebCore::HTMLFormElement::autocapitalizeType): Deleted.
(WebCore::HTMLFormElement::autocapitalize): Deleted.
(WebCore::HTMLFormElement::setAutocapitalize): Deleted.
* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLTextAreaElement.idl:

Source/WebKit:

Introduce WebAutocapitalizeTypes.h to WebKit.

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

Account for renaming HTMLElement::autocorrect to HTMLElement::shouldAutocorrect, as well as moving
WebAutocapitalizeType to WebKit from WebCore. Additionally, moves the -autocorrect and -autocapitalize SPIs out
of HTML(Input|Form|TextArea)ElementPrivate.h and into HTMLElementPrivate.h. This also means removing redundant
code for interfacing with the unwrapped HTMLElement's autocorrect and autocapitalize attributes.

* DOM/DOMHTML.mm:
(webAutocapitalizeType):
(-[DOMHTMLInputElement _autocapitalizeType]):
(-[DOMHTMLTextAreaElement _autocapitalizeType]):
* DOM/DOMHTMLElement.mm:
(-[DOMHTMLElement autocorrect]):
(-[DOMHTMLElement setAutocorrect:]):
(-[DOMHTMLElement autocapitalize]):
(-[DOMHTMLElement setAutocapitalize:]):
* DOM/DOMHTMLElementPrivate.h: Copied from Source/WebCore/html/Autocapitalize.h.
* DOM/DOMHTMLFormElement.mm:
(-[DOMHTMLFormElement autocorrect]): Deleted.
(-[DOMHTMLFormElement setAutocorrect:]): Deleted.
(-[DOMHTMLFormElement autocapitalize]): Deleted.
(-[DOMHTMLFormElement setAutocapitalize:]): Deleted.
* DOM/DOMHTMLInputElement.mm:
(-[DOMHTMLInputElement autocorrect]): Deleted.
(-[DOMHTMLInputElement setAutocorrect:]): Deleted.
(-[DOMHTMLInputElement autocapitalize]): Deleted.
(-[DOMHTMLInputElement setAutocapitalize:]): Deleted.
* DOM/DOMHTMLInputElementPrivate.h:
* DOM/DOMHTMLTextAreaElement.mm:
(-[DOMHTMLTextAreaElement autocorrect]): Deleted.
(-[DOMHTMLTextAreaElement setAutocorrect:]): Deleted.
(-[DOMHTMLTextAreaElement autocapitalize]): Deleted.
(-[DOMHTMLTextAreaElement setAutocapitalize:]): Deleted.
* DOM/DOMHTMLTextAreaElementPrivate.h:

We need to import DOMHTMLElementPrivate.h here to avoid breaking UIKit. We should follow this up with a UIKit
change to import DOMHTMLElementPrivate.h directly.

* DOM/DOMPrivate.h:
* DOM/WebAutocapitalizeTypes.h: Copied from Tools/WebKitTestRunner/ios/UIKitSPI.h.
* MigrateHeaders.make:

Source/WebKit2:

Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
information for the currently assisted node.

* Shared/AssistedNodeInformation.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toUITextAutocapitalize):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

Tools:

Adds support for being able to test autocorrect and autocapitalize attributes in contenteditable areas. To do
this, we add removeAllDynamicDictionaries to UIScriptController in order to ensure that autocorrect suggestions
are reset to their defaults prior to running contenteditable-autocorrect-off.html.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::removeAllDynamicDictionaries):
* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort._createSimulatorApp):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::removeAllDynamicDictionaries):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView _keyboardDidShow:]):
(-[TestRunnerWKWebView _keyboardDidHide:]):

Work around an issue where consecutive UIKeyboardDidShowNotification would cause keyboard appearance callbacks
to be fired multiple times. This was causing a single key press to cause two characters to be typed. While this
does not affect the correctness of existing tests, the new autocorrection test requires this workaround.

* WebKitTestRunner/ios/UIKitSPI.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex):
(WTR::UIScriptController::removeAllDynamicDictionaries):

LayoutTests:

Adds new layout tests verifying that `autocorrect` and `autocapitalize` attributes can be used to opt out of
autocapitalization and autocorrection in a contenteditable area in WK2. Additionally, tests that autocorrection
and autocapitalization attributes may be changed by setting `element.autocorrect` and `element.autocapitalize`,
respectively.

* fast/events/ios/contenteditable-autocapitalize-none-expected.txt: Added.
* fast/events/ios/contenteditable-autocapitalize-none.html: Added.
* fast/events/ios/contenteditable-autocorrect-off-expected.txt: Added.
* fast/events/ios/contenteditable-autocorrect-off.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlAutocapitalizecpp">trunk/Source/WebCore/html/Autocapitalize.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlAutocapitalizeh">trunk/Source/WebCore/html/Autocapitalize.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementh">trunk/Source/WebCore/html/HTMLElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementidl">trunk/Source/WebCore/html/HTMLElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementcpp">trunk/Source/WebCore/html/HTMLFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementh">trunk/Source/WebCore/html/HTMLFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormElementcpp">trunk/Source/WebCore/html/HTMLFormElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormElementh">trunk/Source/WebCore/html/HTMLFormElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormElementidl">trunk/Source/WebCore/html/HTMLFormElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementidl">trunk/Source/WebCore/html/HTMLInputElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementidl">trunk/Source/WebCore/html/HTMLTextAreaElement.idl</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLmm">trunk/Source/WebKit/mac/DOM/DOMHTML.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLElementmm">trunk/Source/WebKit/mac/DOM/DOMHTMLElement.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLFormElementmm">trunk/Source/WebKit/mac/DOM/DOMHTMLFormElement.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLInputElementmm">trunk/Source/WebKit/mac/DOM/DOMHTMLInputElement.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLInputElementPrivateh">trunk/Source/WebKit/mac/DOM/DOMHTMLInputElementPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLTextAreaElementmm">trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElement.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLTextAreaElementPrivateh">trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElementPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMPrivateh">trunk/Source/WebKit/mac/DOM/DOMPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacMigrateHeadersmake">trunk/Source/WebKit/mac/MigrateHeaders.make</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAssistedNodeInformationh">trunk/Source/WebKit2/Shared/AssistedNodeInformation.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosUIScriptControllerIOSmm">trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl">trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptControllerh">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnercocoaTestRunnerWKWebViewmm">trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosUIKitSPIh">trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosUIScriptControllerIOSmm">trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventsioscontenteditableautocapitalizeexpectedtxt">trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsioscontenteditableautocapitalizehtml">trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize.html</a></li>
<li><a href="#trunkLayoutTestsfasteventsioscontenteditableautocorrectexpectedtxt">trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsioscontenteditableautocorrecthtml">trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect.html</a></li>
<li><a href="#trunkSourceWebCorehtmlAutocapitalizeTypesh">trunk/Source/WebCore/html/AutocapitalizeTypes.h</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMHTMLElementPrivateh">trunk/Source/WebKit/mac/DOM/DOMHTMLElementPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacDOMWebAutocapitalizeTypesh">trunk/Source/WebKit/mac/DOM/WebAutocapitalizeTypes.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlWebAutocapitalizeh">trunk/Source/WebCore/html/WebAutocapitalize.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/LayoutTests/ChangeLog        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=164538
+        &lt;rdar://problem/8418711&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Adds new layout tests verifying that `autocorrect` and `autocapitalize` attributes can be used to opt out of
+        autocapitalization and autocorrection in a contenteditable area in WK2. Additionally, tests that autocorrection
+        and autocapitalization attributes may be changed by setting `element.autocorrect` and `element.autocapitalize`,
+        respectively.
+
+        * fast/events/ios/contenteditable-autocapitalize-none-expected.txt: Added.
+        * fast/events/ios/contenteditable-autocapitalize-none.html: Added.
+        * fast/events/ios/contenteditable-autocorrect-off-expected.txt: Added.
+        * fast/events/ios/contenteditable-autocorrect-off.html: Added.
+
</ins><span class="cx"> 2016-11-11  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Updating class name doesn't update the slotted content's style
</span><span class="lines">@@ -67,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx">         * platform/ios-simulator/compositing/tiling/visiblerect-accumulated-offset-expected.txt: Added.
</span><span class="cx"> 
</span><del>-2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</del><ins>+2016-11-10  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</ins><span class="cx"> 
</span><span class="cx">         Composition state should be cleared when changing focus to a non-editable element
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=164595
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsioscontenteditableautocapitalizeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize-expected.txt (0 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize-expected.txt        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+To manually test, type 't' into the contenteditable. The 't' should not be autocapitalized.
+
+With autocapitalize: none, the output is: &quot;to&quot;
+With autocapitalize: sentences, the output is: &quot;To&quot;
+With autocapitalize: characters, the output is: &quot;TO&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsioscontenteditableautocapitalizehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize.html (0 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/contenteditable-autocapitalize.html        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+&lt;!DOCTYPE html&gt; &lt;!-- webkit-test-runner [ useFlexibleViewport=true ] --&gt;
+
+&lt;html&gt;
+
+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, user-scalable=no&quot;&gt;
+    &lt;script&gt;
+        let write = message =&gt; output.innerHTML += message + &quot;&lt;br&gt;&quot;;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        let remainingInputEventCount = 0;
+        let resolveExpectedInputEvents = null;
+        function handleInput() {
+            remainingInputEventCount--;
+            if (resolveExpectedInputEvents &amp;&amp; !remainingInputEventCount)
+                resolveExpectedInputEvents();
+        }
+
+        function runUIScriptAndExpectInputEvents(inputEventCount, nextAutocapitalizeType)
+        {
+            remainingInputEventCount = inputEventCount;
+            resolveExpectedInputEvents = () =&gt; {
+                write(`With autocapitalize: ${editable.autocapitalize}, the output is: &quot;${editable.textContent}&quot;`);
+                editable.autocapitalize = nextAutocapitalizeType;
+                editable.textContent = &quot;&quot;;
+                editable.blur();
+            };
+
+            return new Promise(function(resolve) {
+                let rect = editable.getBoundingClientRect();
+                testRunner.runUIScript(`(function() {
+                    uiController.didShowKeyboardCallback = function() {
+                        uiController.typeCharacterUsingHardwareKeyboard(&quot;t&quot;, function() {
+                            uiController.typeCharacterUsingHardwareKeyboard(&quot;o&quot;, function() {});
+                        });
+                    }
+                    uiController.didHideKeyboardCallback = function() {
+                        uiController.uiScriptComplete();
+                    }
+                    uiController.singleTapAtPoint(${rect.left + rect.width / 2}, ${rect.top + rect.height / 2}, function() {});
+                })();`, resolve);
+            });
+        }
+
+        function runTest()
+        {
+            if (!window.testRunner || !testRunner.runUIScript)
+                return;
+
+            runUIScriptAndExpectInputEvents(2, &quot;sentences&quot;)
+                .then(() =&gt; runUIScriptAndExpectInputEvents(2, &quot;characters&quot;))
+                .then(() =&gt; runUIScriptAndExpectInputEvents(2, null))
+                .then(() =&gt; testRunner.notifyDone());
+        }
+    &lt;/script&gt;
+    &lt;style&gt;
+    #editable {
+        width: 200px;
+        height: 100px;
+        top: 0;
+        left: 0;
+        position: absolute;
+    }
+    &lt;/style&gt;
+&lt;/head&gt;
+
+&lt;body onload=runTest()&gt;
+    &lt;div contenteditable autocapitalize=&quot;none&quot; id=&quot;editable&quot; oninput=handleInput()&gt;&lt;/div&gt;
+    &lt;p&gt;To manually test, type 't' into the contenteditable. The 't' should not be autocapitalized.&lt;/p&gt;
+    &lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsioscontenteditableautocorrectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect-expected.txt (0 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect-expected.txt        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+To manually test, type 'Ti' into the contenteditable and a space. The 'Ti' should not be autocorrected.
+
+With autocorrect off, the result is: &quot;Ti&quot;
+With autocorrect on, the result is: &quot;To&quot;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsioscontenteditableautocorrecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect.html (0 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/contenteditable-autocorrect.html        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+&lt;!DOCTYPE html&gt; &lt;!-- webkit-test-runner [ useFlexibleViewport=true ] --&gt;
+
+&lt;html&gt;
+
+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, user-scalable=no&quot;&gt;
+    &lt;script&gt;
+        let write = message =&gt; output.innerHTML += message + &quot;&lt;br&gt;&quot;;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        let remainingInputEventCount = 0;
+        let resolveExpectedInputEvents = null;
+        function handleInput() {
+            remainingInputEventCount--;
+            if (resolveExpectedInputEvents &amp;&amp; !remainingInputEventCount)
+                resolveExpectedInputEvents();
+        }
+
+        function runUIScriptAndExpectInputEvents(inputEventCount, nextAutocorrectValue)
+        {
+            remainingInputEventCount = inputEventCount;
+            resolveExpectedInputEvents = () =&gt; {
+                write(`With autocorrect ${editable.autocorrect ? &quot;on&quot; : &quot;off&quot;}, the result is: &quot;${editable.textContent.trim()}&quot;`);
+                editable.textContent = &quot;&quot;;
+                editable.autocorrect = nextAutocorrectValue;
+                editable.blur();
+            };
+
+            return new Promise(function(resolve) {
+                let rect = editable.getBoundingClientRect();
+                testRunner.runUIScript(`(function() {
+                    uiController.removeAllDynamicDictionaries();
+                    uiController.didShowKeyboardCallback = function() {
+                        uiController.typeCharacterUsingHardwareKeyboard(&quot;t&quot;, function() {
+                            uiController.typeCharacterUsingHardwareKeyboard(&quot;i&quot;, function() {
+                                uiController.typeCharacterUsingHardwareKeyboard(&quot; &quot;, function() { });
+                            });
+                        });
+                    }
+                    uiController.didHideKeyboardCallback = function() {
+                        uiController.uiScriptComplete();
+                    }
+                    uiController.singleTapAtPoint(${rect.left + rect.width / 2}, ${rect.top + rect.height / 2}, function() {});
+                })();`, resolve);
+            });
+        }
+
+        function runTest()
+        {
+            if (!window.testRunner || !testRunner.runUIScript)
+                return;
+
+            runUIScriptAndExpectInputEvents(3, &quot;on&quot;)
+                .then(() =&gt; runUIScriptAndExpectInputEvents(4, null))
+                .then(() =&gt; testRunner.notifyDone());
+        }
+    &lt;/script&gt;
+    &lt;style&gt;
+    #editable {
+        width: 200px;
+        height: 100px;
+        top: 0;
+        left: 0;
+        position: absolute;
+    }
+    &lt;/style&gt;
+&lt;/head&gt;
+
+&lt;body onload=runTest()&gt;
+    &lt;div style=&quot;font-size: 24px;&quot; contenteditable autocorrect=&quot;off&quot; id=&quot;editable&quot; oninput=handleInput()&gt;&lt;/div&gt;
+    &lt;p&gt;To manually test, type 'Ti' into the contenteditable and a space. The 'Ti' should not be autocorrected.&lt;/p&gt;
+    &lt;code&gt;&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;&lt;/code&gt;
+&lt;/body&gt;
+
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/ChangeLog        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=164538
+        &lt;rdar://problem/8418711&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Adds autocorrect and autocapitalize getters and setters to HTMLElements. These check the `autocorrect` and
+        `autocapitalize` attributes and return whether or not the element supports autocorrect, and the
+        autocapitalization type, respectively. By default, autocorrection is enabled and autocapitalization is enabled
+        on the sentence level for elements. Also refactors/renames WebAutocapitalizeType so that in WebCore, we deal
+        solely with AutocapitalizeTypes and WebKit1 converts from AutocapitalizeType to WebAutocapitalizeType as needed
+        for UIKit.
+
+        Tests: fast/events/ios/contenteditable-autocapitalize.html
+               fast/events/ios/contenteditable-autocorrect.html
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/Autocapitalize.cpp:
+        (WebCore::autocapitalizeTypeForAttributeValue):
+        (WebCore::stringForAutocapitalizeType):
+        * html/Autocapitalize.h:
+        * html/AutocapitalizeTypes.h: Renamed from Source/WebCore/html/WebAutocapitalize.h.
+
+        Move WebAutocapitalizeType into AutocapitalizeTypes.h as simply AutocapitalizeType.
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::autocapitalize):
+        (WebCore::HTMLElement::autocapitalizeType):
+        (WebCore::HTMLElement::setAutocapitalize):
+        (WebCore::HTMLElement::shouldAutocorrect):
+        (WebCore::HTMLElement::setAutocorrect):
+        * html/HTMLElement.h:
+        (WebCore::HTMLElement::autocorrect):
+        * html/HTMLElement.idl:
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::shouldAutocorrect):
+        (WebCore::HTMLFormControlElement::autocapitalizeType):
+        (WebCore::HTMLFormControlElement::autocorrect): Deleted.
+        (WebCore::HTMLFormControlElement::setAutocorrect): Deleted.
+        (WebCore::HTMLFormControlElement::autocapitalize): Deleted.
+        (WebCore::HTMLFormControlElement::setAutocapitalize): Deleted.
+
+        Fold autocorrect/autocapitalize member functions into HTMLElement and remove element-specific code in
+        HTML(FormControl|Form)Element.cpp.
+
+        * html/HTMLFormControlElement.h:
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::shouldAutocorrect):
+        (WebCore::HTMLFormElement::autocorrect): Deleted.
+        (WebCore::HTMLFormElement::setAutocorrect): Deleted.
+        (WebCore::HTMLFormElement::autocapitalizeType): Deleted.
+        (WebCore::HTMLFormElement::autocapitalize): Deleted.
+        (WebCore::HTMLFormElement::setAutocapitalize): Deleted.
+        * html/HTMLFormElement.h:
+        * html/HTMLFormElement.idl:
+        * html/HTMLInputElement.idl:
+        * html/HTMLTextAreaElement.idl:
+
</ins><span class="cx"> 2016-11-11  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Add support for paths as basic shapes.
</span><span class="lines">@@ -912,7 +972,7 @@
</span><span class="cx">         * css/parser/CSSPropertyParser.cpp:
</span><span class="cx">         (WebCore::CSSPropertyParser::parseShorthand):
</span><span class="cx"> 
</span><del>-2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</del><ins>+2016-11-10  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</ins><span class="cx"> 
</span><span class="cx">         Composition state should be cleared when changing focus to a non-editable element
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=164595
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -3986,7 +3986,7 @@
</span><span class="cx">                 A593CF8B1840535200BFCE27 /* InspectorWebAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF8A1840535200BFCE27 /* InspectorWebAgentBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5A2AF0B1829734300DE1729 /* PageDebuggable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5A2AF091829734300DE1729 /* PageDebuggable.cpp */; };
</span><span class="cx">                 A5A2AF0C1829734300DE1729 /* PageDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A2AF0A1829734300DE1729 /* PageDebuggable.h */; };
</span><del>-                A5A7AA43132F0ECC00D3A3C2 /* WebAutocapitalize.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A7AA42132F0ECC00D3A3C2 /* WebAutocapitalize.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                A5A7AA43132F0ECC00D3A3C2 /* AutocapitalizeTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A5A7AA42132F0ECC00D3A3C2 /* AutocapitalizeTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
</span><span class="cx">                 A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */; };
</span><span class="lines">@@ -11592,7 +11592,7 @@
</span><span class="cx">                 A593CF8A1840535200BFCE27 /* InspectorWebAgentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWebAgentBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5A2AF091829734300DE1729 /* PageDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageDebuggable.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5A2AF0A1829734300DE1729 /* PageDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageDebuggable.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A5A7AA42132F0ECC00D3A3C2 /* WebAutocapitalize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutocapitalize.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                A5A7AA42132F0ECC00D3A3C2 /* AutocapitalizeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutocapitalizeTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A5AFB34D115151A700B045CB /* StepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StepRange.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5AFB34E115151A700B045CB /* StepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StepRange.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyEventCocoa.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -18505,6 +18505,7 @@
</span><span class="cx">                                 B1AD4E7713A12A7200846B27 /* track */,
</span><span class="cx">                                 A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */,
</span><span class="cx">                                 A501920C132EBF2E008BFE55 /* Autocapitalize.h */,
</span><ins>+                                A5A7AA42132F0ECC00D3A3C2 /* AutocapitalizeTypes.h */,
</ins><span class="cx">                                 7C1843FB1C8B7283002EB973 /* Autofill.cpp */,
</span><span class="cx">                                 7C1843FC1C8B7283002EB973 /* Autofill.h */,
</span><span class="cx">                                 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */,
</span><span class="lines">@@ -18919,7 +18920,6 @@
</span><span class="cx">                                 15C77089100D3C6A005BA267 /* ValidityState.idl */,
</span><span class="cx">                                 E44613B40CD6344E00FADA75 /* VoidCallback.h */,
</span><span class="cx">                                 E44613A00CD6331000FADA75 /* VoidCallback.idl */,
</span><del>-                                A5A7AA42132F0ECC00D3A3C2 /* WebAutocapitalize.h */,
</del><span class="cx">                                 2D1932171DA64E1900A54A08 /* WebKitMediaKeyError.h */,
</span><span class="cx">                                 2D1932181DA64E1900A54A08 /* WebKitMediaKeyError.idl */,
</span><span class="cx">                                 F55B3DAB1251F12D003EF269 /* WeekInputType.cpp */,
</span><span class="lines">@@ -27991,7 +27991,7 @@
</span><span class="cx">                                 AA478A7F16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.h in Headers */,
</span><span class="cx">                                 2D3EF4481917915C00034184 /* WebActionDisablingCALayerDelegate.h in Headers */,
</span><span class="cx">                                 07D637401BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.h in Headers */,
</span><del>-                                A5A7AA43132F0ECC00D3A3C2 /* WebAutocapitalize.h in Headers */,
</del><ins>+                                A5A7AA43132F0ECC00D3A3C2 /* AutocapitalizeTypes.h in Headers */,
</ins><span class="cx">                                 A56C5B9B189F34570082D13C /* WebConsoleAgent.h in Headers */,
</span><span class="cx">                                 419BE7591BC7F42B00E1C85B /* WebCoreBuiltinNames.h in Headers */,
</span><span class="cx">                                 2D3EF44A1917915C00034184 /* WebCoreCALayerExtras.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAutocapitalizecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/Autocapitalize.cpp (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/Autocapitalize.cpp        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/Autocapitalize.cpp        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -30,43 +30,43 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WebAutocapitalizeType autocapitalizeTypeForAttributeValue(const AtomicString&amp; attributeValue)
</del><ins>+AutocapitalizeType autocapitalizeTypeForAttributeValue(const AtomicString&amp; attributeValue)
</ins><span class="cx"> {
</span><span class="cx">     // Omitted / missing values are the Default state.
</span><span class="cx">     if (attributeValue.isEmpty())
</span><del>-        return WebAutocapitalizeTypeDefault;
</del><ins>+        return AutocapitalizeTypeDefault;
</ins><span class="cx"> 
</span><span class="cx">     if (equalLettersIgnoringASCIICase(attributeValue, &quot;on&quot;) || equalLettersIgnoringASCIICase(attributeValue, &quot;sentences&quot;))
</span><del>-        return WebAutocapitalizeTypeSentences;
</del><ins>+        return AutocapitalizeTypeSentences;
</ins><span class="cx">     if (equalLettersIgnoringASCIICase(attributeValue, &quot;off&quot;) || equalLettersIgnoringASCIICase(attributeValue, &quot;none&quot;))
</span><del>-        return WebAutocapitalizeTypeNone;
</del><ins>+        return AutocapitalizeTypeNone;
</ins><span class="cx">     if (equalLettersIgnoringASCIICase(attributeValue, &quot;words&quot;))
</span><del>-        return WebAutocapitalizeTypeWords;
</del><ins>+        return AutocapitalizeTypeWords;
</ins><span class="cx">     if (equalLettersIgnoringASCIICase(attributeValue, &quot;characters&quot;))
</span><del>-        return WebAutocapitalizeTypeAllCharacters;
</del><ins>+        return AutocapitalizeTypeAllCharacters;
</ins><span class="cx"> 
</span><span class="cx">     // Unrecognized values fall back to &quot;on&quot;.
</span><del>-    return WebAutocapitalizeTypeSentences;
</del><ins>+    return AutocapitalizeTypeSentences;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-const AtomicString&amp; stringForAutocapitalizeType(WebAutocapitalizeType type)
</del><ins>+const AtomicString&amp; stringForAutocapitalizeType(AutocapitalizeType type)
</ins><span class="cx"> {
</span><span class="cx">     switch (type) {
</span><del>-    case WebAutocapitalizeTypeDefault:
</del><ins>+    case AutocapitalizeTypeDefault:
</ins><span class="cx">         return nullAtom;
</span><del>-    case WebAutocapitalizeTypeNone: {
</del><ins>+    case AutocapitalizeTypeNone: {
</ins><span class="cx">         static NeverDestroyed&lt;const AtomicString&gt; valueNone(&quot;none&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">         return valueNone;
</span><span class="cx">     }
</span><del>-    case WebAutocapitalizeTypeSentences: {
</del><ins>+    case AutocapitalizeTypeSentences: {
</ins><span class="cx">         static NeverDestroyed&lt;const AtomicString&gt; valueSentences(&quot;sentences&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">         return valueSentences;
</span><span class="cx">     }
</span><del>-    case WebAutocapitalizeTypeWords: {
</del><ins>+    case AutocapitalizeTypeWords: {
</ins><span class="cx">         static NeverDestroyed&lt;const AtomicString&gt; valueWords(&quot;words&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">         return valueWords;
</span><span class="cx">     }
</span><del>-    case WebAutocapitalizeTypeAllCharacters: {
</del><ins>+    case AutocapitalizeTypeAllCharacters: {
</ins><span class="cx">         static NeverDestroyed&lt;const AtomicString&gt; valueAllCharacters(&quot;characters&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">         return valueAllCharacters;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAutocapitalizeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/Autocapitalize.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/Autocapitalize.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/Autocapitalize.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -25,12 +25,12 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include &quot;WebAutocapitalize.h&quot;
</del><ins>+#include &quot;AutocapitalizeTypes.h&quot;
</ins><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WebAutocapitalizeType autocapitalizeTypeForAttributeValue(const AtomicString&amp;);
-const AtomicString&amp; stringForAutocapitalizeType(WebAutocapitalizeType);
</del><ins>+AutocapitalizeType autocapitalizeTypeForAttributeValue(const AtomicString&amp;);
+const AtomicString&amp; stringForAutocapitalizeType(AutocapitalizeType);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAutocapitalizeTypeshfromrev208623trunkSourceWebCorehtmlWebAutocapitalizeh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/AutocapitalizeTypes.h (from rev 208623, trunk/Source/WebCore/html/WebAutocapitalize.h) (0 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/AutocapitalizeTypes.h                                (rev 0)
+++ trunk/Source/WebCore/html/AutocapitalizeTypes.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2011 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. ``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
+ * 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.
+ */
+
+#pragma once
+
+typedef enum {
+    AutocapitalizeTypeDefault,
+    AutocapitalizeTypeNone,
+    AutocapitalizeTypeWords,
+    AutocapitalizeTypeSentences,
+    AutocapitalizeTypeAllCharacters
+} AutocapitalizeType;
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1059,6 +1059,37 @@
</span><span class="cx">     return canBeActuallyDisabled() &amp;&amp; isDisabledFormControl();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
+
+const AtomicString&amp; HTMLElement::autocapitalize() const
+{
+    return stringForAutocapitalizeType(autocapitalizeType());
+}
+
+AutocapitalizeType HTMLElement::autocapitalizeType() const
+{
+    return autocapitalizeTypeForAttributeValue(attributeWithoutSynchronization(HTMLNames::autocapitalizeAttr));
+}
+
+void HTMLElement::setAutocapitalize(const AtomicString&amp; value)
+{
+    setAttributeWithoutSynchronization(autocapitalizeAttr, value);
+}
+
+bool HTMLElement::shouldAutocorrect() const
+{
+    auto autocorrectValue = attributeWithoutSynchronization(HTMLNames::autocorrectAttr);
+    // Unrecognized values fall back to &quot;on&quot;.
+    return !equalLettersIgnoringASCIICase(autocorrectValue, &quot;off&quot;);
+}
+
+void HTMLElement::setAutocorrect(bool autocorrect)
+{
+    setAttributeWithoutSynchronization(autocorrectAttr, autocorrect ? AtomicString(&quot;on&quot;, AtomicString::ConstructFromLiteral) : AtomicString(&quot;off&quot;, AtomicString::ConstructFromLiteral));
+}
+
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLElement.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -22,6 +22,10 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
+#include &quot;Autocapitalize.h&quot;
+#endif
+
</ins><span class="cx"> #include &quot;StyledElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -92,6 +96,16 @@
</span><span class="cx">     bool canBeActuallyDisabled() const;
</span><span class="cx">     bool isActuallyDisabled() const;
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
+    WEBCORE_EXPORT virtual AutocapitalizeType autocapitalizeType() const;
+    WEBCORE_EXPORT const AtomicString&amp; autocapitalize() const;
+    WEBCORE_EXPORT void setAutocapitalize(const AtomicString&amp; value);
+
+    bool autocorrect() const { return shouldAutocorrect(); }
+    WEBCORE_EXPORT virtual bool shouldAutocorrect() const;
+    WEBCORE_EXPORT void setAutocorrect(bool);
+#endif
+
</ins><span class="cx"> protected:
</span><span class="cx">     HTMLElement(const QualifiedName&amp; tagName, Document&amp;, ConstructionType);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.idl (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.idl        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLElement.idl        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -47,6 +47,9 @@
</span><span class="cx"> 
</span><span class="cx">     [CEReactions] attribute boolean spellcheck;
</span><span class="cx"> 
</span><ins>+    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE] attribute boolean autocorrect;
+    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=EmptyString] attribute DOMString autocapitalize;
+
</ins><span class="cx">     void click();
</span><span class="cx"> 
</span><span class="cx">     void focus();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -602,25 +602,20 @@
</span><span class="cx"> 
</span><span class="cx"> // FIXME: We should look to share this code with class HTMLFormElement instead of duplicating the logic.
</span><span class="cx"> 
</span><del>-bool HTMLFormControlElement::autocorrect() const
</del><ins>+bool HTMLFormControlElement::shouldAutocorrect() const
</ins><span class="cx"> {
</span><span class="cx">     const AtomicString&amp; autocorrectValue = attributeWithoutSynchronization(autocorrectAttr);
</span><span class="cx">     if (!autocorrectValue.isEmpty())
</span><span class="cx">         return !equalLettersIgnoringASCIICase(autocorrectValue, &quot;off&quot;);
</span><span class="cx">     if (HTMLFormElement* form = this-&gt;form())
</span><del>-        return form-&gt;autocorrect();
</del><ins>+        return form-&gt;shouldAutocorrect();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLFormControlElement::setAutocorrect(bool autocorrect)
</del><ins>+AutocapitalizeType HTMLFormControlElement::autocapitalizeType() const
</ins><span class="cx"> {
</span><del>-    setAttributeWithoutSynchronization(autocorrectAttr, autocorrect ? AtomicString(&quot;on&quot;, AtomicString::ConstructFromLiteral) : AtomicString(&quot;off&quot;, AtomicString::ConstructFromLiteral));
-}
-
-WebAutocapitalizeType HTMLFormControlElement::autocapitalizeType() const
-{
-    WebAutocapitalizeType type = autocapitalizeTypeForAttributeValue(attributeWithoutSynchronization(autocapitalizeAttr));
-    if (type == WebAutocapitalizeTypeDefault) {
</del><ins>+    AutocapitalizeType type = HTMLElement::autocapitalizeType();
+    if (type == AutocapitalizeTypeDefault) {
</ins><span class="cx">         if (HTMLFormElement* form = this-&gt;form())
</span><span class="cx">             return form-&gt;autocapitalizeType();
</span><span class="cx">     }
</span><span class="lines">@@ -627,16 +622,6 @@
</span><span class="cx">     return type;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const AtomicString&amp; HTMLFormControlElement::autocapitalize() const
-{
-    return stringForAutocapitalizeType(autocapitalizeType());
-}
-
-void HTMLFormControlElement::setAutocapitalize(const AtomicString&amp; value)
-{
-    setAttributeWithoutSynchronization(autocapitalizeAttr, value);
-}
-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> HTMLFormControlElement* HTMLFormControlElement::enclosingFormControlElement(Node* node)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -92,12 +92,8 @@
</span><span class="cx">     virtual void setActivatedSubmit(bool) { }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
</span><del>-    WEBCORE_EXPORT bool autocorrect() const;
-    WEBCORE_EXPORT void setAutocorrect(bool);
-
-    WEBCORE_EXPORT WebAutocapitalizeType autocapitalizeType() const;
-    WEBCORE_EXPORT const AtomicString&amp; autocapitalize() const;
-    WEBCORE_EXPORT void setAutocapitalize(const AtomicString&amp;);
</del><ins>+    WEBCORE_EXPORT bool shouldAutocorrect() const final;
+    WEBCORE_EXPORT AutocapitalizeType autocapitalizeType() const final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool willValidate() const final;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.cpp        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -386,36 +386,16 @@
</span><span class="cx"> 
</span><span class="cx"> // FIXME: We should look to share this code with class HTMLFormControlElement instead of duplicating the logic.
</span><span class="cx"> 
</span><del>-bool HTMLFormElement::autocorrect() const
</del><ins>+bool HTMLFormElement::shouldAutocorrect() const
</ins><span class="cx"> {
</span><span class="cx">     const AtomicString&amp; autocorrectValue = attributeWithoutSynchronization(autocorrectAttr);
</span><span class="cx">     if (!autocorrectValue.isEmpty())
</span><span class="cx">         return !equalLettersIgnoringASCIICase(autocorrectValue, &quot;off&quot;);
</span><span class="cx">     if (HTMLFormElement* form = this-&gt;form())
</span><del>-        return form-&gt;autocorrect();
</del><ins>+        return form-&gt;shouldAutocorrect();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLFormElement::setAutocorrect(bool autocorrect)
-{
-    setAttributeWithoutSynchronization(autocorrectAttr, autocorrect ? AtomicString(&quot;on&quot;, AtomicString::ConstructFromLiteral) : AtomicString(&quot;off&quot;, AtomicString::ConstructFromLiteral));
-}
-
-WebAutocapitalizeType HTMLFormElement::autocapitalizeType() const
-{
-    return autocapitalizeTypeForAttributeValue(attributeWithoutSynchronization(autocapitalizeAttr));
-}
-
-const AtomicString&amp; HTMLFormElement::autocapitalize() const
-{
-    return stringForAutocapitalizeType(autocapitalizeType());
-}
-
-void HTMLFormElement::setAutocapitalize(const AtomicString&amp; value)
-{
-    setAttributeWithoutSynchronization(autocapitalizeAttr, value);
-}
-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REQUEST_AUTOCOMPLETE)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLFormElement.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -63,12 +63,7 @@
</span><span class="cx">     WEBCORE_EXPORT const AtomicString&amp; autocomplete() const;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
</span><del>-    WEBCORE_EXPORT bool autocorrect() const;
-    WEBCORE_EXPORT void setAutocorrect(bool);
-
-    WEBCORE_EXPORT WebAutocapitalizeType autocapitalizeType() const;
-    WEBCORE_EXPORT const AtomicString&amp; autocapitalize() const;
-    WEBCORE_EXPORT void setAutocapitalize(const AtomicString&amp;);
</del><ins>+    WEBCORE_EXPORT bool shouldAutocorrect() const final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Should rename these two functions to say &quot;form control&quot; or &quot;form-associated element&quot; instead of &quot;form element&quot;.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.idl (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.idl        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLFormElement.idl        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -40,10 +40,6 @@
</span><span class="cx"> 
</span><span class="cx">     getter Element (unsigned long index);
</span><span class="cx"> 
</span><del>-    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE] attribute boolean autocorrect;
-
-    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=EmptyString] attribute DOMString autocapitalize;
-
</del><span class="cx">     [ImplementedAs=submitFromJavaScript] void submit();
</span><span class="cx">     void reset();
</span><span class="cx">     boolean checkValidity();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.idl (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.idl        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLInputElement.idl        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -90,10 +90,6 @@
</span><span class="cx">     [Reflect] attribute DOMString useMap;
</span><span class="cx">     [Reflect] attribute boolean incremental;
</span><span class="cx"> 
</span><del>-    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE] attribute boolean autocorrect;
-
-    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=EmptyString] attribute DOMString autocapitalize;
-
</del><span class="cx">     // See http://www.w3.org/TR/html-media-capture/
</span><span class="cx">     [Conditional=MEDIA_CAPTURE, Reflect] attribute DOMString capture;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.idl (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.idl        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.idl        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -58,7 +58,5 @@
</span><span class="cx"> 
</span><span class="cx">     void setSelectionRange(optional long start = 0, optional long end = 0, optional DOMString direction);
</span><span class="cx"> 
</span><del>-    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE] attribute boolean autocorrect;
-    [Conditional=IOS_AUTOCORRECT_AND_AUTOCAPITALIZE, TreatNullAs=EmptyString] attribute DOMString autocapitalize;
</del><span class="cx">     attribute DOMString autocomplete;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlWebAutocapitalizeh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/WebAutocapitalize.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/WebAutocapitalize.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebCore/html/WebAutocapitalize.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 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. ``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
- * 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.
- */
-
-#ifndef WebAutocapitalize_h
-#define WebAutocapitalize_h
-
-typedef enum {
-    WebAutocapitalizeTypeDefault,
-    WebAutocapitalizeTypeNone,
-    WebAutocapitalizeTypeWords,
-    WebAutocapitalizeTypeSentences,
-    WebAutocapitalizeTypeAllCharacters
-} WebAutocapitalizeType;
-
-#endif // WebAutocapitalize_h
</del></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/ChangeLog        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=164538
+        &lt;rdar://problem/8418711&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Introduce WebAutocapitalizeTypes.h to WebKit.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2016-11-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -798,6 +798,8 @@
</span><span class="cx">                 E4AEF97C1C0DF4BC00B01727 /* WebResourceLoadScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AEF97A1C0DF4BC00B01727 /* WebResourceLoadScheduler.h */; };
</span><span class="cx">                 ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED5B9523111B725A00472298 /* WebLocalizableStrings.mm */; };
</span><span class="cx">                 ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                F4C98E5D1DD6476F0012FDEC /* DOMHTMLElementPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F4C98E5C1DD6476F0012FDEC /* DOMHTMLElementPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                F4F665C21DD67672007714B4 /* WebAutocapitalizeTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = F4F665C11DD67672007714B4 /* WebAutocapitalizeTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = F834AAD50E64B1C700E2737C /* WebTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */ = {isa = PBXBuildFile; fileRef = F834AAD60E64B1C700E2737C /* WebTextIterator.mm */; };
</span><span class="cx"> /* End PBXBuildFile section */
</span><span class="lines">@@ -1558,6 +1560,8 @@
</span><span class="cx">                 EDD1A5C605C83987008E3150 /* WebNSPrintOperationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPrintOperationExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 EDD1A5C705C83987008E3150 /* WebNSPrintOperationExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSPrintOperationExtras.m; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 EDE850CD06ECC79E005FAB05 /* WebPreferenceKeysPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferenceKeysPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><ins>+                F4C98E5C1DD6476F0012FDEC /* DOMHTMLElementPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLElementPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                F4F665C11DD67672007714B4 /* WebAutocapitalizeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAutocapitalizeTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 F508946902B71D59018A9CD4 /* WebNSViewExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSViewExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 F508946A02B71D59018A9CD4 /* WebNSViewExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSViewExtras.m; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 F5143A370221DCCE01A80181 /* WebFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrame.mm; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="lines">@@ -2350,6 +2354,7 @@
</span><span class="cx">                                 93D435821D57ABEE00AB85EA /* DOMHTMLElement.h */,
</span><span class="cx">                                 93D435831D57ABEE00AB85EA /* DOMHTMLElement.mm */,
</span><span class="cx">                                 93D435841D57ABEE00AB85EA /* DOMHTMLElementInternal.h */,
</span><ins>+                                F4C98E5C1DD6476F0012FDEC /* DOMHTMLElementPrivate.h */,
</ins><span class="cx">                                 93D435851D57ABEE00AB85EA /* DOMHTMLEmbedElement.h */,
</span><span class="cx">                                 93D435861D57ABEE00AB85EA /* DOMHTMLEmbedElement.mm */,
</span><span class="cx">                                 93D435871D57ABEE00AB85EA /* DOMHTMLFieldSetElement.h */,
</span><span class="lines">@@ -2550,6 +2555,7 @@
</span><span class="cx">                                 93D4364A1D57ABEE00AB85EA /* ObjCEventListener.mm */,
</span><span class="cx">                                 93D4364B1D57ABEE00AB85EA /* ObjCNodeFilterCondition.h */,
</span><span class="cx">                                 93D4364C1D57ABEE00AB85EA /* ObjCNodeFilterCondition.mm */,
</span><ins>+                                F4F665C11DD67672007714B4 /* WebAutocapitalizeTypes.h */,
</ins><span class="cx">                                 846171F90624AE5B0071A4A3 /* WebDOMOperations.h */,
</span><span class="cx">                                 846171FA0624AE5B0071A4A3 /* WebDOMOperations.mm */,
</span><span class="cx">                                 AB9FBBBA0F8582B0006ADC43 /* WebDOMOperationsInternal.h */,
</span><span class="lines">@@ -2731,6 +2737,7 @@
</span><span class="cx">                                 93D4364D1D57ABEE00AB85EA /* DOM.h in Headers */,
</span><span class="cx">                                 93D4364F1D57ABEE00AB85EA /* DOMAbstractView.h in Headers */,
</span><span class="cx">                                 93D436511D57ABEE00AB85EA /* DOMAbstractViewFrame.h in Headers */,
</span><ins>+                                F4F665C21DD67672007714B4 /* WebAutocapitalizeTypes.h in Headers */,
</ins><span class="cx">                                 93D436521D57ABEE00AB85EA /* DOMAbstractViewInternal.h in Headers */,
</span><span class="cx">                                 93D436531D57ABEE00AB85EA /* DOMAttr.h in Headers */,
</span><span class="cx">                                 93D436551D57ABEE00AB85EA /* DOMAttrInternal.h in Headers */,
</span><span class="lines">@@ -2761,6 +2768,7 @@
</span><span class="cx">                                 93D4367D1D57ABEE00AB85EA /* DOMCSSStyleRule.h in Headers */,
</span><span class="cx">                                 93D4367F1D57ABEE00AB85EA /* DOMCSSStyleSheet.h in Headers */,
</span><span class="cx">                                 93D436811D57ABEE00AB85EA /* DOMCSSStyleSheetInternal.h in Headers */,
</span><ins>+                                F4C98E5D1DD6476F0012FDEC /* DOMHTMLElementPrivate.h in Headers */,
</ins><span class="cx">                                 93D436821D57ABEE00AB85EA /* DOMCSSUnknownRule.h in Headers */,
</span><span class="cx">                                 93D436841D57ABEE00AB85EA /* DOMCSSValue.h in Headers */,
</span><span class="cx">                                 93D436861D57ABEE00AB85EA /* DOMCSSValueInternal.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=164538
+        &lt;rdar://problem/8418711&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Account for renaming HTMLElement::autocorrect to HTMLElement::shouldAutocorrect, as well as moving
+        WebAutocapitalizeType to WebKit from WebCore. Additionally, moves the -autocorrect and -autocapitalize SPIs out
+        of HTML(Input|Form|TextArea)ElementPrivate.h and into HTMLElementPrivate.h. This also means removing redundant
+        code for interfacing with the unwrapped HTMLElement's autocorrect and autocapitalize attributes.
+
+        * DOM/DOMHTML.mm:
+        (webAutocapitalizeType):
+        (-[DOMHTMLInputElement _autocapitalizeType]):
+        (-[DOMHTMLTextAreaElement _autocapitalizeType]):
+        * DOM/DOMHTMLElement.mm:
+        (-[DOMHTMLElement autocorrect]):
+        (-[DOMHTMLElement setAutocorrect:]):
+        (-[DOMHTMLElement autocapitalize]):
+        (-[DOMHTMLElement setAutocapitalize:]):
+        * DOM/DOMHTMLElementPrivate.h: Copied from Source/WebCore/html/Autocapitalize.h.
+        * DOM/DOMHTMLFormElement.mm:
+        (-[DOMHTMLFormElement autocorrect]): Deleted.
+        (-[DOMHTMLFormElement setAutocorrect:]): Deleted.
+        (-[DOMHTMLFormElement autocapitalize]): Deleted.
+        (-[DOMHTMLFormElement setAutocapitalize:]): Deleted.
+        * DOM/DOMHTMLInputElement.mm:
+        (-[DOMHTMLInputElement autocorrect]): Deleted.
+        (-[DOMHTMLInputElement setAutocorrect:]): Deleted.
+        (-[DOMHTMLInputElement autocapitalize]): Deleted.
+        (-[DOMHTMLInputElement setAutocapitalize:]): Deleted.
+        * DOM/DOMHTMLInputElementPrivate.h:
+        * DOM/DOMHTMLTextAreaElement.mm:
+        (-[DOMHTMLTextAreaElement autocorrect]): Deleted.
+        (-[DOMHTMLTextAreaElement setAutocorrect:]): Deleted.
+        (-[DOMHTMLTextAreaElement autocapitalize]): Deleted.
+        (-[DOMHTMLTextAreaElement setAutocapitalize:]): Deleted.
+        * DOM/DOMHTMLTextAreaElementPrivate.h:
+
+        We need to import DOMHTMLElementPrivate.h here to avoid breaking UIKit. We should follow this up with a UIKit
+        change to import DOMHTMLElementPrivate.h directly.
+
+        * DOM/DOMPrivate.h:
+        * DOM/WebAutocapitalizeTypes.h: Copied from Tools/WebKitTestRunner/ios/UIKitSPI.h.
+        * MigrateHeaders.make:
+
</ins><span class="cx"> 2016-11-11  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move to modern TouchBar methods
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTML.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTML.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMHTML.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -241,12 +241,28 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+static WebAutocapitalizeType webAutocapitalizeType(AutocapitalizeType type)
+{
+    switch (type) {
+    case AutocapitalizeTypeDefault:
+        return WebAutocapitalizeTypeDefault;
+    case AutocapitalizeTypeNone:
+        return WebAutocapitalizeTypeNone;
+    case AutocapitalizeTypeWords:
+        return WebAutocapitalizeTypeWords;
+    case AutocapitalizeTypeSentences:
+        return WebAutocapitalizeTypeSentences;
+    case AutocapitalizeTypeAllCharacters:
+        return WebAutocapitalizeTypeAllCharacters;
+    }
+}
+
</ins><span class="cx"> @implementation DOMHTMLInputElement (AutocapitalizeAdditions)
</span><span class="cx"> 
</span><span class="cx"> - (WebAutocapitalizeType)_autocapitalizeType
</span><span class="cx"> {
</span><span class="cx">     WebCore::HTMLInputElement* inputElement = core(self);
</span><del>-    return static_cast&lt;WebAutocapitalizeType&gt;(inputElement-&gt;autocapitalizeType());
</del><ins>+    return webAutocapitalizeType(inputElement-&gt;autocapitalizeType());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="lines">@@ -256,7 +272,7 @@
</span><span class="cx"> - (WebAutocapitalizeType)_autocapitalizeType
</span><span class="cx"> {
</span><span class="cx">     WebCore::HTMLTextAreaElement* textareaElement = core(self);
</span><del>-    return static_cast&lt;WebAutocapitalizeType&gt;(textareaElement-&gt;autocapitalizeType());
</del><ins>+    return webAutocapitalizeType(textareaElement-&gt;autocapitalizeType());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLElement.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLElement.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLElement.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -256,6 +256,34 @@
</span><span class="cx">     IMPL-&gt;click();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
+
+- (BOOL)autocorrect
+{
+    WebCore::JSMainThreadNullState state;
+    return IMPL-&gt;shouldAutocorrect();
+}
+
+- (void)setAutocorrect:(BOOL)newAutocorrect
+{
+    WebCore::JSMainThreadNullState state;
+    IMPL-&gt;setAutocorrect(newAutocorrect);
+}
+
+- (NSString *)autocapitalize
+{
+    WebCore::JSMainThreadNullState state;
+    return IMPL-&gt;autocapitalize();
+}
+
+- (void)setAutocapitalize:(NSString *)newAutocapitalize
+{
+    WebCore::JSMainThreadNullState state;
+    IMPL-&gt;setAutocapitalize(newAutocapitalize);
+}
+
+#endif
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> WebCore::HTMLElement* core(DOMHTMLElement *wrapper)
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLElementPrivatehfromrev208623trunkSourceWebCorehtmlAutocapitalizeh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/mac/DOM/DOMHTMLElementPrivate.h (from rev 208623, trunk/Source/WebCore/html/Autocapitalize.h) (0 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLElementPrivate.h                                (rev 0)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLElementPrivate.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2016 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. ``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
+ * 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 &lt;WebKitLegacy/DOMHTMLElement.h&gt;
+
+@interface DOMHTMLElement (DOMHTMLElementPrivate)
+
+@property BOOL autocorrect;
+@property (copy) NSString *autocapitalize;
+
+@end
</ins></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLFormElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLFormElement.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLFormElement.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLFormElement.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -161,34 +161,6 @@
</span><span class="cx">     return IMPL-&gt;length();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
-- (BOOL)autocorrect
-{
-    WebCore::JSMainThreadNullState state;
-    return IMPL-&gt;autocorrect();
-}
-
-- (void)setAutocorrect:(BOOL)newAutocorrect
-{
-    WebCore::JSMainThreadNullState state;
-    IMPL-&gt;setAutocorrect(newAutocorrect);
-}
-#endif
-
-#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
-- (NSString *)autocapitalize
-{
-    WebCore::JSMainThreadNullState state;
-    return IMPL-&gt;autocapitalize();
-}
-
-- (void)setAutocapitalize:(NSString *)newAutocapitalize
-{
-    WebCore::JSMainThreadNullState state;
-    IMPL-&gt;setAutocapitalize(newAutocapitalize);
-}
-#endif
-
</del><span class="cx"> - (void)submit
</span><span class="cx"> {
</span><span class="cx">     WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLInputElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLInputElement.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLInputElement.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLInputElement.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -592,34 +592,6 @@
</span><span class="cx">     return [self _getURLAttribute:@&quot;src&quot;];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
-- (BOOL)autocorrect
-{
-    WebCore::JSMainThreadNullState state;
-    return IMPL-&gt;autocorrect();
-}
-
-- (void)setAutocorrect:(BOOL)newAutocorrect
-{
-    WebCore::JSMainThreadNullState state;
-    IMPL-&gt;setAutocorrect(newAutocorrect);
-}
-#endif
-
-#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
-- (NSString *)autocapitalize
-{
-    WebCore::JSMainThreadNullState state;
-    return IMPL-&gt;autocapitalize();
-}
-
-- (void)setAutocapitalize:(NSString *)newAutocapitalize
-{
-    WebCore::JSMainThreadNullState state;
-    IMPL-&gt;setAutocapitalize(newAutocapitalize);
-}
-#endif
-
</del><span class="cx"> #if ENABLE(MEDIA_CAPTURE)
</span><span class="cx"> - (BOOL)capture
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLInputElementPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLInputElementPrivate.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLInputElementPrivate.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLInputElementPrivate.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#import &lt;WebKitLegacy/DOMHTMLElementPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKitLegacy/DOMHTMLInputElement.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @class DOMHTMLElement;
</span><span class="lines">@@ -51,8 +52,6 @@
</span><span class="cx"> @property (readonly, strong) DOMNodeList *labels;
</span><span class="cx"> @property (copy) NSString *selectionDirection;
</span><span class="cx"> @property BOOL incremental;
</span><del>-@property BOOL autocorrect;
-@property (copy) NSString *autocapitalize;
</del><span class="cx"> @property BOOL capture;
</span><span class="cx"> 
</span><span class="cx"> - (void)stepUp:(int)n;
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLTextAreaElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElement.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElement.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElement.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -325,32 +325,4 @@
</span><span class="cx">     unwrap(*self).setSelectionRange(start, end);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
-
-- (BOOL)autocorrect
-{
-    JSMainThreadNullState state;
-    return unwrap(*self).autocorrect();
-}
-
-- (void)setAutocorrect:(BOOL)newAutocorrect
-{
-    JSMainThreadNullState state;
-    unwrap(*self).setAutocorrect(newAutocorrect);
-}
-
-- (NSString *)autocapitalize
-{
-    JSMainThreadNullState state;
-    return unwrap(*self).autocapitalize();
-}
-
-- (void)setAutocapitalize:(NSString *)newAutocapitalize
-{
-    JSMainThreadNullState state;
-    unwrap(*self).setAutocapitalize(newAutocapitalize);
-}
-
-#endif
-
</del><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMHTMLTextAreaElementPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElementPrivate.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElementPrivate.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLTextAreaElementPrivate.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#import &lt;WebKitLegacy/DOMHTMLElementPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKitLegacy/DOMHTMLTextAreaElement.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @class DOMNodeList;
</span><span class="lines">@@ -37,8 +38,6 @@
</span><span class="cx"> @property (readonly) unsigned textLength;
</span><span class="cx"> @property (readonly, strong) DOMNodeList *labels;
</span><span class="cx"> @property (copy) NSString *selectionDirection;
</span><del>-@property BOOL autocorrect;
-@property (copy) NSString *autocapitalize;
</del><span class="cx"> @property (copy) NSString *autocomplete;
</span><span class="cx"> - (void)setRangeText:(NSString *)replacement;
</span><span class="cx"> - (void)setRangeText:(NSString *)replacement start:(unsigned)start end:(unsigned)end selectionMode:(NSString *)selectionMode;
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOMPrivate.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOMPrivate.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/DOM/DOMPrivate.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -25,9 +25,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #import &lt;WebKitLegacy/DOM.h&gt;
</span><ins>+#import &lt;WebKitLegacy/WebAutocapitalizeTypes.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><del>-#import &lt;WebKitLegacy/WebAutocapitalize.h&gt;
</del><span class="cx"> #import &lt;CoreText/CoreText.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMWebAutocapitalizeTypeshfromrev208623trunkToolsWebKitTestRunneriosUIKitSPIh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/mac/DOM/WebAutocapitalizeTypes.h (from rev 208623, trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h) (0 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/WebAutocapitalizeTypes.h                                (rev 0)
+++ trunk/Source/WebKit/mac/DOM/WebAutocapitalizeTypes.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+typedef enum {
+    WebAutocapitalizeTypeDefault,
+    WebAutocapitalizeTypeNone,
+    WebAutocapitalizeTypeWords,
+    WebAutocapitalizeTypeSentences,
+    WebAutocapitalizeTypeAllCharacters
+} WebAutocapitalizeType;
</ins></span></pre></div>
<a id="trunkSourceWebKitmacMigrateHeadersmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/MigrateHeaders.make (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/MigrateHeaders.make        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit/mac/MigrateHeaders.make        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -200,7 +200,6 @@
</span><span class="cx">     $(PRIVATE_HEADERS_DIR)/WKGraphics.h \
</span><span class="cx">     $(PRIVATE_HEADERS_DIR)/WKTypes.h \
</span><span class="cx">     $(PRIVATE_HEADERS_DIR)/WKUtilities.h \
</span><del>-    $(PRIVATE_HEADERS_DIR)/WebAutocapitalize.h \
</del><span class="cx">     $(PRIVATE_HEADERS_DIR)/WebCoreFrameView.h \
</span><span class="cx">     $(PRIVATE_HEADERS_DIR)/WebCoreThread.h \
</span><span class="cx">     $(PRIVATE_HEADERS_DIR)/WebCoreThreadMessage.h \
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit2/ChangeLog        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=164538
+        &lt;rdar://problem/8418711&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
+        information for the currently assisted node.
+
+        * Shared/AssistedNodeInformation.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (toUITextAutocapitalize):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getAssistedNodeInformation):
+
</ins><span class="cx"> 2016-11-11  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move to modern TouchBar methods
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAssistedNodeInformationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/AssistedNodeInformation.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/AssistedNodeInformation.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit2/Shared/AssistedNodeInformation.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -27,9 +27,9 @@
</span><span class="cx"> #define AssistedNodeInformation_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentCoders.h&quot;
</span><ins>+#include &lt;WebCore/AutocapitalizeTypes.h&gt;
</ins><span class="cx"> #include &lt;WebCore/Autofill.h&gt;
</span><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><del>-#include &lt;WebCore/WebAutocapitalize.h&gt;
</del><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">     bool allowsUserScaling { false };
</span><span class="cx">     bool allowsUserScalingIgnoringAlwaysScalable { false };
</span><span class="cx">     bool insideFixedPosition { false };
</span><del>-    WebAutocapitalizeType autocapitalizeType { WebAutocapitalizeTypeDefault };
</del><ins>+    AutocapitalizeType autocapitalizeType { AutocapitalizeTypeDefault };
</ins><span class="cx">     InputType elementType { InputType::None };
</span><span class="cx">     String formAction;
</span><span class="cx">     Vector&lt;OptionItem&gt; selectOptions;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -2894,18 +2894,18 @@
</span><span class="cx"> 
</span><span class="cx"> // end of UITextInput protocol implementation
</span><span class="cx"> 
</span><del>-static UITextAutocapitalizationType toUITextAutocapitalize(WebAutocapitalizeType webkitType)
</del><ins>+static UITextAutocapitalizationType toUITextAutocapitalize(AutocapitalizeType webkitType)
</ins><span class="cx"> {
</span><span class="cx">     switch (webkitType) {
</span><del>-    case WebAutocapitalizeTypeDefault:
</del><ins>+    case AutocapitalizeTypeDefault:
</ins><span class="cx">         return UITextAutocapitalizationTypeSentences;
</span><del>-    case WebAutocapitalizeTypeNone:
</del><ins>+    case AutocapitalizeTypeNone:
</ins><span class="cx">         return UITextAutocapitalizationTypeNone;
</span><del>-    case WebAutocapitalizeTypeWords:
</del><ins>+    case AutocapitalizeTypeWords:
</ins><span class="cx">         return UITextAutocapitalizationTypeWords;
</span><del>-    case WebAutocapitalizeTypeSentences:
</del><ins>+    case AutocapitalizeTypeSentences:
</ins><span class="cx">         return UITextAutocapitalizationTypeSentences;
</span><del>-    case WebAutocapitalizeTypeAllCharacters:
</del><ins>+    case AutocapitalizeTypeAllCharacters:
</ins><span class="cx">         return UITextAutocapitalizationTypeAllCharacters;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> #import &lt;WebCore/GeometryUtilities.h&gt;
</span><span class="cx"> #import &lt;WebCore/HTMLAreaElement.h&gt;
</span><span class="cx"> #import &lt;WebCore/HTMLAttachmentElement.h&gt;
</span><ins>+#import &lt;WebCore/HTMLElement.h&gt;
</ins><span class="cx"> #import &lt;WebCore/HTMLElementTypeHelpers.h&gt;
</span><span class="cx"> #import &lt;WebCore/HTMLFormElement.h&gt;
</span><span class="cx"> #import &lt;WebCore/HTMLImageElement.h&gt;
</span><span class="lines">@@ -2577,8 +2578,8 @@
</span><span class="cx">         information.isMultiSelect = element.multiple();
</span><span class="cx">     } else if (is&lt;HTMLTextAreaElement&gt;(*m_assistedNode)) {
</span><span class="cx">         HTMLTextAreaElement&amp; element = downcast&lt;HTMLTextAreaElement&gt;(*m_assistedNode);
</span><del>-        information.autocapitalizeType = static_cast&lt;WebAutocapitalizeType&gt;(element.autocapitalizeType());
-        information.isAutocorrect = element.autocorrect();
</del><ins>+        information.autocapitalizeType = element.autocapitalizeType();
+        information.isAutocorrect = element.shouldAutocorrect();
</ins><span class="cx">         information.elementType = InputType::TextArea;
</span><span class="cx">         information.isReadOnly = element.isReadOnly();
</span><span class="cx">         information.value = element.value();
</span><span class="lines">@@ -2588,8 +2589,8 @@
</span><span class="cx">         HTMLFormElement* form = element.form();
</span><span class="cx">         if (form)
</span><span class="cx">             information.formAction = form-&gt;getURLAttribute(WebCore::HTMLNames::actionAttr);
</span><del>-        information.autocapitalizeType = static_cast&lt;WebAutocapitalizeType&gt;(element.autocapitalizeType());
-        information.isAutocorrect = element.autocorrect();
</del><ins>+        information.autocapitalizeType = element.autocapitalizeType();
+        information.isAutocorrect = element.shouldAutocorrect();
</ins><span class="cx">         if (element.isPasswordField())
</span><span class="cx">             information.elementType = InputType::Password;
</span><span class="cx">         else if (element.isSearchField())
</span><span class="lines">@@ -2633,8 +2634,14 @@
</span><span class="cx">         information.autofillFieldName = WebCore::toAutofillFieldName(element.autofillData().fieldName);
</span><span class="cx">     } else if (m_assistedNode-&gt;hasEditableStyle()) {
</span><span class="cx">         information.elementType = InputType::ContentEditable;
</span><del>-        information.isAutocorrect = true;   // FIXME: Should we look at the attribute?
-        information.autocapitalizeType = WebAutocapitalizeTypeSentences; // FIXME: Should we look at the attribute?
</del><ins>+        if (is&lt;HTMLElement&gt;(*m_assistedNode)) {
+            auto&amp; assistedElement = downcast&lt;HTMLElement&gt;(*m_assistedNode);
+            information.isAutocorrect = assistedElement.shouldAutocorrect();
+            information.autocapitalizeType = assistedElement.autocapitalizeType();
+        } else {
+            information.isAutocorrect = true;
+            information.autocapitalizeType = AutocapitalizeTypeDefault;
+        }
</ins><span class="cx">         information.isReadOnly = false;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/ChangeLog        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
+        https://bugs.webkit.org/show_bug.cgi?id=164538
+        &lt;rdar://problem/8418711&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Adds support for being able to test autocorrect and autocapitalize attributes in contenteditable areas. To do
+        this, we add removeAllDynamicDictionaries to UIScriptController in order to ensure that autocorrect suggestions
+        are reset to their defaults prior to running contenteditable-autocorrect-off.html.
+
+        * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+        (WTR::UIScriptController::removeAllDynamicDictionaries):
+        * Scripts/webkitpy/port/ios.py:
+        (IOSSimulatorPort._createSimulatorApp):
+        * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+        (WTR::UIScriptController::removeAllDynamicDictionaries):
+        * TestRunnerShared/UIScriptContext/UIScriptController.h:
+        * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+        (-[TestRunnerWKWebView _keyboardDidShow:]):
+        (-[TestRunnerWKWebView _keyboardDidHide:]):
+
+        Work around an issue where consecutive UIKeyboardDidShowNotification would cause keyboard appearance callbacks
+        to be fired multiple times. This was causing a single key press to cause two characters to be typed. While this
+        does not affect the correctness of existing tests, the new autocorrection test requires this workaround.
+
+        * WebKitTestRunner/ios/UIKitSPI.h:
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+        (WTR::UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex):
+        (WTR::UIScriptController::removeAllDynamicDictionaries):
+
</ins><span class="cx"> 2016-11-11  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build all Mac API tests
</span><span class="lines">@@ -18,7 +51,7 @@
</span><span class="cx">         * TestWebKitAPI/Tests/WTF/HashMap.cpp:
</span><span class="cx">         (TestWebKitAPI::TEST):
</span><span class="cx"> 
</span><del>-2016-11-11  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</del><ins>+2016-11-10  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</ins><span class="cx"> 
</span><span class="cx">         Composition state should be cleared when changing focus to a non-editable element
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=164595
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -215,6 +215,10 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::removeAllDynamicDictionaries()
+{
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -157,6 +157,7 @@
</span><span class="cx">     readonly attribute object selectionRangeViewRects; // An array of objects with 'left', 'top', 'width', and 'height' properties.
</span><span class="cx"> 
</span><span class="cx">     void insertText(DOMString text, long location, long length);
</span><ins>+    void removeAllDynamicDictionaries();
</ins><span class="cx"> 
</span><span class="cx">     void uiScriptComplete(DOMString result);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -278,6 +278,10 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::removeAllDynamicDictionaries()
+{
+}
+
</ins><span class="cx"> void UIScriptController::platformSetDidStartFormControlInteractionCallback()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -118,6 +118,7 @@
</span><span class="cx">     JSObjectRef selectionRangeViewRects() const;
</span><span class="cx"> 
</span><span class="cx">     void insertText(JSStringRef, int location, int length);
</span><ins>+    void removeAllDynamicDictionaries();
</ins><span class="cx"> 
</span><span class="cx">     void uiScriptComplete(JSStringRef result);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnercocoaTestRunnerWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> @interface TestRunnerWKWebView ()
</span><span class="cx"> @property (nonatomic, copy) void (^zoomToScaleCompletionHandler)(void);
</span><span class="cx"> @property (nonatomic, copy) void (^showKeyboardCompletionHandler)(void);
</span><ins>+@property (nonatomic) BOOL isShowingKeyboard;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation TestRunnerWKWebView
</span><span class="lines">@@ -123,6 +124,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_keyboardDidShow:(NSNotification *)notification
</span><span class="cx"> {
</span><ins>+    if (self.isShowingKeyboard)
+        return;
+
+    self.isShowingKeyboard = YES;
</ins><span class="cx">     if (self.didShowKeyboardCallback)
</span><span class="cx">         self.didShowKeyboardCallback();
</span><span class="cx"> }
</span><span class="lines">@@ -129,6 +134,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_keyboardDidHide:(NSNotification *)notification
</span><span class="cx"> {
</span><ins>+    if (!self.isShowingKeyboard)
+        return;
+
+    self.isShowingKeyboard = NO;
</ins><span class="cx">     if (self.didHideKeyboardCallback)
</span><span class="cx">         self.didHideKeyboardCallback();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosUIKitSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/WebKitTestRunner/ios/UIKitSPI.h        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> 
</span><span class="cx"> #import &lt;UIKit/UIApplication_Private.h&gt;
</span><ins>+#import &lt;UIKit/UIKeyboard.h&gt;
</ins><span class="cx"> #import &lt;UIKit/UIWindow_Private.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @interface UIKeyboardPredictionView : UIView
</span><span class="lines">@@ -55,6 +56,10 @@
</span><span class="cx"> - (uint32_t)_contextId;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+@interface UIKeyboard : UIView
++ (void)removeAllDynamicDictionaries;
+@end
+
</ins><span class="cx"> #endif // USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (208623 => 208624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm        2016-11-12 00:06:40 UTC (rev 208623)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm        2016-11-12 00:20:00 UTC (rev 208624)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import &quot;StringFunctions.h&quot;
</span><span class="cx"> #import &quot;TestController.h&quot;
</span><span class="cx"> #import &quot;TestRunnerWKWebView.h&quot;
</span><ins>+#import &quot;UIKitSPI.h&quot;
</ins><span class="cx"> #import &quot;UIScriptContext.h&quot;
</span><span class="cx"> #import &lt;JavaScriptCore/JavaScriptCore.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/OpaqueJSString.h&gt;
</span><span class="lines">@@ -276,7 +277,8 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><del>-    if (![[UIKeyboardPredictionViewClass activeInstance] hasPredictions]) {
</del><ins>+    UIKeyboardPredictionView *predictionView = (UIKeyboardPredictionView *)[UIKeyboardPredictionViewClass activeInstance];
+    if (![predictionView hasPredictions]) {
</ins><span class="cx">         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, interval * NSEC_PER_SEC), dispatch_get_main_queue(), ^() {
</span><span class="cx">             waitForTextPredictionsViewAndSelectCandidateAtIndex(index, callbackID, interval);
</span><span class="cx">         });
</span><span class="lines">@@ -284,10 +286,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     PlatformWKView webView = TestController::singleton().mainWebView()-&gt;platformView();
</span><del>-    CGRect predictionViewFrame = [[UIKeyboardPredictionViewClass activeInstance] frame];
</del><ins>+    CGRect predictionViewFrame = [predictionView frame];
</ins><span class="cx">     // This assumes there are 3 predicted text cells of equal width, which is the case on iOS.
</span><span class="cx">     float offsetX = (index * 2 + 1) * CGRectGetWidth(predictionViewFrame) / 6;
</span><del>-    float offsetY = CGRectGetHeight(webView.window.frame) - CGRectGetHeight([[[UIKeyboardPredictionViewClass activeInstance] superview] frame]) + CGRectGetHeight(predictionViewFrame) / 2;
</del><ins>+    float offsetY = CGRectGetHeight(webView.window.frame) - CGRectGetHeight([[predictionView superview] frame]) + CGRectGetHeight(predictionViewFrame) / 2;
</ins><span class="cx">     [[HIDEventGenerator sharedHIDEventGenerator] tap:CGPointMake(offsetX, offsetY) completionBlock:^{
</span><span class="cx">         if (m_context)
</span><span class="cx">             m_context-&gt;asyncTaskComplete(callbackID);
</span><span class="lines">@@ -392,6 +394,11 @@
</span><span class="cx">     return JSValueToObject(m_context-&gt;jsContext(), [JSValue valueWithObject:selectionRects inContext:[JSContext contextWithJSGlobalContextRef:m_context-&gt;jsContext()]].JSValueRef, nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::removeAllDynamicDictionaries()
+{
+    [UIKeyboard removeAllDynamicDictionaries];
+}
+
</ins><span class="cx"> void UIScriptController::platformSetDidStartFormControlInteractionCallback()
</span><span class="cx"> {
</span><span class="cx">     TestRunnerWKWebView *webView = TestController::singleton().mainWebView()-&gt;platformView();
</span></span></pre>
</div>
</div>

</body>
</html>