<!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>[193549] branches/safari-601-branch</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/191981">r191981</a>. rdar://problem/23732379</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsChangeLog">branches/safari-601-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebCoreChangeLog">branches/safari-601-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebCorehtmlHTMLFormControlElementcpp">branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCorehtmlHTMLFormControlElementh">branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.h</a></li>
<li><a href="#branchessafari601branchSourceWebCorehtmlHTMLInputElementidl">branches/safari-601-branch/Source/WebCore/html/HTMLInputElement.idl</a></li>
<li><a href="#branchessafari601branchSourceWebCorehtmlHTMLSelectElementidl">branches/safari-601-branch/Source/WebCore/html/HTMLSelectElement.idl</a></li>
<li><a href="#branchessafari601branchSourceWebCorehtmlHTMLTextAreaElementidl">branches/safari-601-branch/Source/WebCore/html/HTMLTextAreaElement.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsfastformsautocompletetokensexpectedtxt">branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsfastformsautocompletetokenshtml">branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/ChangeLog (193548 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-06 03:08:17 UTC (rev 193548)
+++ branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-12-05  David Kilzer  &lt;ddkilzer@apple.com&gt;
+
+        Merge r191981. rdar://problem/23732379
+
+    2015-10-30  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
+
+        Implement support for the autocomplete attribute
+        https://bugs.webkit.org/show_bug.cgi?id=150731
+        rdar://problem/21078968
+
+        Reviewed by Brent Fulgham.
+
+        * fast/forms/autocomplete-tokens-expected.txt: Added.
+        * fast/forms/autocomplete-tokens.html: Added.
+
</ins><span class="cx"> 2015-12-05  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r190564. rdar://problem/23769747
</span></span></pre></div>
<a id="branchessafari601branchLayoutTestsfastformsautocompletetokensexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens-expected.txt (0 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens-expected.txt                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens-expected.txt        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -0,0 +1,211 @@
</span><ins>+Tests for valid autocomplete tokens on input, select, and textarea elements.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Valid keywords:
+PASS input.autocomplete is &quot;name&quot;
+PASS input.autocomplete is &quot;honorific-prefix&quot;
+PASS input.autocomplete is &quot;given-name&quot;
+PASS input.autocomplete is &quot;additional-name&quot;
+PASS input.autocomplete is &quot;family-name&quot;
+PASS input.autocomplete is &quot;honorific-suffix&quot;
+PASS input.autocomplete is &quot;nickname&quot;
+PASS input.autocomplete is &quot;organization-title&quot;
+PASS input.autocomplete is &quot;username&quot;
+PASS input.autocomplete is &quot;new-password&quot;
+PASS input.autocomplete is &quot;current-password&quot;
+PASS input.autocomplete is &quot;organization&quot;
+PASS input.autocomplete is &quot;street-address&quot;
+PASS input.autocomplete is &quot;address-line1&quot;
+PASS input.autocomplete is &quot;address-line2&quot;
+PASS input.autocomplete is &quot;address-line3&quot;
+PASS input.autocomplete is &quot;address-level4&quot;
+PASS input.autocomplete is &quot;address-level3&quot;
+PASS input.autocomplete is &quot;address-level2&quot;
+PASS input.autocomplete is &quot;address-level1&quot;
+PASS input.autocomplete is &quot;country&quot;
+PASS input.autocomplete is &quot;country-name&quot;
+PASS input.autocomplete is &quot;postal-code&quot;
+PASS input.autocomplete is &quot;cc-name&quot;
+PASS input.autocomplete is &quot;cc-given-name&quot;
+PASS input.autocomplete is &quot;cc-additional-name&quot;
+PASS input.autocomplete is &quot;cc-family-name&quot;
+PASS input.autocomplete is &quot;cc-number&quot;
+PASS input.autocomplete is &quot;cc-exp&quot;
+PASS input.autocomplete is &quot;cc-exp-month&quot;
+PASS input.autocomplete is &quot;cc-exp-year&quot;
+PASS input.autocomplete is &quot;cc-csc&quot;
+PASS input.autocomplete is &quot;cc-type&quot;
+PASS input.autocomplete is &quot;transaction-currency&quot;
+PASS input.autocomplete is &quot;transaction-amount&quot;
+PASS input.autocomplete is &quot;language&quot;
+PASS input.autocomplete is &quot;bday&quot;
+PASS input.autocomplete is &quot;bday-day&quot;
+PASS input.autocomplete is &quot;bday-month&quot;
+PASS input.autocomplete is &quot;bday-year&quot;
+PASS input.autocomplete is &quot;sex&quot;
+PASS input.autocomplete is &quot;url&quot;
+PASS input.autocomplete is &quot;photo&quot;
+PASS input.autocomplete is &quot;tel&quot;
+PASS input.autocomplete is &quot;tel-country-code&quot;
+PASS input.autocomplete is &quot;tel-national&quot;
+PASS input.autocomplete is &quot;tel-area-code&quot;
+PASS input.autocomplete is &quot;tel-local&quot;
+PASS input.autocomplete is &quot;tel-local-prefix&quot;
+PASS input.autocomplete is &quot;tel-local-suffix&quot;
+PASS input.autocomplete is &quot;tel-extension&quot;
+PASS input.autocomplete is &quot;email&quot;
+PASS input.autocomplete is &quot;impp&quot;
+
+Contact scope:
+PASS input.autocomplete is &quot;home tel&quot;
+PASS input.autocomplete is &quot;home tel-country-code&quot;
+PASS input.autocomplete is &quot;home tel-national&quot;
+PASS input.autocomplete is &quot;home tel-area-code&quot;
+PASS input.autocomplete is &quot;home tel-local&quot;
+PASS input.autocomplete is &quot;home tel-local-prefix&quot;
+PASS input.autocomplete is &quot;home tel-local-suffix&quot;
+PASS input.autocomplete is &quot;home tel-extension&quot;
+PASS input.autocomplete is &quot;home email&quot;
+PASS input.autocomplete is &quot;home impp&quot;
+PASS input.autocomplete is &quot;work tel&quot;
+PASS input.autocomplete is &quot;work tel-country-code&quot;
+PASS input.autocomplete is &quot;work tel-national&quot;
+PASS input.autocomplete is &quot;work tel-area-code&quot;
+PASS input.autocomplete is &quot;work tel-local&quot;
+PASS input.autocomplete is &quot;work tel-local-prefix&quot;
+PASS input.autocomplete is &quot;work tel-local-suffix&quot;
+PASS input.autocomplete is &quot;work tel-extension&quot;
+PASS input.autocomplete is &quot;work email&quot;
+PASS input.autocomplete is &quot;work impp&quot;
+PASS input.autocomplete is &quot;mobile tel&quot;
+PASS input.autocomplete is &quot;mobile tel-country-code&quot;
+PASS input.autocomplete is &quot;mobile tel-national&quot;
+PASS input.autocomplete is &quot;mobile tel-area-code&quot;
+PASS input.autocomplete is &quot;mobile tel-local&quot;
+PASS input.autocomplete is &quot;mobile tel-local-prefix&quot;
+PASS input.autocomplete is &quot;mobile tel-local-suffix&quot;
+PASS input.autocomplete is &quot;mobile tel-extension&quot;
+PASS input.autocomplete is &quot;mobile email&quot;
+PASS input.autocomplete is &quot;mobile impp&quot;
+PASS input.autocomplete is &quot;fax tel&quot;
+PASS input.autocomplete is &quot;fax tel-country-code&quot;
+PASS input.autocomplete is &quot;fax tel-national&quot;
+PASS input.autocomplete is &quot;fax tel-area-code&quot;
+PASS input.autocomplete is &quot;fax tel-local&quot;
+PASS input.autocomplete is &quot;fax tel-local-prefix&quot;
+PASS input.autocomplete is &quot;fax tel-local-suffix&quot;
+PASS input.autocomplete is &quot;fax tel-extension&quot;
+PASS input.autocomplete is &quot;fax email&quot;
+PASS input.autocomplete is &quot;fax impp&quot;
+PASS input.autocomplete is &quot;pager tel&quot;
+PASS input.autocomplete is &quot;pager tel-country-code&quot;
+PASS input.autocomplete is &quot;pager tel-national&quot;
+PASS input.autocomplete is &quot;pager tel-area-code&quot;
+PASS input.autocomplete is &quot;pager tel-local&quot;
+PASS input.autocomplete is &quot;pager tel-local-prefix&quot;
+PASS input.autocomplete is &quot;pager tel-local-suffix&quot;
+PASS input.autocomplete is &quot;pager tel-extension&quot;
+PASS input.autocomplete is &quot;pager email&quot;
+PASS input.autocomplete is &quot;pager impp&quot;
+
+Mode:
+PASS input.autocomplete is &quot;shipping street-address&quot;
+PASS input.autocomplete is &quot;shipping address-line1&quot;
+PASS input.autocomplete is &quot;shipping address-line2&quot;
+PASS input.autocomplete is &quot;shipping address-line3&quot;
+PASS input.autocomplete is &quot;shipping address-level4&quot;
+PASS input.autocomplete is &quot;shipping address-level3&quot;
+PASS input.autocomplete is &quot;shipping address-level2&quot;
+PASS input.autocomplete is &quot;shipping address-level1&quot;
+PASS input.autocomplete is &quot;shipping country&quot;
+PASS input.autocomplete is &quot;shipping country-name&quot;
+PASS input.autocomplete is &quot;shipping postal-code&quot;
+PASS input.autocomplete is &quot;billing street-address&quot;
+PASS input.autocomplete is &quot;billing address-line1&quot;
+PASS input.autocomplete is &quot;billing address-line2&quot;
+PASS input.autocomplete is &quot;billing address-line3&quot;
+PASS input.autocomplete is &quot;billing address-level4&quot;
+PASS input.autocomplete is &quot;billing address-level3&quot;
+PASS input.autocomplete is &quot;billing address-level2&quot;
+PASS input.autocomplete is &quot;billing address-level1&quot;
+PASS input.autocomplete is &quot;billing country&quot;
+PASS input.autocomplete is &quot;billing country-name&quot;
+PASS input.autocomplete is &quot;billing postal-code&quot;
+
+Section:
+PASS input.autocomplete is &quot;section-parent name&quot;
+PASS input.autocomplete is &quot;section-parent honorific-prefix&quot;
+PASS input.autocomplete is &quot;section-parent given-name&quot;
+PASS input.autocomplete is &quot;section-parent additional-name&quot;
+PASS input.autocomplete is &quot;section-parent family-name&quot;
+PASS input.autocomplete is &quot;section-parent honorific-suffix&quot;
+PASS input.autocomplete is &quot;section-parent nickname&quot;
+PASS input.autocomplete is &quot;section-parent organization-title&quot;
+PASS input.autocomplete is &quot;section-parent username&quot;
+PASS input.autocomplete is &quot;section-parent new-password&quot;
+PASS input.autocomplete is &quot;section-parent current-password&quot;
+PASS input.autocomplete is &quot;section-parent organization&quot;
+PASS input.autocomplete is &quot;section-parent street-address&quot;
+PASS input.autocomplete is &quot;section-parent address-line1&quot;
+PASS input.autocomplete is &quot;section-parent address-line2&quot;
+PASS input.autocomplete is &quot;section-parent address-line3&quot;
+PASS input.autocomplete is &quot;section-parent address-level4&quot;
+PASS input.autocomplete is &quot;section-parent address-level3&quot;
+PASS input.autocomplete is &quot;section-parent address-level2&quot;
+PASS input.autocomplete is &quot;section-parent address-level1&quot;
+PASS input.autocomplete is &quot;section-parent country&quot;
+PASS input.autocomplete is &quot;section-parent country-name&quot;
+PASS input.autocomplete is &quot;section-parent postal-code&quot;
+PASS input.autocomplete is &quot;section-parent cc-name&quot;
+PASS input.autocomplete is &quot;section-parent cc-given-name&quot;
+PASS input.autocomplete is &quot;section-parent cc-additional-name&quot;
+PASS input.autocomplete is &quot;section-parent cc-family-name&quot;
+PASS input.autocomplete is &quot;section-parent cc-number&quot;
+PASS input.autocomplete is &quot;section-parent cc-exp&quot;
+PASS input.autocomplete is &quot;section-parent cc-exp-month&quot;
+PASS input.autocomplete is &quot;section-parent cc-exp-year&quot;
+PASS input.autocomplete is &quot;section-parent cc-csc&quot;
+PASS input.autocomplete is &quot;section-parent cc-type&quot;
+PASS input.autocomplete is &quot;section-parent transaction-currency&quot;
+PASS input.autocomplete is &quot;section-parent transaction-amount&quot;
+PASS input.autocomplete is &quot;section-parent language&quot;
+PASS input.autocomplete is &quot;section-parent bday&quot;
+PASS input.autocomplete is &quot;section-parent bday-day&quot;
+PASS input.autocomplete is &quot;section-parent bday-month&quot;
+PASS input.autocomplete is &quot;section-parent bday-year&quot;
+PASS input.autocomplete is &quot;section-parent sex&quot;
+PASS input.autocomplete is &quot;section-parent url&quot;
+PASS input.autocomplete is &quot;section-parent photo&quot;
+PASS input.autocomplete is &quot;section-parent tel&quot;
+PASS input.autocomplete is &quot;section-parent tel-country-code&quot;
+PASS input.autocomplete is &quot;section-parent tel-national&quot;
+PASS input.autocomplete is &quot;section-parent tel-area-code&quot;
+PASS input.autocomplete is &quot;section-parent tel-local&quot;
+PASS input.autocomplete is &quot;section-parent tel-local-prefix&quot;
+PASS input.autocomplete is &quot;section-parent tel-local-suffix&quot;
+PASS input.autocomplete is &quot;section-parent tel-extension&quot;
+PASS input.autocomplete is &quot;section-parent email&quot;
+PASS input.autocomplete is &quot;section-parent impp&quot;
+
+Invalid combinations:
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+PASS input.autocomplete is &quot;&quot;
+
+Non-autocompleteable controls:
+PASS button.autocomplete is &quot;invalid&quot;
+PASS keygen.autocomplete is &quot;invalid&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsfastformsautocompletetokenshtml"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens.html (0 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens.html                                (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/forms/autocomplete-tokens.html        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+        &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+        &lt;script&gt;
+            description('Tests for valid autocomplete tokens on input, select, and textarea elements.');
+
+            var input = document.createElement('input');
+            var textarea = document.createElement('textarea');
+            var select = document.createElement('select');
+            var button = document.createElement('button');
+            var keygen = document.createElement('keygen');
+            var autocompleteableControls = [ input, textarea, select ];
+
+            var keywords = [ &quot;name&quot;, &quot;honorific-prefix&quot;, &quot;given-name&quot;, &quot;additional-name&quot;, &quot;family-name&quot;, &quot;honorific-suffix&quot;, &quot;nickname&quot;, &quot;organization-title&quot;, &quot;username&quot;, &quot;new-password&quot;, &quot;current-password&quot;, &quot;organization&quot;, &quot;street-address&quot;, &quot;address-line1&quot;, &quot;address-line2&quot;, &quot;address-line3&quot;, &quot;address-level4&quot;, &quot;address-level3&quot;, &quot;address-level2&quot;, &quot;address-level1&quot;, &quot;country&quot;, &quot;country-name&quot;, &quot;postal-code&quot;, &quot;cc-name&quot;, &quot;cc-given-name&quot;, &quot;cc-additional-name&quot;, &quot;cc-family-name&quot;, &quot;cc-number&quot;, &quot;cc-exp&quot;, &quot;cc-exp-month&quot;, &quot;cc-exp-year&quot;, &quot;cc-csc&quot;, &quot;cc-type&quot;, &quot;transaction-currency&quot;, &quot;transaction-amount&quot;, &quot;language&quot;, &quot;bday&quot;, &quo
 t;bday-day&quot;, &quot;bday-month&quot;, &quot;bday-year&quot;, &quot;sex&quot;, &quot;url&quot;, &quot;photo&quot;, &quot;tel&quot;, &quot;tel-country-code&quot;, &quot;tel-national&quot;, &quot;tel-area-code&quot;, &quot;tel-local&quot;, &quot;tel-local-prefix&quot;, &quot;tel-local-suffix&quot;, &quot;tel-extension&quot;, &quot;email&quot;, &quot;impp&quot; ];
+
+            var modeTokens = [ &quot;billing&quot;, &quot;shipping&quot; ];
+
+            debug('Valid keywords:');
+            keywords.forEach(function(keyword) {
+                input.autocomplete = keyword;
+                shouldBeEqualToString('input.autocomplete', keyword);
+            });
+
+            debug('');
+            debug('Contact scope:');
+            var contactTokens = [ &quot;tel&quot;, &quot;tel-country-code&quot;, &quot;tel-national&quot;, &quot;tel-area-code&quot;, &quot;tel-local&quot;, &quot;tel-local-prefix&quot;, &quot;tel-local-suffix&quot;, &quot;tel-extension&quot;, &quot;email&quot;, &quot;impp&quot; ];
+            var contactScopeTokens = [ &quot;home&quot;, &quot;work&quot;, &quot;mobile&quot;, &quot;fax&quot;, &quot;pager&quot; ];
+            contactScopeTokens.forEach(function(scopeToken) {
+                contactTokens.forEach(function(contactToken) {
+                    input.autocomplete = scopeToken + &quot; &quot; + contactToken;
+                    shouldBeEqualToString('input.autocomplete', scopeToken + &quot; &quot; + contactToken);
+                })
+            });
+
+            debug('');
+            debug('Mode:');
+            var addressTokens = [ &quot;street-address&quot;, &quot;address-line1&quot;, &quot;address-line2&quot;, &quot;address-line3&quot;, &quot;address-level4&quot;, &quot;address-level3&quot;, &quot;address-level2&quot;, &quot;address-level1&quot;, &quot;country&quot;, &quot;country-name&quot;, &quot;postal-code&quot; ];
+            var modeTokens = [ &quot;shipping&quot;, &quot;billing&quot; ];
+            modeTokens.forEach(function(modeToken) {
+                addressTokens.forEach(function(addressToken) {
+                    input.autocomplete = modeToken + &quot; &quot; + addressToken;
+                    shouldBeEqualToString('input.autocomplete', modeToken + &quot; &quot; + addressToken);
+                })
+            });
+
+            debug('');
+            debug('Section:');
+            keywords.forEach(function(keyword) {
+                var value = &quot;section-parent &quot; + keyword;
+                input.autocomplete = value;
+                shouldBeEqualToString('input.autocomplete', value);
+            });
+
+            debug('');
+            debug('Invalid combinations:');
+            autocompleteableControls.forEach(function(control) {
+                 control.autocomplete = 'invalid';
+                 shouldBeEmptyString('input.autocomplete');
+            });
+            // Two normal tokens
+            input.autocomplete = &quot;name name&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            input.autocomplete = &quot;name bday&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            // Contact scope token + non-contact token.
+            input.autocomplete = &quot;pager bday&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            // Two contact scope tokens.
+            input.autocomplete = &quot;home work tel&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            // Two mode tokens.
+            input.autocomplete = &quot;shipping billing tel&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            // Two section tokens.
+            input.autocomplete = &quot;section-a section-b tel&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            // Anything + on/off.
+            input.autocomplete = &quot;tel on&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            input.autocomplete = &quot;tel off&quot;;
+            shouldBeEmptyString('input.autocomplete');
+
+            debug('');
+            debug('Non-autocompleteable controls:');
+            // Buttons and keygens are not autocompleteable, so their autocomplete attribute is not sanitized.
+            button.autocomplete = 'invalid';
+            shouldBeEqualToString('button.autocomplete', 'invalid');
+            keygen.autocomplete = 'invalid';
+            shouldBeEqualToString('keygen.autocomplete', 'invalid');
+        &lt;/script&gt;
+        &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193548 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-06 03:08:17 UTC (rev 193548)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2015-12-05  David Kilzer  &lt;ddkilzer@apple.com&gt;
+
+        Merge r191981. rdar://problem/23732379
+
+    2015-10-30  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
+
+        Implement support for the autocomplete attribute
+        https://bugs.webkit.org/show_bug.cgi?id=150731
+        rdar://problem/21078968
+
+        The autocomplete attribute is defined by
+        https://html.spec.whatwg.org/multipage/forms.html#autofill.
+
+        Reviewed by Brent Fulgham.
+
+        Test: fast/forms/autocomplete-tokens.html
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::isContactToken):
+        Return true if this is a contact token.
+        (WebCore::categoryForAutofillFieldToken):
+        Adds all of the autofill field tokens to a map, and returns the
+        category for a given token.
+        (WebCore::maxTokensForAutofillFieldCategory):
+        Return the maximum number of tokens an autofill category supports.
+        (WebCore::HTMLFormControlElement::parseAutocompleteAttribute):
+        Implement the processing model defined in
+        https://html.spec.whatwg.org/multipage/forms.html#processing-model-3
+        with respect to the IDL-exposed autofill value.
+        (WebCore::HTMLFormControlElement::setAutocomplete):
+        Set the autocomplete attribute to the given string.
+
+        * html/HTMLFormControlElement.h:
+        Declare setAutocomplete() and autocomplete().
+
+        * html/HTMLInputElement.idl:
+        Remove the Reflect attribute. We now have custom processing for getting
+        this attribute.
+
+        * html/HTMLSelectElement.idl:
+        Declare the autocomplete attribute.
+
+        * html/HTMLTextAreaElement.idl:
+        Ditto.
+
</ins><span class="cx"> 2015-12-05  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r190564. rdar://problem/23769747
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorehtmlHTMLFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.cpp (193548 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.cpp        2015-12-06 03:08:17 UTC (rev 193548)
+++ branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.cpp        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -594,4 +594,163 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline bool isContactToken(const AtomicString&amp; token)
+{
+    return token == &quot;home&quot; || token == &quot;work&quot; || token == &quot;mobile&quot; || token == &quot;fax&quot; || token == &quot;pager&quot;;
+}
+
+enum class AutofillCategory {
+    Invalid,
+    Off,
+    Automatic,
+    Normal,
+    Contact,
+};
+
+static inline AutofillCategory categoryForAutofillFieldToken(const AtomicString&amp; token)
+{
+    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);
+}
+
+static inline unsigned maxTokensForAutofillFieldCategory(AutofillCategory category)
+{
+    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;
+}
+
+// https://html.spec.whatwg.org/multipage/forms.html#processing-model-3
+String HTMLFormControlElement::autocomplete() const
+{
+    const AtomicString&amp; attributeValue = fastGetAttribute(autocompleteAttr);
+    SpaceSplitString tokens(attributeValue, true);
+    if (tokens.isEmpty())
+        return String();
+
+    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();
+
+    bool wearingAutofillAnchorMantle = is&lt;HTMLInputElement&gt;(*this) &amp;&amp; downcast&lt;HTMLInputElement&gt;(this)-&gt;isInputTypeHidden();
+    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;
+}
+
+void HTMLFormControlElement::setAutocomplete(const String&amp; value)
+{
+    setAttribute(autocompleteAttr, value);
+}
+
</ins><span class="cx"> } // namespace Webcore
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.h (193548 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.h        2015-12-06 03:08:17 UTC (rev 193548)
+++ branches/safari-601-branch/Source/WebCore/html/HTMLFormControlElement.h        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -114,6 +114,9 @@
</span><span class="cx"> 
</span><span class="cx">     static HTMLFormControlElement* enclosingFormControlElement(Node*);
</span><span class="cx"> 
</span><ins>+    String autocomplete() const;
+    void setAutocomplete(const String&amp;);
+
</ins><span class="cx">     using Node::ref;
</span><span class="cx">     using Node::deref;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorehtmlHTMLInputElementidl"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/html/HTMLInputElement.idl (193548 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/html/HTMLInputElement.idl        2015-12-06 03:08:17 UTC (rev 193548)
+++ branches/safari-601-branch/Source/WebCore/html/HTMLInputElement.idl        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> interface HTMLInputElement : HTMLElement {
</span><span class="cx">     [Reflect] attribute DOMString accept;
</span><span class="cx">     [Reflect] attribute DOMString alt;
</span><del>-    [Reflect] attribute DOMString autocomplete;
</del><ins>+    attribute DOMString autocomplete;
</ins><span class="cx">     [Reflect] attribute boolean autofocus;
</span><span class="cx">     [Reflect=checked] attribute boolean defaultChecked;
</span><span class="cx">     attribute boolean checked;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorehtmlHTMLSelectElementidl"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/html/HTMLSelectElement.idl (193548 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/html/HTMLSelectElement.idl        2015-12-06 03:08:17 UTC (rev 193548)
+++ branches/safari-601-branch/Source/WebCore/html/HTMLSelectElement.idl        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -61,4 +61,6 @@
</span><span class="cx">     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
</span><span class="cx"> 
</span><span class="cx">     readonly attribute NodeList labels;
</span><ins>+
+    attribute DOMString autocomplete;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorehtmlHTMLTextAreaElementidl"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/html/HTMLTextAreaElement.idl (193548 => 193549)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/html/HTMLTextAreaElement.idl        2015-12-06 03:08:17 UTC (rev 193548)
+++ branches/safari-601-branch/Source/WebCore/html/HTMLTextAreaElement.idl        2015-12-06 05:56:02 UTC (rev 193549)
</span><span class="lines">@@ -71,4 +71,6 @@
</span><span class="cx"> #if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
</span><span class="cx">     [Reflect] attribute DOMString accessKey;
</span><span class="cx"> #endif
</span><ins>+
+    attribute DOMString autocomplete;
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>