<!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>[197626] 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/197626">197626</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-03-05 18:17:29 -0800 (Sat, 05 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add support for processing the autofill field name out of form control elements ultimately to aid input methods
&lt;rdar://problem/23041180&gt;
https://bugs.webkit.org/show_bug.cgi?id=155079

Reviewed by Enrica Casucci.

Source/WebCore:

Added additional cases to fast/forms/autocomplete-tokens.html.

* WebCore.xcodeproj/project.pbxproj:
Add Autofill.h/cpp

* html/Autofill.cpp: Added.
(WebCore::fieldNameMap):
(WebCore::toAutofillFieldName):
(WebCore::isContactToken):
(WebCore::maxTokensForAutofillFieldCategory):
(WebCore::AutofillData::createFromHTMLFormControlElement):
* html/Autofill.h: Added.
(WebCore::AutofillData::AutofillData):
Refactored the autofill data processing algorithm into it's own file and added support
returning not just the IDL-exposed autofill value but also the autofill field name. The
code is structured simply enough that if we find a need for the hint set or scope information
we could return it as well.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::autocomplete):
(WebCore::HTMLFormControlElement::setAutocomplete):
(WebCore::HTMLFormControlElement::autofillMantle):
(WebCore::HTMLFormControlElement::autofillData):
Use AutofillData to implement these.

* html/HTMLFormControlElement.h:
Expose accessor for mantle and AutofillData.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::autocomplete):
* html/HTMLFormElement.h:
Switch to return an AtomicString as it will always
return one of two known values.

* testing/Internals.cpp:
(WebCore::Internals::autofillFieldName):
* testing/Internals.h:
* testing/Internals.idl:
Add accessor of the field name for testing purposes.

Source/WebKit2:

* Shared/AssistedNodeInformation.cpp:
(WebKit::AssistedNodeInformation::encode):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
Add AutofillFieldName. Convert some coders to use encodeEnum/decodeEnum instead of casting.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textInputTraits]):
Map AutofillFieldNames to the associated UITextContentTypes.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):
Extract the AutofillFieldNames onto the AssistedNodeInformation for &lt;input&gt; elements 
and &lt;textarea&gt; elements.

LayoutTests:

* fast/forms/autocomplete-tokens-expected.txt:
* fast/forms/autocomplete-tokens.html:
Update test to also test field names, as they are now exposed via internals.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastformsautocompletetokensexpectedtxt">trunk/LayoutTests/fast/forms/autocomplete-tokens-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastformsautocompletetokenshtml">trunk/LayoutTests/fast/forms/autocomplete-tokens.html</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</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="#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="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAssistedNodeInformationcpp">trunk/Source/WebKit2/Shared/AssistedNodeInformation.cpp</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlAutofillcpp">trunk/Source/WebCore/html/Autofill.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlAutofillh">trunk/Source/WebCore/html/Autofill.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/LayoutTests/ChangeLog        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-03-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add support for processing the autofill field name out of form control elements ultimately to aid input methods
+        &lt;rdar://problem/23041180&gt;
+        https://bugs.webkit.org/show_bug.cgi?id=155079
+
+        Reviewed by Enrica Casucci.
+
+        * fast/forms/autocomplete-tokens-expected.txt:
+        * fast/forms/autocomplete-tokens.html:
+        Update test to also test field names, as they are now exposed via internals.
+
</ins><span class="cx"> 2016-03-05  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for the object-position CSS property
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsautocompletetokensexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/autocomplete-tokens-expected.txt (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/autocomplete-tokens-expected.txt        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/LayoutTests/fast/forms/autocomplete-tokens-expected.txt        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -5,202 +5,395 @@
</span><span class="cx"> 
</span><span class="cx"> Valid keywords:
</span><span class="cx"> PASS input.autocomplete is &quot;name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;honorific-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;honorific-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;given-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;given-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;additional-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;additional-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;family-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;family-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;honorific-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;honorific-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;nickname&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;nickname&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;organization-title&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;organization-title&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;username&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;username&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;new-password&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;new-password&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;current-password&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;current-password&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;organization&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;organization&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;street-address&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;street-address&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;address-line1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;address-line2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;address-line3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;address-level4&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level4&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;address-level3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;address-level2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;address-level1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;country&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;country-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;postal-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;postal-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-given-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-given-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-additional-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-additional-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-family-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-family-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-number&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-number&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-exp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-exp&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-exp-month&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-exp-month&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-exp-year&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-exp-year&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-csc&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-csc&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;cc-type&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-type&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;transaction-currency&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;transaction-currency&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;transaction-amount&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;transaction-amount&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;language&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;language&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;bday&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;bday-day&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday-day&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;bday-month&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday-month&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;bday-year&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday-year&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;sex&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;sex&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;url&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;url&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;photo&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;photo&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel-country-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-country-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel-national&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-national&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel-area-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-area-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel-local&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel-local-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel-local-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;tel-extension&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-extension&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;email&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;email&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;impp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;impp&quot;
</ins><span class="cx"> 
</span><span class="cx"> Contact scope:
</span><span class="cx"> PASS input.autocomplete is &quot;home tel&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home tel-country-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-country-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home tel-national&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-national&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home tel-area-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-area-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home tel-local&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home tel-local-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home tel-local-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home tel-extension&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-extension&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home email&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;email&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;home impp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;impp&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel-country-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-country-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel-national&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-national&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel-area-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-area-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel-local&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel-local-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel-local-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work tel-extension&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-extension&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work email&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;email&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;work impp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;impp&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel-country-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-country-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel-national&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-national&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel-area-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-area-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel-local&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel-local-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel-local-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile tel-extension&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-extension&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile email&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;email&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;mobile impp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;impp&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel-country-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-country-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel-national&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-national&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel-area-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-area-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel-local&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel-local-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel-local-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax tel-extension&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-extension&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax email&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;email&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;fax impp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;impp&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel-country-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-country-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel-national&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-national&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel-area-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-area-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel-local&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel-local-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel-local-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager tel-extension&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-extension&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager email&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;email&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;pager impp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;impp&quot;
</ins><span class="cx"> 
</span><span class="cx"> Mode:
</span><span class="cx"> PASS input.autocomplete is &quot;shipping street-address&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;street-address&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping address-line1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping address-line2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping address-line3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping address-level4&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level4&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping address-level3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping address-level2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping address-level1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping country&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping country-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;shipping postal-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;postal-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing street-address&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;street-address&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing address-line1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing address-line2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing address-line3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing address-level4&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level4&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing address-level3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing address-level2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing address-level1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing country&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing country-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;billing postal-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;postal-code&quot;
</ins><span class="cx"> 
</span><span class="cx"> Section:
</span><span class="cx"> PASS input.autocomplete is &quot;section-parent name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent honorific-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;honorific-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent given-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;given-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent additional-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;additional-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent family-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;family-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent honorific-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;honorific-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent nickname&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;nickname&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent organization-title&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;organization-title&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent username&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;username&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent new-password&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;new-password&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent current-password&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;current-password&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent organization&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;organization&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent street-address&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;street-address&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent address-line1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent address-line2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent address-line3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-line3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent address-level4&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level4&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent address-level3&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level3&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent address-level2&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level2&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent address-level1&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;address-level1&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent country&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent country-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;country-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent postal-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;postal-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-given-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-given-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-additional-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-additional-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-family-name&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-family-name&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-number&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-number&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-exp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-exp&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-exp-month&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-exp-month&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-exp-year&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-exp-year&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-csc&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-csc&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent cc-type&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;cc-type&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent transaction-currency&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;transaction-currency&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent transaction-amount&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;transaction-amount&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent language&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;language&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent bday&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent bday-day&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday-day&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent bday-month&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday-month&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent bday-year&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;bday-year&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent sex&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;sex&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent url&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;url&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent photo&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;photo&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel-country-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-country-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel-national&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-national&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel-area-code&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-area-code&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel-local&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel-local-prefix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-prefix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel-local-suffix&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-local-suffix&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent tel-extension&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;tel-extension&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent email&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;email&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;section-parent impp&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;impp&quot;
</ins><span class="cx"> 
</span><span class="cx"> Invalid combinations:
</span><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
</ins><span class="cx"> PASS input.autocomplete is &quot;&quot;
</span><ins>+PASS window.internals.autofillFieldName(input) is &quot;on&quot;
+PASS inputInAutocompleteOffForm.autocomplete is &quot;&quot;
+PASS window.internals.autofillFieldName(inputInAutocompleteOffForm) is &quot;off&quot;
+PASS inputInAutocompleteOffForm.autocomplete is &quot;&quot;
+PASS window.internals.autofillFieldName(inputInAutocompleteOffForm) is &quot;on&quot;
</ins><span class="cx"> 
</span><span class="cx"> Non-autocompleteable controls:
</span><span class="cx"> PASS button.autocomplete is &quot;invalid&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastformsautocompletetokenshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/forms/autocomplete-tokens.html (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/forms/autocomplete-tokens.html        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/LayoutTests/fast/forms/autocomplete-tokens.html        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx">             keywords.forEach(keyword =&gt; {
</span><span class="cx">                 input.autocomplete = keyword;
</span><span class="cx">                 shouldBeEqualToString('input.autocomplete', keyword);
</span><ins>+                if (window.internals)
+                    shouldBeEqualToString('window.internals.autofillFieldName(input)', keyword);
</ins><span class="cx">             });
</span><span class="cx"> 
</span><span class="cx">             debug('');
</span><span class="lines">@@ -34,6 +36,8 @@
</span><span class="cx">                 contactTokens.forEach(contactToken =&gt; {
</span><span class="cx">                     input.autocomplete = scopeToken + &quot; &quot; + contactToken;
</span><span class="cx">                     shouldBeEqualToString('input.autocomplete', scopeToken + &quot; &quot; + contactToken);
</span><ins>+                    if (window.internals)
+                        shouldBeEqualToString('window.internals.autofillFieldName(input)', contactToken);
</ins><span class="cx">                 })
</span><span class="cx">             });
</span><span class="cx"> 
</span><span class="lines">@@ -45,6 +49,8 @@
</span><span class="cx">                 addressTokens.forEach(addressToken =&gt; {
</span><span class="cx">                     input.autocomplete = modeToken + &quot; &quot; + addressToken;
</span><span class="cx">                     shouldBeEqualToString('input.autocomplete', modeToken + &quot; &quot; + addressToken);
</span><ins>+                    if (window.internals)
+                        shouldBeEqualToString('window.internals.autofillFieldName(input)', addressToken);
</ins><span class="cx">                 })
</span><span class="cx">             });
</span><span class="cx"> 
</span><span class="lines">@@ -54,6 +60,8 @@
</span><span class="cx">                 var value = &quot;section-parent &quot; + keyword;
</span><span class="cx">                 input.autocomplete = value;
</span><span class="cx">                 shouldBeEqualToString('input.autocomplete', value);
</span><ins>+                if (window.internals)
+                    shouldBeEqualToString('window.internals.autofillFieldName(input)', keyword);
</ins><span class="cx">             });
</span><span class="cx"> 
</span><span class="cx">             debug('');
</span><span class="lines">@@ -61,37 +69,72 @@
</span><span class="cx">             autocompleteableControls.forEach(control =&gt; {
</span><span class="cx">                  control.autocomplete = 'invalid';
</span><span class="cx">                  shouldBeEmptyString('input.autocomplete');
</span><ins>+                 if (window.internals)
+                     shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx">             });
</span><span class="cx">             // Two normal tokens
</span><span class="cx">             input.autocomplete = &quot;name name&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><span class="cx">             input.autocomplete = &quot;name bday&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><span class="cx">             // Contact scope token + non-contact token.
</span><span class="cx">             input.autocomplete = &quot;pager bday&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><span class="cx">             // Two contact scope tokens.
</span><span class="cx">             input.autocomplete = &quot;home work tel&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><span class="cx">             // Two mode tokens.
</span><span class="cx">             input.autocomplete = &quot;shipping billing tel&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><span class="cx">             // Two section tokens.
</span><span class="cx">             input.autocomplete = &quot;section-a section-b tel&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><span class="cx">             // Anything + on/off.
</span><span class="cx">             input.autocomplete = &quot;tel on&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><span class="cx">             input.autocomplete = &quot;tel off&quot;;
</span><span class="cx">             shouldBeEmptyString('input.autocomplete');
</span><ins>+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(input)', &quot;on&quot;);
</ins><span class="cx"> 
</span><ins>+            // Test dynamically changing the form owner's autocomplete attribute
+            // to ensure the field name correctly reflects it.
+            var form = document.createElement(&quot;form&quot;);
+            var inputInAutocompleteOffForm = document.createElement(&quot;input&quot;);
+            form.appendChild(inputInAutocompleteOffForm);
+            document.body.appendChild(form);
+            form.autocomplete = &quot;off&quot;;
+            inputInAutocompleteOffForm.autocomplete = &quot;&quot;;
+            shouldBeEmptyString('inputInAutocompleteOffForm.autocomplete');
+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(inputInAutocompleteOffForm)', &quot;off&quot;);
+
+            form.autocomplete = &quot;on&quot;;
+            shouldBeEmptyString('inputInAutocompleteOffForm.autocomplete');
+            if (window.internals)
+                shouldBeEqualToString('window.internals.autofillFieldName(inputInAutocompleteOffForm)', &quot;on&quot;);
+
</ins><span class="cx">             debug('');
</span><span class="cx">             debug('Non-autocompleteable controls:');
</span><span class="cx">             // Buttons and keygens are not autocompleteable, so their autocomplete attribute is not sanitized.
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -1612,6 +1612,7 @@
</span><span class="cx">     history/PageCache.cpp
</span><span class="cx"> 
</span><span class="cx">     html/AttributeDOMTokenList.cpp
</span><ins>+    html/Autofill.cpp
</ins><span class="cx">     html/BaseButtonInputType.cpp
</span><span class="cx">     html/BaseCheckableInputType.cpp
</span><span class="cx">     html/BaseChooserOnlyDateAndTimeInputType.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/ChangeLog        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2016-03-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add support for processing the autofill field name out of form control elements ultimately to aid input methods
+        &lt;rdar://problem/23041180&gt;
+        https://bugs.webkit.org/show_bug.cgi?id=155079
+
+        Reviewed by Enrica Casucci.
+
+        Added additional cases to fast/forms/autocomplete-tokens.html.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add Autofill.h/cpp
+
+        * html/Autofill.cpp: Added.
+        (WebCore::fieldNameMap):
+        (WebCore::toAutofillFieldName):
+        (WebCore::isContactToken):
+        (WebCore::maxTokensForAutofillFieldCategory):
+        (WebCore::AutofillData::createFromHTMLFormControlElement):
+        * html/Autofill.h: Added.
+        (WebCore::AutofillData::AutofillData):
+        Refactored the autofill data processing algorithm into it's own file and added support
+        returning not just the IDL-exposed autofill value but also the autofill field name. The
+        code is structured simply enough that if we find a need for the hint set or scope information
+        we could return it as well.
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::autocomplete):
+        (WebCore::HTMLFormControlElement::setAutocomplete):
+        (WebCore::HTMLFormControlElement::autofillMantle):
+        (WebCore::HTMLFormControlElement::autofillData):
+        Use AutofillData to implement these.
+
+        * html/HTMLFormControlElement.h:
+        Expose accessor for mantle and AutofillData.
+
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::autocomplete):
+        * html/HTMLFormElement.h:
+        Switch to return an AtomicString as it will always
+        return one of two known values.
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::autofillFieldName):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+        Add accessor of the field name for testing purposes.
+
</ins><span class="cx"> 2016-03-05  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix after r197612 (under ASAN/GuardMalloc).
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -2721,6 +2721,8 @@
</span><span class="cx">                 7AF9B20E18CFB5F400C64BEF /* JSVTTRegionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */; };
</span><span class="cx">                 7AF9B20F18CFB5F400C64BEF /* JSVTTRegionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */; };
</span><span class="cx">                 7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; };
</span><ins>+                7C1843FD1C8B7283002EB973 /* Autofill.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1843FB1C8B7283002EB973 /* Autofill.cpp */; };
+                7C1843FE1C8B7283002EB973 /* Autofill.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1843FC1C8B7283002EB973 /* Autofill.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 7C1E97271A9F9834007BF0FB /* AutoFillButtonElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C1E97251A9F9834007BF0FB /* AutoFillButtonElement.cpp */; };
</span><span class="cx">                 7C1E97281A9F9834007BF0FB /* AutoFillButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */; };
</span><span class="cx">                 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
</span><span class="lines">@@ -10345,6 +10347,8 @@
</span><span class="cx">                 7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTRegionList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTRegionList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C0406121C66EE9C00AF0711 /* NSScrollerImpSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSScrollerImpSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C1843FB1C8B7283002EB973 /* Autofill.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autofill.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C1843FC1C8B7283002EB973 /* Autofill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Autofill.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C1E97251A9F9834007BF0FB /* AutoFillButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AutoFillButtonElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoFillButtonElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -19035,6 +19039,8 @@
</span><span class="cx">                                 B1AD4E7713A12A7200846B27 /* track */,
</span><span class="cx">                                 A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */,
</span><span class="cx">                                 A501920C132EBF2E008BFE55 /* Autocapitalize.h */,
</span><ins>+                                7C1843FB1C8B7283002EB973 /* Autofill.cpp */,
+                                7C1843FC1C8B7283002EB973 /* Autofill.h */,
</ins><span class="cx">                                 379E61C5126CA5C300B63E8D /* BaseButtonInputType.cpp */,
</span><span class="cx">                                 379E61C6126CA5C300B63E8D /* BaseButtonInputType.h */,
</span><span class="cx">                                 379E61C7126CA5C300B63E8D /* BaseCheckableInputType.cpp */,
</span><span class="lines">@@ -26776,6 +26782,7 @@
</span><span class="cx">                                 B59DD69D11902A42007E9684 /* JSSQLTransactionCallback.h in Headers */,
</span><span class="cx">                                 B59DD6A111902A52007E9684 /* JSSQLTransactionErrorCallback.h in Headers */,
</span><span class="cx">                                 51E0BAEB0DA55D4A00A9E417 /* JSStorageEvent.h in Headers */,
</span><ins>+                                7C1843FE1C8B7283002EB973 /* Autofill.h in Headers */,
</ins><span class="cx">                                 89F60CDA15809D760075E157 /* JSStorageInfo.h in Headers */,
</span><span class="cx">                                 0FF5026A102BA9430066F39A /* JSStyleMedia.h in Headers */,
</span><span class="cx">                                 BCE0139B0C0BEF180043860A /* JSStyleSheet.h in Headers */,
</span><span class="lines">@@ -31159,6 +31166,7 @@
</span><span class="cx">                                 93309E04099E64920056E581 /* RemoveNodeCommand.cpp in Sources */,
</span><span class="cx">                                 93309E06099E64920056E581 /* RemoveNodePreservingChildrenCommand.cpp in Sources */,
</span><span class="cx">                                 7CD494CC1A86EB1D000A87EC /* RenderAttachment.cpp in Sources */,
</span><ins>+                                7C1843FD1C8B7283002EB973 /* Autofill.cpp in Sources */,
</ins><span class="cx">                                 BCEA485F097D93020094C9E4 /* RenderBlock.cpp in Sources */,
</span><span class="cx">                                 BC10D76717D8EE6E005E2626 /* RenderBlockFlow.cpp in Sources */,
</span><span class="cx">                                 BCEA4852097D93020094C9E4 /* RenderBlockLineLayout.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlAutofillcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/Autofill.cpp (0 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/Autofill.cpp                                (rev 0)
+++ trunk/Source/WebCore/html/Autofill.cpp        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -0,0 +1,316 @@
</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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Autofill.h&quot;
+
+#include &quot;HTMLFormControlElement.h&quot;
+#include &quot;HTMLFormElement.h&quot;
+#include &quot;HTMLNames.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/text/AtomicString.h&gt;
+#include &lt;wtf/text/AtomicStringHash.h&gt;
+
+namespace WebCore {
+
+enum class AutofillCategory {
+    Off,
+    Automatic,
+    Normal,
+    Contact,
+};
+
+struct AutofillInfo {
+    AutofillFieldName fieldName;
+    AutofillCategory category;
+};
+
+static HashMap&lt;AtomicString, AutofillInfo&gt;&amp; fieldNameMap()
+{
+    static NeverDestroyed&lt;HashMap&lt;AtomicString, AutofillInfo&gt;&gt; map;
+    if (map.get().isEmpty()) {
+        map.get().add(AtomicString(&quot;on&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::None, AutofillCategory::Off });
+        map.get().add(AtomicString(&quot;off&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::None,  AutofillCategory::Automatic });
+        map.get().add(AtomicString(&quot;name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Name, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;honorific-prefix&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::HonorificPrefix, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;given-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::GivenName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;additional-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AdditionalName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;family-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::FamilyName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;honorific-suffix&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::HonorificSuffix, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;nickname&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Nickname, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;username&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Username, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;new-password&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::NewPassword, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;current-password&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CurrentPassword, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;organization-title&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::OrganizationTitle, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;organization&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Organization, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;street-address&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::StreetAddress, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;address-line1&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AddressLine1, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;address-line2&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AddressLine2, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;address-line3&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AddressLine3, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;address-level4&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AddressLevel4, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;address-level3&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AddressLevel3, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;address-level2&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AddressLevel2, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;address-level1&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::AddressLevel1, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;country&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Country, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;country-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CountryName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;postal-code&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::PostalCode, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-given-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcGivenName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-additional-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcAdditionalName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-family-name&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcFamilyName, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-number&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcNumber, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-exp&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcExp, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-exp-month&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcExpMonth, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-exp-year&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcExpYear, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-csc&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcCsc, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;cc-type&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::CcType, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;transaction-currency&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TransactionCurrency, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;transaction-amount&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TransactionAmount, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;language&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Language, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;bday&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Bday, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;bday-day&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::BdayDay, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;bday-month&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::BdayMonth, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;bday-year&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::BdayYear, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;sex&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Sex, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;url&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::URL, AutofillCategory::Normal });
+        map.get().add(AtomicString(&quot;photo&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Photo, AutofillCategory::Normal });
+
+        map.get().add(AtomicString(&quot;tel&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Tel, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;tel-country-code&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TelCountryCode, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;tel-national&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TelNational, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;tel-area-code&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TelAreaCode, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;tel-local&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TelLocal, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;tel-local-prefix&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TelLocalPrefix, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;tel-local-suffix&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TelLocalSuffix, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;tel-extension&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::TelExtension, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;email&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Email, AutofillCategory::Contact });
+        map.get().add(AtomicString(&quot;impp&quot;, AtomicString::ConstructFromLiteral), AutofillInfo{ AutofillFieldName::Impp, AutofillCategory::Contact });
+    }
+
+    return map;
+}
+
+AutofillFieldName toAutofillFieldName(const AtomicString&amp; value)
+{
+    auto map = fieldNameMap();
+    auto it = map.find(value);
+    if (it == map.end())
+        return AutofillFieldName::None;
+    return it-&gt;value.fieldName;
+}
+
+static inline bool isContactToken(const AtomicString&amp; token)
+{
+    static NeverDestroyed&lt;AtomicString&gt; home(&quot;home&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; work(&quot;work&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; mobile(&quot;mobile&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; fax(&quot;fax&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; pager(&quot;pager&quot;, AtomicString::ConstructFromLiteral);
+
+    return token == home || token == work || token == mobile || token == fax || token == pager;
+}
+
+static unsigned maxTokensForAutofillFieldCategory(AutofillCategory category)
+{
+    switch (category) {
+    case AutofillCategory::Automatic:
+    case AutofillCategory::Off:
+        return 1;
+
+    case AutofillCategory::Normal:
+        return 3;
+
+    case AutofillCategory::Contact:
+        return 4;
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+// https://html.spec.whatwg.org/multipage/forms.html#processing-model-3
+AutofillData AutofillData::createFromHTMLFormControlElement(const HTMLFormControlElement&amp; element)
+{
+    static NeverDestroyed&lt;AtomicString&gt; on(&quot;on&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; off(&quot;off&quot;, AtomicString::ConstructFromLiteral);
+
+    // Label: Default
+    // 26. Let the element's IDL-exposed autofill value be the empty string, and its autofill hint set and autofill scope be empty.
+    // 27. If the element's autocomplete attribute is wearing the autofill anchor mantle, then let the element's autofill field name be the empty string and abort these steps.
+    // 28. Let form be the element's form owner, if any, or null otherwise.
+    // 29. If form is not null and form's autocomplete attribute is in the off state, then let the element's autofill field name be &quot;off&quot;. Otherwise, let the element's autofill field name be &quot;on&quot;.
+    auto defaultLabel = [&amp;] () -&gt; AutofillData {
+        if (element.autofillMantle() == AutofillMantle::Anchor)
+            return { emptyString(), emptyString() };
+        
+        auto form = element.form();
+        if (form &amp;&amp; form-&gt;autocomplete() == off)
+            return { off, emptyString() };
+        return { on, emptyString() };
+    };
+
+
+    const AtomicString&amp; attributeValue = element.fastGetAttribute(HTMLNames::autocompleteAttr);
+
+    // 1. If the element has no autocomplete attribute, then jump to the step labeled default.
+    if (attributeValue == nullAtom)
+        return defaultLabel();
+
+    // 2. Let tokens be the result of splitting the attribute's value on spaces.
+    SpaceSplitString tokens(attributeValue, true);
+
+    // 3. If tokens is empty, then jump to the step labeled default.
+    if (tokens.isEmpty())
+        return defaultLabel();
+    
+    // 4. Let index be the index of the last token in tokens
+    unsigned index = tokens.size() - 1;
+
+    // 5. If the indexth token in tokens is not an ASCII case-insensitive match for one of the
+    // tokens given in the first column of the following table, or if the number of tokens in
+    // tokens is greater than the maximum number given in the cell in the second column of that
+    // token's row, then jump to the step labeled default. Otherwise, let field be the string given
+    // in the cell of the first column of the matching row, and let category be the value of the
+    // cell in the third column of that same row.
+    auto&amp; map = fieldNameMap();
+
+    auto it = map.find(tokens[index]);
+    if (it == map.end())
+        return defaultLabel();
+    
+    auto category = it-&gt;value.category;
+
+    if (tokens.size() &gt; maxTokensForAutofillFieldCategory(category))
+        return defaultLabel();
+
+    const auto&amp; field = tokens[index];
+
+    // 6. If category is Off or Automatic but the element's autocomplete attribute is wearing the
+    // autofill anchor mantle, then jump to the step labeled default.
+    auto mantle = element.autofillMantle();
+    if ((category == AutofillCategory::Off || category == AutofillCategory::Automatic) &amp;&amp; mantle == AutofillMantle::Anchor)
+        return defaultLabel();
+
+    // 7. If category is Off, let the element's autofill field name be the string &quot;off&quot;, let its
+    // autofill hint set be empty, and let its IDL-exposed autofill value be the string &quot;off&quot;.
+    // Then, abort these steps.
+    if (category == AutofillCategory::Off)
+        return { off, off.get().string() };
+
+    // 8. If category is Automatic, let the element's autofill field name be the string &quot;on&quot;,
+    // let its autofill hint set be empty, and let its IDL-exposed autofill value be the string
+    // &quot;on&quot;. Then, abort these steps.
+    if (category == AutofillCategory::Off)
+        return { on, on.get().string() };
+
+    // 9. Let scope tokens be an empty list.
+    // 10. Let hint tokens be an empty set.
+
+    // NOTE: We are ignoring these steps as we don't currently make use of scope tokens or hint tokens anywhere.
+
+    // 11. Let IDL value have the same value as field.
+    String idlValue = field;
+
+    // 12, If the indexth token in tokens is the first entry, then skip to the step labeled done.
+    if (index == 0)
+        return { field, idlValue };
+
+    // 13. Decrement index by one
+    index--;
+
+    // 14. If category is Contact and the indexth token in tokens is an ASCII case-insensitive match
+    // for one of the strings in the following list, then run the substeps that follow:
+    const auto&amp; contactToken = tokens[index];
+    if (category == AutofillCategory::Contact &amp;&amp; isContactToken(contactToken)) {
+        // 1. Let contact be the matching string from the list above.
+        const auto&amp; contact = contactToken;
+
+        // 2. Insert contact at the start of scope tokens.
+        // 3. Add contact to hint tokens.
+
+        // NOTE: We are ignoring these steps as we don't currently make use of scope tokens or hint tokens anywhere.
+
+        // 4. Let IDL value be the concatenation of contact, a U+0020 SPACE character, and the previous
+        // value of IDL value (which at this point will always be field).
+        idlValue = WTF::makeString(contact, &quot; &quot;, idlValue);
+
+        // 5. If the indexth entry in tokens is the first entry, then skip to the step labeled done.
+        if (index == 0)
+            return { field, idlValue };
+
+        // 6. Decrement index by one.
+        index--;
+    }
+
+    // 15. If the indexth token in tokens is an ASCII case-insensitive match for one of the strings
+    // in the following list, then run the substeps that follow:
+    const auto&amp; modeToken = tokens[index];
+    if (equalIgnoringASCIICase(modeToken, &quot;shipping&quot;) || equalIgnoringASCIICase(modeToken, &quot;billing&quot;)) {
+        // 1. Let mode be the matching string from the list above.
+        const auto&amp; mode = modeToken;
+
+        // 2. Insert mode at the start of scope tokens.
+        // 3. Add mode to hint tokens.
+
+        // NOTE: We are ignoring these steps as we don't currently make use of scope tokens or hint tokens anywhere.
+
+        // 4. Let IDL value be the concatenation of mode, a U+0020 SPACE character, and the previous
+        // value of IDL value (which at this point will either be field or the concatenation of contact,
+        // a space, and field).
+        idlValue = WTF::makeString(mode, &quot; &quot;, idlValue);
+
+        // 5. If the indexth entry in tokens is the first entry, then skip to the step labeled done.
+        if (index == 0)
+            return { field, idlValue };
+
+        // 6. Decrement index by one.
+        index--;
+    }
+
+    // 16. If the indexth entry in tokens is not the first entry, then jump to the step labeled default.
+    if (index != 0)
+        return defaultLabel();
+
+    // 17. If the first eight characters of the indexth token in tokens are not an ASCII case-insensitive
+    // match for the string &quot;section-&quot;, then jump to the step labeled default.
+    const auto&amp; sectionToken = tokens[index];
+    if (!sectionToken.startsWithIgnoringASCIICase(&quot;section-&quot;))
+        return defaultLabel();
+
+    // 18. Let section be the indexth token in tokens, converted to ASCII lowercase.
+    const auto&amp; section = sectionToken;
+
+    // 19. Insert section at the start of scope tokens.
+
+    // NOTE: We are ignoring this step as we don't currently make use of scope tokens or hint tokens anywhere.
+
+    // 20. Let IDL value be the concatenation of section, a U+0020 SPACE character, and the previous
+    // value of IDL value.
+    idlValue = WTF::makeString(section, &quot; &quot;, idlValue);
+
+    return { field, idlValue };
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlAutofillh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/Autofill.h (0 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/Autofill.h                                (rev 0)
+++ trunk/Source/WebCore/html/Autofill.h        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -0,0 +1,118 @@
</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.
+ */
+
+#ifndef Autofill_h
+#define Autofill_h
+
+#include &lt;wtf/text/AtomicString.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+enum class AutofillMantle {
+    Expectation,
+    Anchor
+};
+
+enum class AutofillFieldName {
+    None,
+    Name,
+    HonorificPrefix,
+    GivenName,
+    AdditionalName,
+    FamilyName,
+    HonorificSuffix,
+    Nickname,
+    Username,
+    NewPassword,
+    CurrentPassword,
+    OrganizationTitle,
+    Organization,
+    StreetAddress,
+    AddressLine1,
+    AddressLine2,
+    AddressLine3,
+    AddressLevel4,
+    AddressLevel3,
+    AddressLevel2,
+    AddressLevel1,
+    Country,
+    CountryName,
+    PostalCode,
+    CcName,
+    CcGivenName,
+    CcAdditionalName,
+    CcFamilyName,
+    CcNumber,
+    CcExp,
+    CcExpMonth,
+    CcExpYear,
+    CcCsc,
+    CcType,
+    TransactionCurrency,
+    TransactionAmount,
+    Language,
+    Bday,
+    BdayDay,
+    BdayMonth,
+    BdayYear,
+    Sex,
+    URL,
+    Photo,
+    Tel,
+    TelCountryCode,
+    TelNational,
+    TelAreaCode,
+    TelLocal,
+    TelLocalPrefix,
+    TelLocalSuffix,
+    TelExtension,
+    Email,
+    Impp
+};
+
+WEBCORE_EXPORT AutofillFieldName toAutofillFieldName(const AtomicString&amp;);
+
+class HTMLFormControlElement;
+
+class AutofillData {
+public:
+    static AutofillData createFromHTMLFormControlElement(const HTMLFormControlElement&amp;);
+
+    AutofillData(const AtomicString&amp; fieldName, const String&amp; idlExposedValue)
+        : fieldName(fieldName)
+        , idlExposedValue(idlExposedValue)
+    {
+    }
+
+    // We could add support for hint tokens and scope tokens if those ever became useful to anyone.
+
+    AtomicString fieldName;
+    String idlExposedValue;
+};
+
+} // namespace
+
+#endif // Autofill_h
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;HTMLFormControlElement.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;Autofill.h&quot;
</ins><span class="cx"> #include &quot;ControlStates.h&quot;
</span><span class="cx"> #include &quot;ElementAncestorIterator.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="lines">@@ -611,167 +612,28 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isContactToken(const AtomicString&amp; token)
</del><ins>+String HTMLFormControlElement::autocomplete() const
</ins><span class="cx"> {
</span><del>-    return token == &quot;home&quot; || token == &quot;work&quot; || token == &quot;mobile&quot; || token == &quot;fax&quot; || token == &quot;pager&quot;;
</del><ins>+    return autofillData().idlExposedValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-enum class AutofillCategory {
-    Invalid,
-    Off,
-    Automatic,
-    Normal,
-    Contact,
-};
-
-static inline AutofillCategory categoryForAutofillFieldToken(const AtomicString&amp; token)
</del><ins>+void HTMLFormControlElement::setAutocomplete(const String&amp; value)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashMap&lt;AtomicString, AutofillCategory&gt;&gt; map;
-    if (map.get().isEmpty()) {
-        map.get().add(AtomicString(&quot;off&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Off);
-        map.get().add(AtomicString(&quot;on&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Automatic);
-
-        map.get().add(AtomicString(&quot;name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;honorific-prefix&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;given-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;additional-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;family-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;honorific-suffix&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;nickname&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;username&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;new-password&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;current-password&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;organization-title&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;organization&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;street-address&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;address-line1&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;address-line2&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;address-line3&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;address-level4&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;address-level3&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;address-level2&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;address-level1&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;country&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;country-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;postal-code&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-given-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-additional-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-family-name&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-number&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-exp&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-exp-month&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-exp-year&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-csc&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;cc-type&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;transaction-currency&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;transaction-amount&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;language&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;bday&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;bday-day&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;bday-month&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;bday-year&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;sex&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;url&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-        map.get().add(AtomicString(&quot;photo&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Normal);
-
-        map.get().add(AtomicString(&quot;tel&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;tel-country-code&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;tel-national&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;tel-area-code&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;tel-local&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;tel-local-prefix&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;tel-local-suffix&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;tel-extension&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;email&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-        map.get().add(AtomicString(&quot;impp&quot;, AtomicString::ConstructFromLiteral), AutofillCategory::Contact);
-    }
-
-    return map.get().get(token);
</del><ins>+    setAttribute(autocompleteAttr, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline unsigned maxTokensForAutofillFieldCategory(AutofillCategory category)
</del><ins>+AutofillMantle HTMLFormControlElement::autofillMantle() const
</ins><span class="cx"> {
</span><del>-    switch (category) {
-    case AutofillCategory::Invalid:
-        return 0;
-
-    case AutofillCategory::Automatic:
-    case AutofillCategory::Off:
-        return 1;
-
-    case AutofillCategory::Normal:
-        return 3;
-
-    case AutofillCategory::Contact:
-        return 4;
-    }
-    ASSERT_NOT_REACHED();
-    return 0;
</del><ins>+    return is&lt;HTMLInputElement&gt;(*this) &amp;&amp; downcast&lt;HTMLInputElement&gt;(this)-&gt;isInputTypeHidden() ? AutofillMantle::Anchor : AutofillMantle::Expectation;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// https://html.spec.whatwg.org/multipage/forms.html#processing-model-3
-String HTMLFormControlElement::autocomplete() const
</del><ins>+AutofillData HTMLFormControlElement::autofillData() const
</ins><span class="cx"> {
</span><del>-    bool wearingAutofillAnchorMantle = is&lt;HTMLInputElement&gt;(*this) &amp;&amp; downcast&lt;HTMLInputElement&gt;(this)-&gt;isInputTypeHidden();
</del><ins>+    // FIXME: We could cache the AutofillData if we we had an efficient way to invalidate the cache when
+    // the autofill mantle changed (due to a type change on an &lt;input&gt; element) or the element's form
+    // owner's autocomplete attribute changed or the form owner itself changed.
</ins><span class="cx"> 
</span><del>-    const AtomicString&amp; attributeValue = fastGetAttribute(autocompleteAttr);
-    SpaceSplitString tokens(attributeValue, true);
-    if (tokens.isEmpty()) {
-        if (wearingAutofillAnchorMantle)
-            return String();
-        return form() ? form()-&gt;autocomplete() : ASCIILiteral(&quot;on&quot;);
-    }
-
-    size_t currentTokenIndex = tokens.size() - 1;
-    const auto&amp; fieldToken = tokens[currentTokenIndex];
-    auto category = categoryForAutofillFieldToken(fieldToken);
-    if (category == AutofillCategory::Invalid)
-        return String();
-
-    if (tokens.size() &gt; maxTokensForAutofillFieldCategory(category))
-        return String();
-
-    if ((category == AutofillCategory::Off || category == AutofillCategory::Automatic) &amp;&amp; wearingAutofillAnchorMantle)
-        return String();
-
-    if (category == AutofillCategory::Off)
-        return ASCIILiteral(&quot;off&quot;);
-
-    if (category == AutofillCategory::Automatic)
-        return ASCIILiteral(&quot;on&quot;);
-
-    String result = fieldToken;
-    if (!currentTokenIndex--)
-        return result;
-
-    const auto&amp; contactToken = tokens[currentTokenIndex];
-    if (category == AutofillCategory::Contact &amp;&amp; isContactToken(contactToken)) {
-        result = contactToken + &quot; &quot; + result;
-        if (!currentTokenIndex--)
-            return result;
-    }
-
-    const auto&amp; modeToken = tokens[currentTokenIndex];
-    if (modeToken == &quot;shipping&quot; || modeToken == &quot;billing&quot;) {
-        result = modeToken + &quot; &quot; + result;
-        if (!currentTokenIndex--)
-            return result;
-    }
-
-    if (currentTokenIndex)
-        return String();
-
-    const auto&amp; sectionToken = tokens[currentTokenIndex];
-    if (!sectionToken.startsWith(&quot;section-&quot;))
-        return String();
-
-    return sectionToken + &quot; &quot; + result;
</del><ins>+    return AutofillData::createFromHTMLFormControlElement(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLFormControlElement::setAutocomplete(const String&amp; value)
-{
-    setAttribute(autocompleteAttr, value);
-}
-
</del><span class="cx"> } // namespace Webcore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.h        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #ifndef HTMLFormControlElement_h
</span><span class="cx"> #define HTMLFormControlElement_h
</span><span class="cx"> 
</span><ins>+#include &quot;Autofill.h&quot;
</ins><span class="cx"> #include &quot;FormAssociatedElement.h&quot;
</span><span class="cx"> #include &quot;LabelableElement.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -120,6 +121,10 @@
</span><span class="cx">     String autocomplete() const;
</span><span class="cx">     void setAutocomplete(const String&amp;);
</span><span class="cx"> 
</span><ins>+    AutofillMantle autofillMantle() const;
+
+    WEBCORE_EXPORT AutofillData autofillData() const;
+
</ins><span class="cx">     using Node::ref;
</span><span class="cx">     using Node::deref;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.cpp        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -865,10 +865,10 @@
</span><span class="cx">     setAttributeWithoutSynchronization(autocompleteAttr, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const String&amp; HTMLFormElement::autocomplete() const
</del><ins>+const AtomicString&amp; HTMLFormElement::autocomplete() const
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;const String&gt; on(&quot;on&quot;, String::ConstructFromLiteral);
-    static NeverDestroyed&lt;const String&gt; off(&quot;off&quot;, String::ConstructFromLiteral);
</del><ins>+    static NeverDestroyed&lt;AtomicString&gt; on(&quot;on&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; off(&quot;off&quot;, AtomicString::ConstructFromLiteral);
</ins><span class="cx"> 
</span><span class="cx">     return equalIgnoringASCIICase(fastGetAttribute(autocompleteAttr), &quot;off&quot;) ? off : on;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormElement.h (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormElement.h        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/html/HTMLFormElement.h        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     bool shouldAutocomplete() const;
</span><span class="cx"> 
</span><span class="cx">     void setAutocomplete(const AtomicString&amp;);
</span><del>-    const String&amp; autocomplete() const;
</del><ins>+    const AtomicString&amp; autocomplete() const;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
</span><span class="cx">     WEBCORE_EXPORT bool autocorrect() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;ActiveDOMCallbackMicrotask.h&quot;
</span><span class="cx"> #include &quot;AnimationController.h&quot;
</span><span class="cx"> #include &quot;ApplicationCacheStorage.h&quot;
</span><ins>+#include &quot;Autofill.h&quot;
</ins><span class="cx"> #include &quot;BackForwardController.h&quot;
</span><span class="cx"> #include &quot;BitmapImage.h&quot;
</span><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="lines">@@ -1369,6 +1370,21 @@
</span><span class="cx">     frameView-&gt;scrollElementToRect(*element, IntRect(x, y, w, h));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String Internals::autofillFieldName(Element* element, ExceptionCode&amp; ec)
+{
+    if (!element) {
+        ec = INVALID_ACCESS_ERR;
+        return { };
+    }
+
+    if (!is&lt;HTMLFormControlElement&gt;(*element)) {
+        ec = INVALID_NODE_TYPE_ERR;
+        return { };
+    }
+
+    return downcast&lt;HTMLFormControlElement&gt;(*element).autofillData().fieldName;
+}
+
</ins><span class="cx"> void Internals::paintControlTints(ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     Document* document = contextDocument();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/testing/Internals.h        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -183,6 +183,8 @@
</span><span class="cx">     void setShowAutoFillButton(Element*, const String&amp; autoFillButtonType, ExceptionCode&amp;);
</span><span class="cx">     void scrollElementToRect(Element*, long x, long y, long w, long h, ExceptionCode&amp;);
</span><span class="cx"> 
</span><ins>+    String autofillFieldName(Element*, ExceptionCode&amp;);
+
</ins><span class="cx">     void paintControlTints(ExceptionCode&amp;);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Range&gt; rangeFromLocationAndLength(Element* scope, int rangeLocation, int rangeLength, ExceptionCode&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -162,6 +162,8 @@
</span><span class="cx">     [RaisesException] void setShowAutoFillButton(Element inputElement, AutoFillButtonType autoFillButtonType);
</span><span class="cx">     [RaisesException] unsigned long countMatchesForText(DOMString text, unsigned long findOptions, DOMString markMatches);
</span><span class="cx"> 
</span><ins>+    [RaisesException] DOMString autofillFieldName(Element formControlElement);
+
</ins><span class="cx">     [RaisesException] void paintControlTints();
</span><span class="cx"> 
</span><span class="cx">     [RaisesException] void scrollElementToRect(Element element, long x, long y, long w, long h);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-03-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add support for processing the autofill field name out of form control elements ultimately to aid input methods
+        &lt;rdar://problem/23041180&gt;
+        https://bugs.webkit.org/show_bug.cgi?id=155079
+
+        Reviewed by Enrica Casucci.
+
+        * Shared/AssistedNodeInformation.cpp:
+        (WebKit::AssistedNodeInformation::encode):
+        (WebKit::AssistedNodeInformation::decode):
+        * Shared/AssistedNodeInformation.h:
+        Add AutofillFieldName. Convert some coders to use encodeEnum/decodeEnum instead of casting.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView textInputTraits]):
+        Map AutofillFieldNames to the associated UITextContentTypes.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getAssistedNodeInformation):
+        Extract the AutofillFieldNames onto the AssistedNodeInformation for &lt;input&gt; elements 
+        and &lt;textarea&gt; elements.
+
</ins><span class="cx"> 2016-03-05  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement the Automation protocol commands by tracking WebPageProxy objects
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAssistedNodeInformationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/AssistedNodeInformation.cpp (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/AssistedNodeInformation.cpp        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebKit2/Shared/AssistedNodeInformation.cpp        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -71,8 +71,8 @@
</span><span class="cx">     encoder &lt;&lt; hasNextNode;
</span><span class="cx">     encoder &lt;&lt; hasPreviousNode;
</span><span class="cx">     encoder &lt;&lt; isAutocorrect;
</span><del>-    encoder &lt;&lt; (uint32_t)autocapitalizeType;
-    encoder &lt;&lt; (uint32_t)elementType;
</del><ins>+    encoder.encodeEnum(autocapitalizeType);
+    encoder.encodeEnum(elementType);
</ins><span class="cx">     encoder &lt;&lt; formAction;
</span><span class="cx">     encoder &lt;&lt; selectOptions;
</span><span class="cx">     encoder &lt;&lt; selectedIndex;
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">     encoder &lt;&lt; value;
</span><span class="cx">     encoder &lt;&lt; valueAsNumber;
</span><span class="cx">     encoder &lt;&lt; title;
</span><ins>+    encoder.encodeEnum(autofillFieldName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AssistedNodeInformation::decode(IPC::ArgumentDecoder&amp; decoder, AssistedNodeInformation&amp; result)
</span><span class="lines">@@ -111,10 +112,10 @@
</span><span class="cx">     if (!decoder.decode(result.isAutocorrect))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!decoder.decode((uint32_t&amp;)result.autocapitalizeType))
</del><ins>+    if (!decoder.decodeEnum(result.autocapitalizeType))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!decoder.decode((uint32_t&amp;)result.elementType))
</del><ins>+    if (!decoder.decodeEnum(result.elementType))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decode(result.formAction))
</span><span class="lines">@@ -147,6 +148,9 @@
</span><span class="cx">     if (!decoder.decode(result.title))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decodeEnum(result.autofillFieldName))
+        return false;
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAssistedNodeInformationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/AssistedNodeInformation.h (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/AssistedNodeInformation.h        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebKit2/Shared/AssistedNodeInformation.h        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -27,6 +27,7 @@
</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/Autofill.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><span class="cx"> #include &lt;WebCore/WebAutocapitalize.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -130,6 +131,7 @@
</span><span class="cx">     String value;
</span><span class="cx">     double valueAsNumber;
</span><span class="cx">     String title;
</span><ins>+    WebCore::AutofillFieldName autofillFieldName { WebCore::AutofillFieldName::None };
</ins><span class="cx"> 
</span><span class="cx">     void encode(IPC::ArgumentEncoder&amp;) const;
</span><span class="cx">     static bool decode(IPC::ArgumentDecoder&amp;, AssistedNodeInformation&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -2822,6 +2822,106 @@
</span><span class="cx">          [_traits setKeyboardType:UIKeyboardTypeDefault];
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
+    switch (_assistedNodeInformation.autofillFieldName) {
+    case WebCore::AutofillFieldName::Name:
+        [_traits setTextContentType:UITextContentTypeName];
+        break;
+    case WebCore::AutofillFieldName::HonorificPrefix:
+        [_traits setTextContentType:UITextContentTypeNamePrefix];
+        break;
+    case WebCore::AutofillFieldName::GivenName:
+        [_traits setTextContentType:UITextContentTypeMiddleName];
+        break;
+    case WebCore::AutofillFieldName::AdditionalName:
+        [_traits setTextContentType:UITextContentTypeMiddleName];
+        break;
+    case WebCore::AutofillFieldName::FamilyName:
+        [_traits setTextContentType:UITextContentTypeFamilyName];
+        break;
+    case WebCore::AutofillFieldName::HonorificSuffix:
+        [_traits setTextContentType:UITextContentTypeNameSuffix];
+        break;
+    case WebCore::AutofillFieldName::Nickname:
+        [_traits setTextContentType:UITextContentTypeNickname];
+        break;
+    case WebCore::AutofillFieldName::OrganizationTitle:
+        [_traits setTextContentType:UITextContentTypeJobTitle];
+        break;
+    case WebCore::AutofillFieldName::Organization:
+        [_traits setTextContentType:UITextContentTypeOrganizationName];
+        break;
+    case WebCore::AutofillFieldName::StreetAddress:
+        [_traits setTextContentType:UITextContentTypeFullStreetAddress];
+        break;
+    case WebCore::AutofillFieldName::AddressLine1:
+        [_traits setTextContentType:UITextContentTypeStreetAddressLine1];
+        break;
+    case WebCore::AutofillFieldName::AddressLine2:
+        [_traits setTextContentType:UITextContentTypeStreetAddressLine2];
+        break;
+    case WebCore::AutofillFieldName::AddressLevel3:
+        [_traits setTextContentType:UITextContentTypeSublocality];
+        break;
+    case WebCore::AutofillFieldName::AddressLevel2:
+        [_traits setTextContentType:UITextContentTypeAddressCity];
+        break;
+    case WebCore::AutofillFieldName::AddressLevel1:
+        [_traits setTextContentType:UITextContentTypeAddressState];
+        break;
+    case WebCore::AutofillFieldName::CountryName:
+        [_traits setTextContentType:UITextContentTypeCountryName];
+        break;
+    case WebCore::AutofillFieldName::PostalCode:
+        [_traits setTextContentType:UITextContentTypePostalCode];
+        break;
+    case WebCore::AutofillFieldName::Tel:
+        [_traits setTextContentType:UITextContentTypeTelephoneNumber];
+        break;
+    case WebCore::AutofillFieldName::Email:
+        [_traits setTextContentType:UITextContentTypeEmailAddress];
+        break;
+    case WebCore::AutofillFieldName::URL:
+        [_traits setTextContentType:UITextContentTypeURL];
+        break;
+    case WebCore::AutofillFieldName::None:
+    case WebCore::AutofillFieldName::Username:
+    case WebCore::AutofillFieldName::NewPassword:
+    case WebCore::AutofillFieldName::CurrentPassword:
+    case WebCore::AutofillFieldName::AddressLine3:
+    case WebCore::AutofillFieldName::AddressLevel4:
+    case WebCore::AutofillFieldName::Country:
+    case WebCore::AutofillFieldName::CcName:
+    case WebCore::AutofillFieldName::CcGivenName:
+    case WebCore::AutofillFieldName::CcAdditionalName:
+    case WebCore::AutofillFieldName::CcFamilyName:
+    case WebCore::AutofillFieldName::CcNumber:
+    case WebCore::AutofillFieldName::CcExp:
+    case WebCore::AutofillFieldName::CcExpMonth:
+    case WebCore::AutofillFieldName::CcExpYear:
+    case WebCore::AutofillFieldName::CcCsc:
+    case WebCore::AutofillFieldName::CcType:
+    case WebCore::AutofillFieldName::TransactionCurrency:
+    case WebCore::AutofillFieldName::TransactionAmount:
+    case WebCore::AutofillFieldName::Language:
+    case WebCore::AutofillFieldName::Bday:
+    case WebCore::AutofillFieldName::BdayDay:
+    case WebCore::AutofillFieldName::BdayMonth:
+    case WebCore::AutofillFieldName::BdayYear:
+    case WebCore::AutofillFieldName::Sex:
+    case WebCore::AutofillFieldName::Photo:
+    case WebCore::AutofillFieldName::TelCountryCode:
+    case WebCore::AutofillFieldName::TelNational:
+    case WebCore::AutofillFieldName::TelAreaCode:
+    case WebCore::AutofillFieldName::TelLocal:
+    case WebCore::AutofillFieldName::TelLocalPrefix:
+    case WebCore::AutofillFieldName::TelLocalSuffix:
+    case WebCore::AutofillFieldName::TelExtension:
+    case WebCore::AutofillFieldName::Impp:
+        break;
+    };
+#endif
+
</ins><span class="cx">     return _traits.get();
</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 (197625 => 197626)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-03-06 01:52:38 UTC (rev 197625)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-03-06 02:17:29 UTC (rev 197626)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #import &quot;WebPageProxyMessages.h&quot;
</span><span class="cx"> #import &quot;WebProcess.h&quot;
</span><span class="cx"> #import &lt;CoreText/CTFont.h&gt;
</span><ins>+#import &lt;WebCore/Autofill.h&gt;
</ins><span class="cx"> #import &lt;WebCore/Chrome.h&gt;
</span><span class="cx"> #import &lt;WebCore/DataDetection.h&gt;
</span><span class="cx"> #import &lt;WebCore/DiagnosticLoggingClient.h&gt;
</span><span class="lines">@@ -2425,6 +2426,7 @@
</span><span class="cx">         information.elementType = InputType::TextArea;
</span><span class="cx">         information.isReadOnly = element.isReadOnly();
</span><span class="cx">         information.value = element.value();
</span><ins>+        information.autofillFieldName = WebCore::toAutofillFieldName(element.autofillData().fieldName);
</ins><span class="cx">     } else if (is&lt;HTMLInputElement&gt;(*m_assistedNode)) {
</span><span class="cx">         HTMLInputElement&amp; element = downcast&lt;HTMLInputElement&gt;(*m_assistedNode);
</span><span class="cx">         HTMLFormElement* form = element.form();
</span><span class="lines">@@ -2472,6 +2474,7 @@
</span><span class="cx">         information.value = element.value();
</span><span class="cx">         information.valueAsNumber = element.valueAsNumber();
</span><span class="cx">         information.title = element.title();
</span><ins>+        information.autofillFieldName = WebCore::toAutofillFieldName(element.autofillData().fieldName);
</ins><span class="cx">     } else if (m_assistedNode-&gt;hasEditableStyle()) {
</span><span class="cx">         information.elementType = InputType::ContentEditable;
</span><span class="cx">         information.isAutocorrect = true;   // FIXME: Should we look at the attribute?
</span></span></pre>
</div>
</div>

</body>
</html>