<!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>[163299] 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/163299">163299</a></dd>
<dt>Author</dt> <dd>mjs@apple.com</dd>
<dt>Date</dt> <dd>2014-02-03 03:13:17 -0800 (Mon, 03 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
https://bugs.webkit.org/show_bug.cgi?id=128067

Reviewed by Antti Koivisto.

Source/WebCore: 

Tests: fast/dom/HTMLAnchorElement/anchor-password.html
       fast/dom/HTMLAnchorElement/anchor-username.html
       fast/dom/HTMLAreaElement/area-password.html
       fast/dom/HTMLAreaElement/area-username.html

* html/HTMLAnchorElement.cpp:
* html/HTMLAnchorElement.h:
(WebCore::HTMLAnchorElement::setHref): Add version that takes
(and ignores) ExceptionCode. This is needed because the URLUtil
base interface is used for URL, which can throw an exception,
and HTMLAnchorElement, which cannot.
* html/HTMLAnchorElement.idl: implement URLUtils
* html/HTMLAreaElement.idl: implement URLUtils
* html/URLUtils.idl: Treat null as empty string for href

LayoutTests: 

New tests for the newly added attributes.
* fast/dom/HTMLAnchorElement/anchor-password-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-password.html: Added.
* fast/dom/HTMLAnchorElement/anchor-username-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-username.html: Added.
* fast/dom/HTMLAreaElement/area-password.html: Added.
* fast/dom/HTMLAreaElement/area-username.html: Added.

Update a test to handle the new anchor properties.
* js/dom/dom-static-property-for-in-iteration-expected.txt:
* js/dom/dom-static-property-for-in-iteration.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt">trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdomstaticpropertyforiniterationhtml">trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementcpp">trunk/Source/WebCore/html/HTMLAnchorElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementh">trunk/Source/WebCore/html/HTMLAnchorElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAnchorElementidl">trunk/Source/WebCore/html/HTMLAnchorElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAreaElementidl">trunk/Source/WebCore/html/HTMLAreaElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlURLUtilsidl">trunk/Source/WebCore/html/URLUtils.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomHTMLAnchorElementanchorpasswordexpectedtxt">trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLAnchorElementanchorpasswordhtml">trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password.html</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLAnchorElementanchorusernameexpectedtxt">trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLAnchorElementanchorusernamehtml">trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username.html</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLAreaElementareapasswordhtml">trunk/LayoutTests/fast/dom/HTMLAreaElement/area-password.html</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLAreaElementareausernamehtml">trunk/LayoutTests/fast/dom/HTMLAreaElement/area-username.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/LayoutTests/ChangeLog        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-02-02  Maciej Stachowiak  &lt;mjs@apple.com&gt;
+
+        Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
+        https://bugs.webkit.org/show_bug.cgi?id=128067
+
+        Reviewed by Antti Koivisto.
+
+        New tests for the newly added attributes.
+        * fast/dom/HTMLAnchorElement/anchor-password-expected.txt: Added.
+        * fast/dom/HTMLAnchorElement/anchor-password.html: Added.
+        * fast/dom/HTMLAnchorElement/anchor-username-expected.txt: Added.
+        * fast/dom/HTMLAnchorElement/anchor-username.html: Added.
+        * fast/dom/HTMLAreaElement/area-password.html: Added.
+        * fast/dom/HTMLAreaElement/area-username.html: Added.
+
+        Update a test to handle the new anchor properties.
+        * js/dom/dom-static-property-for-in-iteration-expected.txt:
+        * js/dom/dom-static-property-for-in-iteration.html:
+
</ins><span class="cx"> 2014-02-03  Krzysztof Czech  &lt;k.czech@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ATK] Expose aria-controls through ATK_RELATION_CONTROLLER_FOR
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLAnchorElementanchorpasswordexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password-expected.txt (0 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password-expected.txt        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Test getting the password attribute of an 'a' element.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Default password is empty
+PASS a.password is ''
+Unspecified password should return empty string
+PASS a.password is ''
+Empty password should be empty
+PASS a.password is ''
+Regular passowrd retrieval
+PASS a.password is 'abc123'
+Password with empty username
+PASS a.password is 'def456'
+Setting password
+PASS a.href is 'http://:xyzzy@example.com/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLAnchorElementanchorpasswordhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password.html (0 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-password.html        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test getting the password attribute of an 'a' element.&quot;);
+
+var a = document.createElement(&quot;a&quot;);
+
+debug(&quot;Default password is empty&quot;);
+shouldBe(&quot;a.password&quot;, &quot;''&quot;);
+
+debug(&quot;Unspecified password should return empty string&quot;);
+a.href = &quot;http://example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;''&quot;);
+
+debug(&quot;Empty password should be empty&quot;);
+a.href = &quot;http://a:@example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;''&quot;);
+
+debug(&quot;Regular passowrd retrieval&quot;);
+a.href = &quot;http://joebob1:abc123@example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;'abc123'&quot;);
+
+debug(&quot;Password with empty username&quot;);
+a.href = &quot;http://:def456@example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;'def456'&quot;);
+
+debug(&quot;Setting password&quot;);
+a.href = &quot;http://@example.com/&quot;;
+a.password = &quot;xyzzy&quot;;
+shouldBe(&quot;a.href&quot;, &quot;'http://:xyzzy@example.com/'&quot;);
+
+&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="trunkLayoutTestsfastdomHTMLAnchorElementanchorusernameexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username-expected.txt (0 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username-expected.txt        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test getting the username attribute of an 'a' element.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Default username is empty
+PASS a.username is ''
+Unspecified username should return empty string
+PASS a.username is ''
+Empty username should be empty
+PASS a.username is ''
+Regular username retrieval
+PASS a.username is 'joebob1'
+Username with empty password
+PASS a.username is 'joebob2'
+Username with non-empty password
+PASS a.username is 'joebob3'
+Setting username
+PASS a.href is 'http://joebob4@example.com/'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLAnchorElementanchorusernamehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username.html (0 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAnchorElement/anchor-username.html        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test getting the username attribute of an 'a' element.&quot;);
+
+var a = document.createElement(&quot;a&quot;);
+
+debug(&quot;Default username is empty&quot;);
+shouldBe(&quot;a.username&quot;, &quot;''&quot;);
+
+debug(&quot;Unspecified username should return empty string&quot;);
+a.href = &quot;http://example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;''&quot;);
+
+debug(&quot;Empty username should be empty&quot;);
+a.href = &quot;http://@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;''&quot;);
+
+debug(&quot;Regular username retrieval&quot;);
+a.href = &quot;http://joebob1@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;'joebob1'&quot;);
+
+debug(&quot;Username with empty password&quot;);
+a.href = &quot;http://joebob2:@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;'joebob2'&quot;);
+
+debug(&quot;Username with non-empty password&quot;);
+a.href = &quot;http://joebob3:abc123@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;'joebob3'&quot;);
+
+debug(&quot;Setting username&quot;);
+a.href = &quot;http://example.com/&quot;;
+a.username = &quot;joebob4&quot;;
+shouldBe(&quot;a.href&quot;, &quot;'http://joebob4@example.com/'&quot;);
+
+&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="trunkLayoutTestsfastdomHTMLAreaElementareapasswordhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLAreaElement/area-password.html (0 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLAreaElement/area-password.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAreaElement/area-password.html        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test getting the password attribute of an 'area' element.&quot;);
+
+var a = document.createElement(&quot;area&quot;);
+
+debug(&quot;Default password is empty&quot;);
+shouldBe(&quot;a.password&quot;, &quot;''&quot;);
+
+debug(&quot;Unspecified password should return empty string&quot;);
+a.href = &quot;http://example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;''&quot;);
+
+debug(&quot;Empty password should be empty&quot;);
+a.href = &quot;http://a:@example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;''&quot;);
+
+debug(&quot;Regular passowrd retrieval&quot;);
+a.href = &quot;http://joebob1:abc123@example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;'abc123'&quot;);
+
+debug(&quot;Password with empty username&quot;);
+a.href = &quot;http://:def456@example.com/&quot;;
+shouldBe(&quot;a.password&quot;, &quot;'def456'&quot;);
+
+debug(&quot;Setting password&quot;);
+a.href = &quot;http://@example.com/&quot;;
+a.password = &quot;xyzzy&quot;;
+shouldBe(&quot;a.href&quot;, &quot;'http://:xyzzy@example.com/'&quot;);
+
+&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="trunkLayoutTestsfastdomHTMLAreaElementareausernamehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLAreaElement/area-username.html (0 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLAreaElement/area-username.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLAreaElement/area-username.html        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test getting the username attribute of an 'area' element.&quot;);
+
+var a = document.createElement(&quot;area&quot;);
+
+debug(&quot;Default username is empty&quot;);
+shouldBe(&quot;a.username&quot;, &quot;''&quot;);
+
+debug(&quot;Unspecified username should return empty string&quot;);
+a.href = &quot;http://example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;''&quot;);
+
+debug(&quot;Empty username should be empty&quot;);
+a.href = &quot;http://@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;''&quot;);
+
+debug(&quot;Regular username retrieval&quot;);
+a.href = &quot;http://joebob1@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;'joebob1'&quot;);
+
+debug(&quot;Username with empty password&quot;);
+a.href = &quot;http://joebob2:@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;'joebob2'&quot;);
+
+debug(&quot;Username with non-empty password&quot;);
+a.href = &quot;http://joebob3:abc123@example.com/&quot;;
+shouldBe(&quot;a.username&quot;, &quot;'joebob3'&quot;);
+
+debug(&quot;Setting username&quot;);
+a.href = &quot;http://example.com/&quot;;
+a.username = &quot;joebob4&quot;;
+shouldBe(&quot;a.href&quot;, &quot;'http://joebob4@example.com/'&quot;);
+
+&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="trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+nerget
</ins><span class="cx"> Checks that get_by_pname doesn't get confused about which properties go where when it comes to stacic properties.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="lines">@@ -16,17 +17,19 @@
</span><span class="cx"> PASS a[&quot;hostname&quot;] is 
</span><span class="cx"> PASS a[&quot;rel&quot;] is 
</span><span class="cx"> PASS a[&quot;hreflang&quot;] is 
</span><ins>+PASS a[&quot;password&quot;] is 
</ins><span class="cx"> PASS a[&quot;ping&quot;] is 
</span><span class="cx"> PASS a[&quot;rev&quot;] is 
</span><span class="cx"> PASS a[&quot;host&quot;] is 
</span><span class="cx"> PASS a[&quot;charset&quot;] is 
</span><ins>+PASS a[&quot;username&quot;] is 
</ins><span class="cx"> PASS a[&quot;target&quot;] is 
</span><span class="cx"> PASS a[&quot;type&quot;] is 
</span><span class="cx"> PASS a[&quot;coords&quot;] is 
</span><span class="cx"> PASS a[&quot;name&quot;] is 
</span><span class="cx"> PASS a[&quot;shape&quot;] is 
</span><ins>+PASS a[&quot;protocol&quot;] is file:
</ins><span class="cx"> PASS a[&quot;port&quot;] is 
</span><del>-PASS a[&quot;protocol&quot;] is file:
</del><span class="cx"> PASS a[&quot;outerHTML&quot;] is &lt;a id=&quot;foo&quot; href=&quot;bar&quot;&gt;nerget&lt;/a&gt;
</span><span class="cx"> PASS a[&quot;spellcheck&quot;] is true
</span><span class="cx"> PASS a[&quot;webkitdropzone&quot;] is 
</span><span class="lines">@@ -59,9 +62,9 @@
</span><span class="cx"> PASS a[&quot;clientTop&quot;] is 0
</span><span class="cx"> PASS a[&quot;lastElementChild&quot;] is null
</span><span class="cx"> PASS a[&quot;offsetParent&quot;] is [object HTMLBodyElement]
</span><del>-PASS a[&quot;nextElementSibling&quot;] is [object HTMLScriptElement]
</del><ins>+PASS a[&quot;nextElementSibling&quot;] is [object HTMLParagraphElement]
</ins><span class="cx"> PASS a[&quot;tagName&quot;] is A
</span><del>-PASS a[&quot;previousElementSibling&quot;] is [object HTMLDivElement]
</del><ins>+PASS a[&quot;previousElementSibling&quot;] is null
</ins><span class="cx"> PASS a[&quot;childElementCount&quot;] is 0
</span><span class="cx"> PASS a[&quot;scrollLeft&quot;] is 0
</span><span class="cx"> PASS a[&quot;firstElementChild&quot;] is null
</span><span class="lines">@@ -69,7 +72,7 @@
</span><span class="cx"> PASS a[&quot;clientLeft&quot;] is 0
</span><span class="cx"> PASS a[&quot;offsetHeight&quot;] is 18
</span><span class="cx"> PASS a[&quot;clientHeight&quot;] is 0
</span><del>-PASS a[&quot;offsetTop&quot;] is 1074
</del><ins>+PASS a[&quot;offsetTop&quot;] is 8
</ins><span class="cx"> PASS a[&quot;scrollTop&quot;] is 0
</span><span class="cx"> PASS a[&quot;scrollHeight&quot;] is 0
</span><span class="cx"> PASS a[&quot;previousSibling&quot;] is [object Text]
</span><span class="lines">@@ -108,4 +111,4 @@
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><del>-nerget
</del><ins>+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomdomstaticpropertyforiniterationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration.html (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration.html        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration.html        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">     &lt;a id=&quot;foo&quot; href=&quot;bar&quot;&gt;nerget&lt;/a&gt;
</span><ins>+    &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;script&gt;
</span><span class="cx">         var realShouldBe = function(expectedValue, actualString, actualValue) {
</span><span class="cx">             if (expectedValue === actualValue)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/ChangeLog        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2014-02-02  Maciej Stachowiak  &lt;mjs@apple.com&gt;
+
+        Adopt URLUtils interface and template in HTMLAnchorElement and HTMLAreaElement
+        https://bugs.webkit.org/show_bug.cgi?id=128067
+
+        Reviewed by Antti Koivisto.
+
+        Tests: fast/dom/HTMLAnchorElement/anchor-password.html
+               fast/dom/HTMLAnchorElement/anchor-username.html
+               fast/dom/HTMLAreaElement/area-password.html
+               fast/dom/HTMLAreaElement/area-username.html
+
+        * html/HTMLAnchorElement.cpp:
+        * html/HTMLAnchorElement.h:
+        (WebCore::HTMLAnchorElement::setHref): Add version that takes
+        (and ignores) ExceptionCode. This is needed because the URLUtil
+        base interface is used for URL, which can throw an exception,
+        and HTMLAnchorElement, which cannot.
+        * html/HTMLAnchorElement.idl: implement URLUtils
+        * html/HTMLAreaElement.idl: implement URLUtils
+        * html/URLUtils.idl: Treat null as empty string for href
+
</ins><span class="cx"> 2014-02-03  Krzysztof Czech  &lt;k.czech@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ATK] Expose aria-controls through ATK_RELATION_CONTROLLER_FOR
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -75,15 +75,6 @@
</span><span class="cx">     clearRootEditableElementForSelectionOnMouseDown();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// This function does not allow leading spaces before the port number.
-static unsigned parsePortFromStringPosition(const String&amp; value, unsigned portStart, unsigned&amp; portEnd)
-{
-    portEnd = portStart;
-    while (isASCIIDigit(value[portEnd]))
-        ++portEnd;
-    return value.substring(portStart, portEnd - portStart).toUInt();
-}
-
</del><span class="cx"> bool HTMLAnchorElement::supportsFocus() const
</span><span class="cx"> {
</span><span class="cx">     if (hasEditableStyle())
</span><span class="lines">@@ -330,180 +321,11 @@
</span><span class="cx">     return getAttribute(targetAttr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String HTMLAnchorElement::hash() const
-{
-    String fragmentIdentifier = href().fragmentIdentifier();
-    if (fragmentIdentifier.isEmpty())
-        return emptyString();
-    return AtomicString(String(&quot;#&quot; + fragmentIdentifier));
-}
-
-void HTMLAnchorElement::setHash(const String&amp; value)
-{
-    URL url = href();
-    if (value[0] == '#')
-        url.setFragmentIdentifier(value.substring(1));
-    else
-        url.setFragmentIdentifier(value);
-    setHref(url.string());
-}
-
-String HTMLAnchorElement::host() const
-{
-    const URL&amp; url = href();
-    if (url.hostEnd() == url.pathStart())
-        return url.host();
-    if (isDefaultPortForProtocol(url.port(), url.protocol()))
-        return url.host();
-    return url.host() + &quot;:&quot; + String::number(url.port());
-}
-
-void HTMLAnchorElement::setHost(const String&amp; value)
-{
-    if (value.isEmpty())
-        return;
-    URL url = href();
-    if (!url.canSetHostOrPort())
-        return;
-
-    size_t separator = value.find(':');
-    if (!separator)
-        return;
-
-    if (separator == notFound)
-        url.setHostAndPort(value);
-    else {
-        unsigned portEnd;
-        unsigned port = parsePortFromStringPosition(value, separator + 1, portEnd);
-        if (!port) {
-            // http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes
-            // specifically goes against RFC 3986 (p3.2) and
-            // requires setting the port to &quot;0&quot; if it is set to empty string.
-            url.setHostAndPort(value.substring(0, separator + 1) + &quot;0&quot;);
-        } else {
-            if (isDefaultPortForProtocol(port, url.protocol()))
-                url.setHostAndPort(value.substring(0, separator));
-            else
-                url.setHostAndPort(value.substring(0, portEnd));
-        }
-    }
-    setHref(url.string());
-}
-
-String HTMLAnchorElement::hostname() const
-{
-    return href().host();
-}
-
-void HTMLAnchorElement::setHostname(const String&amp; value)
-{
-    // Before setting new value:
-    // Remove all leading U+002F SOLIDUS (&quot;/&quot;) characters.
-    unsigned i = 0;
-    unsigned hostLength = value.length();
-    while (value[i] == '/')
-        i++;
-
-    if (i == hostLength)
-        return;
-
-    URL url = href();
-    if (!url.canSetHostOrPort())
-        return;
-
-    url.setHost(value.substring(i));
-    setHref(url.string());
-}
-
-String HTMLAnchorElement::pathname() const
-{
-    return href().path();
-}
-
-void HTMLAnchorElement::setPathname(const String&amp; value)
-{
-    URL url = href();
-    if (!url.canSetPathname())
-        return;
-
-    if (value[0] == '/')
-        url.setPath(value);
-    else
-        url.setPath(&quot;/&quot; + value);
-
-    setHref(url.string());
-}
-
-String HTMLAnchorElement::port() const
-{
-    if (href().hasPort())
-        return String::number(href().port());
-
-    return emptyString();
-}
-
-void HTMLAnchorElement::setPort(const String&amp; value)
-{
-    URL url = href();
-    if (!url.canSetHostOrPort())
-        return;
-
-    // http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes
-    // specifically goes against RFC 3986 (p3.2) and
-    // requires setting the port to &quot;0&quot; if it is set to empty string.
-    unsigned port = value.toUInt();
-    if (isDefaultPortForProtocol(port, url.protocol()))
-        url.removePort();
-    else
-        url.setPort(port);
-
-    setHref(url.string());
-}
-
-String HTMLAnchorElement::protocol() const
-{
-    return href().protocol() + &quot;:&quot;;
-}
-
-void HTMLAnchorElement::setProtocol(const String&amp; value)
-{
-    URL url = href();
-    url.setProtocol(value);
-    setHref(url.string());
-}
-
-String HTMLAnchorElement::search() const
-{
-    String query = href().query();
-    return query.isEmpty() ? emptyString() : &quot;?&quot; + query;
-}
-
-String HTMLAnchorElement::origin() const
-{
-    RefPtr&lt;SecurityOrigin&gt; origin = SecurityOrigin::create(href());
-    return origin-&gt;toString();
-}
-
-void HTMLAnchorElement::setSearch(const String&amp; value)
-{
-    URL url = href();
-    String newSearch = (value[0] == '?') ? value.substring(1) : value;
-    // Make sure that '#' in the query does not leak to the hash.
-    url.setQuery(newSearch.replaceWithLiteral('#', &quot;%23&quot;));
-
-    setHref(url.string());
-}
-
</del><span class="cx"> String HTMLAnchorElement::text()
</span><span class="cx"> {
</span><span class="cx">     return innerText();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String HTMLAnchorElement::toString() const
-{
-    return href().string();
-}
-
</del><span class="cx"> bool HTMLAnchorElement::isLiveLink() const
</span><span class="cx"> {
</span><span class="cx">     return isLink() &amp;&amp; treatLinkAsLiveForEventType(m_wasShiftKeyDownOnMouseDown ? MouseEventWithShiftKey : MouseEventWithoutShiftKey);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.h (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.h        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.h        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;LinkHash.h&quot;
</span><ins>+#include &quot;URLUtils.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -53,7 +54,7 @@
</span><span class="cx"> //     RelationUp          = 0x00020000,
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class HTMLAnchorElement : public HTMLElement {
</del><ins>+class HTMLAnchorElement : public HTMLElement, public URLUtils&lt;HTMLAnchorElement&gt; {
</ins><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;HTMLAnchorElement&gt; create(Document&amp;);
</span><span class="cx">     static PassRefPtr&lt;HTMLAnchorElement&gt; create(const QualifiedName&amp;, Document&amp;);
</span><span class="lines">@@ -62,36 +63,12 @@
</span><span class="cx"> 
</span><span class="cx">     URL href() const;
</span><span class="cx">     void setHref(const AtomicString&amp;);
</span><ins>+    void setHref(const AtomicString&amp; value, ExceptionCode&amp;) { setHref(value); }
</ins><span class="cx"> 
</span><span class="cx">     const AtomicString&amp; name() const;
</span><span class="cx"> 
</span><del>-    String hash() const;
-    void setHash(const String&amp;);
-
-    String host() const;
-    void setHost(const String&amp;);
-
-    String hostname() const;
-    void setHostname(const String&amp;);
-
-    String pathname() const;
-    void setPathname(const String&amp;);
-
-    String port() const;
-    void setPort(const String&amp;);
-
-    String protocol() const;
-    void setProtocol(const String&amp;);
-
-    String search() const;
-    void setSearch(const String&amp;);
-
-    String origin() const;
-
</del><span class="cx">     String text();
</span><span class="cx"> 
</span><del>-    String toString() const;
-
</del><span class="cx">     bool isLiveLink() const;
</span><span class="cx"> 
</span><span class="cx">     virtual bool willRespondToMouseClickEvents() override;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAnchorElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAnchorElement.idl (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAnchorElement.idl        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.idl        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx">     [Reflect] attribute DOMString charset;
</span><span class="cx">     [Reflect] attribute DOMString coords;
</span><span class="cx">     [Conditional=DOWNLOAD_ATTRIBUTE, Reflect] attribute DOMString download;
</span><del>-    [Reflect, URL] attribute DOMString href;
</del><span class="cx">     [Reflect] attribute DOMString hreflang;
</span><span class="cx">     [Reflect] attribute DOMString name;
</span><span class="cx">     [Reflect] attribute DOMString ping;
</span><span class="lines">@@ -36,35 +35,12 @@
</span><span class="cx">     [Reflect] attribute DOMString accessKey;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
-    readonly attribute DOMString hash;
-    readonly attribute DOMString host;
-    readonly attribute DOMString hostname;
-    readonly attribute DOMString pathname;
-    readonly attribute DOMString port;
-    readonly attribute DOMString protocol;
-    readonly attribute DOMString search;
-#else
-    [TreatNullAs=NullString] attribute DOMString hash;
-    [TreatNullAs=NullString] attribute DOMString host;
-    [TreatNullAs=NullString] attribute DOMString hostname;
-    [TreatNullAs=NullString] attribute DOMString pathname;
-    [TreatNullAs=NullString] attribute DOMString port;
-    [TreatNullAs=NullString] attribute DOMString protocol;
-    [TreatNullAs=NullString] attribute DOMString search;
-
-    [TreatNullAs=NullString] readonly attribute DOMString origin;
-#endif
-
</del><span class="cx">     readonly attribute DOMString text;
</span><span class="cx"> 
</span><del>-#if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
-    [NotEnumerable] DOMString toString();
-#endif
-
</del><span class="cx"> #if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
</span><span class="cx">     // Objective-C extension:
</span><span class="cx">     readonly attribute URL absoluteLinkURL;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+HTMLAnchorElement implements URLUtils;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAreaElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAreaElement.idl (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAreaElement.idl        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/HTMLAreaElement.idl        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -21,7 +21,6 @@
</span><span class="cx"> interface HTMLAreaElement : HTMLElement {
</span><span class="cx">     [Reflect] attribute DOMString alt;
</span><span class="cx">     [Reflect] attribute DOMString coords;
</span><del>-    [Reflect, URL] attribute DOMString href;
</del><span class="cx">     [Reflect] attribute boolean noHref;
</span><span class="cx">     [Reflect] attribute DOMString ping;
</span><span class="cx">     [Reflect] attribute DOMString shape;
</span><span class="lines">@@ -30,14 +29,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><del>-    // IE Extensions
-    readonly attribute DOMString hash;
-    readonly attribute DOMString host;
-    readonly attribute DOMString hostname;
-    readonly attribute DOMString pathname;
-    readonly attribute DOMString port;
-    readonly attribute DOMString protocol;
-    readonly attribute DOMString search;
</del><span class="cx"> 
</span><span class="cx"> #if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
</span><span class="cx">     // Objective-C extension:
</span><span class="lines">@@ -45,3 +36,4 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+HTMLAreaElement implements URLUtils;
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlURLUtilsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/URLUtils.idl (163298 => 163299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/URLUtils.idl        2014-02-03 10:05:06 UTC (rev 163298)
+++ trunk/Source/WebCore/html/URLUtils.idl        2014-02-03 11:13:17 UTC (rev 163299)
</span><span class="lines">@@ -25,13 +25,22 @@
</span><span class="cx"> 
</span><span class="cx"> [NoInterfaceObject]
</span><span class="cx"> interface URLUtils {
</span><del>-    [SetterRaisesException, URL] attribute DOMString href;
</del><ins>+    [SetterRaisesException, TreatNullAs=NullString, URL] attribute DOMString href;
</ins><span class="cx"> #if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
</span><span class="cx">     [NotEnumerable] DOMString toString();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     readonly attribute DOMString origin;
</span><span class="cx"> 
</span><ins>+#if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
+    readonly attribute DOMString protocol;
+    readonly attribute DOMString host;
+    readonly attribute DOMString hostname;
+    readonly attribute DOMString port;
+    readonly attribute DOMString pathname;
+    readonly attribute DOMString search;
+    readonly attribute DOMString hash;
+#else
</ins><span class="cx">     [TreatNullAs=NullString] attribute DOMString protocol;
</span><span class="cx">     [TreatNullAs=NullString] attribute DOMString username;
</span><span class="cx">     [TreatNullAs=NullString] attribute DOMString password;
</span><span class="lines">@@ -42,4 +51,6 @@
</span><span class="cx">     [TreatNullAs=NullString] attribute DOMString search;
</span><span class="cx">     //    attribute URLSearchParams? searchParams;
</span><span class="cx">     [TreatNullAs=NullString] attribute DOMString hash;
</span><ins>+#endif
+
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>