<!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>[191188] 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/191188">191188</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-16 11:24:08 -0700 (Fri, 16 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>The value sanitization algorithm for input[type=url] should strip whitespaces
https://bugs.webkit.org/show_bug.cgi?id=148864
rdar://problem/22589358

Patch by Keith Rollin &lt;krollin@apple.com&gt; on 2015-10-16
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaseline two W3C HTML tests given changes in input[type=url].value
sanitization.

* web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/url-expected.txt:

Source/WebCore:

Follow the sanitization algorithm specified in:
https://html.spec.whatwg.org/multipage/forms.html#url-state-(type=url)

Chrome also has the same issue with url.html. Firefox passes.  All
three browsers have multiple issues with type-change-state.html, with
each browser having a different set of failures. Addressing this in
WebKit is another issue outside the scope of bz=148864. For now, I'm
updating that test to capture current WebKit behavior.

No new tests (covered by existing tests):
- web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html
- web-platform-tests/html/semantics/forms/the-input-element/url.html

* html/TextFieldInputType.h:
* html/URLInputType.cpp:
(WebCore::URLInputType::sanitizeValue):
* html/URLInputType.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformstheinputelementtypechangestateexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformstheinputelementurlexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/url-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlTextFieldInputTypeh">trunk/Source/WebCore/html/TextFieldInputType.h</a></li>
<li><a href="#trunkSourceWebCorehtmlURLInputTypecpp">trunk/Source/WebCore/html/URLInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlURLInputTypeh">trunk/Source/WebCore/html/URLInputType.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (191187 => 191188)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2015-10-16 18:20:39 UTC (rev 191187)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2015-10-16 18:24:08 UTC (rev 191188)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-16  Keith Rollin  &lt;krollin@apple.com&gt;
+
+        The value sanitization algorithm for input[type=url] should strip whitespaces
+        https://bugs.webkit.org/show_bug.cgi?id=148864
+        rdar://problem/22589358
+
+        Reviewed by Chris Dumez.
+
+        Rebaseline two W3C HTML tests given changes in input[type=url].value
+        sanitization.
+
+        * web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
+        * web-platform-tests/html/semantics/forms/the-input-element/url-expected.txt:
+
</ins><span class="cx"> 2015-10-15  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         Update ImportExpectations according currently imported wpt tests
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformstheinputelementtypechangestateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt (191187 => 191188)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt        2015-10-16 18:20:39 UTC (rev 191187)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt        2015-10-16 18:24:08 UTC (rev 191188)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> PASS change state from hidden to text 
</span><span class="cx"> PASS change state from hidden to search 
</span><span class="cx"> PASS change state from hidden to tel 
</span><del>-FAIL change state from hidden to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from hidden to url 
</ins><span class="cx"> PASS change state from hidden to email 
</span><span class="cx"> PASS change state from hidden to password 
</span><span class="cx"> FAIL change state from hidden to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> FAIL change state from text to hidden assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
</span><span class="cx"> PASS change state from text to search 
</span><span class="cx"> PASS change state from text to tel 
</span><del>-FAIL change state from text to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from text to url 
</ins><span class="cx"> PASS change state from text to email 
</span><span class="cx"> PASS change state from text to password 
</span><span class="cx"> FAIL change state from text to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> FAIL change state from search to hidden assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
</span><span class="cx"> PASS change state from search to text 
</span><span class="cx"> PASS change state from search to tel 
</span><del>-FAIL change state from search to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from search to url 
</ins><span class="cx"> PASS change state from search to email 
</span><span class="cx"> PASS change state from search to password 
</span><span class="cx"> FAIL change state from search to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> FAIL change state from tel to hidden assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
</span><span class="cx"> PASS change state from tel to text 
</span><span class="cx"> PASS change state from tel to search 
</span><del>-FAIL change state from tel to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from tel to url 
</ins><span class="cx"> PASS change state from tel to email 
</span><span class="cx"> PASS change state from tel to password 
</span><span class="cx"> FAIL change state from tel to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -83,27 +83,27 @@
</span><span class="cx"> FAIL change state from tel to image assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
</span><span class="cx"> FAIL change state from tel to reset assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
</span><span class="cx"> FAIL change state from tel to button assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
</span><del>-FAIL change state from url to hidden assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
-PASS change state from url to text 
-PASS change state from url to search 
-PASS change state from url to tel 
</del><ins>+FAIL change state from url to hidden assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to text assert_equals: input.value should be   foobar   after change of state expected &quot;  foobar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to search assert_equals: input.value should be   foobar   after change of state expected &quot;  foobar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to tel assert_equals: input.value should be   foobar   after change of state expected &quot;  foobar  &quot; but got &quot;foobar&quot;
</ins><span class="cx"> PASS change state from url to email 
</span><del>-PASS change state from url to password 
-FAIL change state from url to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
-FAIL change state from url to date assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
-FAIL change state from url to month assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
-FAIL change state from url to week assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
-FAIL change state from url to time assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</del><ins>+FAIL change state from url to password assert_equals: input.value should be   foobar   after change of state expected &quot;  foobar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;foobar&quot;
+FAIL change state from url to date assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;foobar&quot;
+FAIL change state from url to month assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;foobar&quot;
+FAIL change state from url to week assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;foobar&quot;
+FAIL change state from url to time assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;foobar&quot;
</ins><span class="cx"> PASS change state from url to number 
</span><span class="cx"> PASS change state from url to range 
</span><span class="cx"> PASS change state from url to color 
</span><del>-FAIL change state from url to checkbox assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
-FAIL change state from url to radio assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
-FAIL change state from url to file assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
-FAIL change state from url to submit assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
-FAIL change state from url to image assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
-FAIL change state from url to reset assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
-FAIL change state from url to button assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;  foobar  &quot;
</del><ins>+FAIL change state from url to checkbox assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to radio assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to file assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to submit assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to image assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to reset assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
+FAIL change state from url to button assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
</ins><span class="cx"> FAIL change state from email to hidden assert_equals: input.value should be '  foo\rbar  ' after change of state expected &quot;  foo\rbar  &quot; but got &quot;foobar&quot;
</span><span class="cx"> FAIL change state from email to text assert_equals: input.value should be   foobar   after change of state expected &quot;  foobar  &quot; but got &quot;foobar&quot;
</span><span class="cx"> FAIL change state from email to search assert_equals: input.value should be   foobar   after change of state expected &quot;  foobar  &quot; but got &quot;foobar&quot;
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> PASS change state from password to text 
</span><span class="cx"> PASS change state from password to search 
</span><span class="cx"> PASS change state from password to tel 
</span><del>-FAIL change state from password to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from password to url 
</ins><span class="cx"> PASS change state from password to email 
</span><span class="cx"> FAIL change state from password to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="cx"> FAIL change state from password to date assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> PASS change state from datetime to text 
</span><span class="cx"> PASS change state from datetime to search 
</span><span class="cx"> PASS change state from datetime to tel 
</span><del>-FAIL change state from datetime to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from datetime to url 
</ins><span class="cx"> PASS change state from datetime to email 
</span><span class="cx"> PASS change state from datetime to password 
</span><span class="cx"> FAIL change state from datetime to date assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx"> PASS change state from date to text 
</span><span class="cx"> PASS change state from date to search 
</span><span class="cx"> PASS change state from date to tel 
</span><del>-FAIL change state from date to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from date to url 
</ins><span class="cx"> PASS change state from date to email 
</span><span class="cx"> PASS change state from date to password 
</span><span class="cx"> FAIL change state from date to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx"> PASS change state from month to text 
</span><span class="cx"> PASS change state from month to search 
</span><span class="cx"> PASS change state from month to tel 
</span><del>-FAIL change state from month to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from month to url 
</ins><span class="cx"> PASS change state from month to email 
</span><span class="cx"> PASS change state from month to password 
</span><span class="cx"> FAIL change state from month to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -213,7 +213,7 @@
</span><span class="cx"> PASS change state from week to text 
</span><span class="cx"> PASS change state from week to search 
</span><span class="cx"> PASS change state from week to tel 
</span><del>-FAIL change state from week to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from week to url 
</ins><span class="cx"> PASS change state from week to email 
</span><span class="cx"> PASS change state from week to password 
</span><span class="cx"> FAIL change state from week to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx"> PASS change state from time to text 
</span><span class="cx"> PASS change state from time to search 
</span><span class="cx"> PASS change state from time to tel 
</span><del>-FAIL change state from time to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from time to url 
</ins><span class="cx"> PASS change state from time to email 
</span><span class="cx"> PASS change state from time to password 
</span><span class="cx"> FAIL change state from time to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx"> PASS change state from checkbox to text 
</span><span class="cx"> PASS change state from checkbox to search 
</span><span class="cx"> PASS change state from checkbox to tel 
</span><del>-FAIL change state from checkbox to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from checkbox to url 
</ins><span class="cx"> PASS change state from checkbox to email 
</span><span class="cx"> PASS change state from checkbox to password 
</span><span class="cx"> FAIL change state from checkbox to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx"> PASS change state from radio to text 
</span><span class="cx"> PASS change state from radio to search 
</span><span class="cx"> PASS change state from radio to tel 
</span><del>-FAIL change state from radio to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from radio to url 
</ins><span class="cx"> PASS change state from radio to email 
</span><span class="cx"> PASS change state from radio to password 
</span><span class="cx"> FAIL change state from radio to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -381,7 +381,7 @@
</span><span class="cx"> PASS change state from submit to text 
</span><span class="cx"> PASS change state from submit to search 
</span><span class="cx"> PASS change state from submit to tel 
</span><del>-FAIL change state from submit to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from submit to url 
</ins><span class="cx"> PASS change state from submit to email 
</span><span class="cx"> PASS change state from submit to password 
</span><span class="cx"> FAIL change state from submit to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -402,7 +402,7 @@
</span><span class="cx"> PASS change state from image to text 
</span><span class="cx"> PASS change state from image to search 
</span><span class="cx"> PASS change state from image to tel 
</span><del>-FAIL change state from image to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from image to url 
</ins><span class="cx"> PASS change state from image to email 
</span><span class="cx"> PASS change state from image to password 
</span><span class="cx"> FAIL change state from image to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -423,7 +423,7 @@
</span><span class="cx"> PASS change state from reset to text 
</span><span class="cx"> PASS change state from reset to search 
</span><span class="cx"> PASS change state from reset to tel 
</span><del>-FAIL change state from reset to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from reset to url 
</ins><span class="cx"> PASS change state from reset to email 
</span><span class="cx"> PASS change state from reset to password 
</span><span class="cx"> FAIL change state from reset to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx"> PASS change state from button to text 
</span><span class="cx"> PASS change state from button to search 
</span><span class="cx"> PASS change state from button to tel 
</span><del>-FAIL change state from button to url assert_equals: input.value should be foobar after change of state expected &quot;foobar&quot; but got &quot;  foobar  &quot;
</del><ins>+PASS change state from button to url 
</ins><span class="cx"> PASS change state from button to email 
</span><span class="cx"> PASS change state from button to password 
</span><span class="cx"> FAIL change state from button to datetime assert_equals: input.value should be  after change of state expected &quot;&quot; but got &quot;  foobar  &quot;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsformstheinputelementurlexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/url-expected.txt (191187 => 191188)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/url-expected.txt        2015-10-16 18:20:39 UTC (rev 191187)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/url-expected.txt        2015-10-16 18:24:08 UTC (rev 191188)
</span><span class="lines">@@ -4,5 +4,5 @@
</span><span class="cx"> PASS url type supported on input element 
</span><span class="cx"> PASS The value must not be set with &quot;LF&quot; (U+000A) or &quot;CR&quot; (U+000D) 
</span><span class="cx"> PASS The value sanitization algorithm is as follows: Strip line breaks from the value 
</span><del>-FAIL The value sanitization algorithm is as follows: Strip leading and trailing whitespace from the value. assert_equals: expected &quot;aa&quot; but got &quot; aa &quot;
</del><ins>+PASS The value sanitization algorithm is as follows: Strip leading and trailing whitespace from the value. 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191187 => 191188)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-16 18:20:39 UTC (rev 191187)
+++ trunk/Source/WebCore/ChangeLog        2015-10-16 18:24:08 UTC (rev 191188)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-10-16  Keith Rollin  &lt;krollin@apple.com&gt;
+
+        The value sanitization algorithm for input[type=url] should strip whitespaces
+        https://bugs.webkit.org/show_bug.cgi?id=148864
+        rdar://problem/22589358
+
+        Reviewed by Chris Dumez.
+
+        Follow the sanitization algorithm specified in:
+        https://html.spec.whatwg.org/multipage/forms.html#url-state-(type=url)
+
+        Chrome also has the same issue with url.html. Firefox passes.  All
+        three browsers have multiple issues with type-change-state.html, with
+        each browser having a different set of failures. Addressing this in
+        WebKit is another issue outside the scope of bz=148864. For now, I'm
+        updating that test to capture current WebKit behavior.
+
+        No new tests (covered by existing tests):
+        - web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html
+        - web-platform-tests/html/semantics/forms/the-input-element/url.html
+
+        * html/TextFieldInputType.h:
+        * html/URLInputType.cpp:
+        (WebCore::URLInputType::sanitizeValue):
+        * html/URLInputType.h:
+
</ins><span class="cx"> 2015-10-16  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove NodeRenderingTraversal
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTextFieldInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TextFieldInputType.h (191187 => 191188)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TextFieldInputType.h        2015-10-16 18:20:39 UTC (rev 191187)
+++ trunk/Source/WebCore/html/TextFieldInputType.h        2015-10-16 18:24:08 UTC (rev 191188)
</span><span class="lines">@@ -68,9 +68,7 @@
</span><span class="cx">     virtual void handleBlurEvent() override final;
</span><span class="cx">     virtual void setValue(const String&amp;, bool valueChanged, TextFieldEventBehavior) override;
</span><span class="cx">     virtual void updateInnerTextValue() override final;
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     virtual String sanitizeValue(const String&amp;) const override;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     virtual String convertFromVisibleValue(const String&amp;) const;
</span><span class="cx">     virtual void didSetValueByUserEdit();
</span><span class="lines">@@ -86,9 +84,6 @@
</span><span class="cx">     virtual bool shouldSubmitImplicitly(Event*) override final;
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createInputRenderer(Ref&lt;RenderStyle&gt;&amp;&amp;) override;
</span><span class="cx">     virtual bool shouldUseInputMethod() const override;
</span><del>-#if !PLATFORM(IOS)
-    virtual String sanitizeValue(const String&amp;) const override;
-#endif
</del><span class="cx">     virtual bool shouldRespectListAttribute() override;
</span><span class="cx">     virtual HTMLElement* placeholderElement() const override final;
</span><span class="cx">     virtual void updatePlaceholderText() override final;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlURLInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/URLInputType.cpp (191187 => 191188)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/URLInputType.cpp        2015-10-16 18:20:39 UTC (rev 191187)
+++ trunk/Source/WebCore/html/URLInputType.cpp        2015-10-16 18:24:08 UTC (rev 191188)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;URLInputType.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><ins>+#include &quot;HTMLParserIdioms.h&quot;
</ins><span class="cx"> #include &quot;InputTypeNames.h&quot;
</span><span class="cx"> #include &quot;LocalizedStrings.h&quot;
</span><span class="cx"> #include &quot;URL.h&quot;
</span><span class="lines">@@ -63,4 +64,9 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String URLInputType::sanitizeValue(const String&amp; proposedValue) const
+{
+    return stripLeadingAndTrailingHTMLSpaces(BaseTextInputType::sanitizeValue(proposedValue));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlURLInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/URLInputType.h (191187 => 191188)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/URLInputType.h        2015-10-16 18:20:39 UTC (rev 191187)
+++ trunk/Source/WebCore/html/URLInputType.h        2015-10-16 18:24:08 UTC (rev 191188)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     virtual bool typeMismatch() const override;
</span><span class="cx">     virtual String typeMismatchText() const override;
</span><span class="cx">     virtual bool isURLField() const override;
</span><ins>+    virtual String sanitizeValue(const String&amp;) const override;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>