<!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>[195152] 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/195152">195152</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-15 15:06:32 -0800 (Fri, 15 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>createElementNS and createAttributeNS should treat undefined namespaceURI as null string
https://bugs.webkit.org/show_bug.cgi?id=153119

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaseline a test now that more test cases are passing.

* web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:

Source/WebCore:

Treat undefined as null in document.createElementNS and document.createAttributeNS as defined in:
https://dom.spec.whatwg.org/#document

Test: fast/dom/Document/createAttributeNS-undefined-namespace.html

* dom/Document.idl:

LayoutTests:

Add a regression test for calling createAttributeNS with undefined namespaceURI.

* fast/dom/Document/createAttributeNS-undefined-namespace-expected.txt: Added.
* fast/dom/Document/createAttributeNS-undefined-namespace.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesDocumentcreateElementNSexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentidl">trunk/Source/WebCore/dom/Document.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomDocumentcreateAttributeNSundefinednamespaceexpectedtxt">trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomDocumentcreateAttributeNSundefinednamespacehtml">trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195151 => 195152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-15 23:03:02 UTC (rev 195151)
+++ trunk/LayoutTests/ChangeLog        2016-01-15 23:06:32 UTC (rev 195152)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        createElementNS and createAttributeNS should treat undefined namespaceURI as null string
+        https://bugs.webkit.org/show_bug.cgi?id=153119
+
+        Reviewed by Chris Dumez.
+
+        Add a regression test for calling createAttributeNS with undefined namespaceURI.
+
+        * fast/dom/Document/createAttributeNS-undefined-namespace-expected.txt: Added.
+        * fast/dom/Document/createAttributeNS-undefined-namespace.html: Added.
+
</ins><span class="cx"> 2016-01-15  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Refine http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer*
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomDocumentcreateAttributeNSundefinednamespaceexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace-expected.txt (0 => 195152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace-expected.txt        2016-01-15 23:06:32 UTC (rev 195152)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Test calling createAttributeNS with undefined as the namespace URI. It should treat it as null.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+element = document.createElement(&quot;div&quot;); attr = document.createAttributeNS(undefined, &quot;foo&quot;)
+PASS attr.prefix is null
+PASS attr.localName is &quot;foo&quot;
+PASS attr.namespaceURI is null
+PASS element.getAttributeNodeNS(null, &quot;foo&quot;) is null
+PASS element.setAttributeNode(attr); element.getAttributeNodeNS(null, &quot;foo&quot;) is attr
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomDocumentcreateAttributeNSundefinednamespacehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace.html (0 => 195152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/Document/createAttributeNS-undefined-namespace.html        2016-01-15 23:06:32 UTC (rev 195152)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description('Test calling createAttributeNS with undefined as the namespace URI. It should treat it as null.');
+
+evalAndLog('element = document.createElement(&quot;div&quot;); attr = document.createAttributeNS(undefined, &quot;foo&quot;)');
+shouldBeNull('attr.prefix');
+shouldBeEqualToString('attr.localName', 'foo');
+shouldBeNull('attr.namespaceURI');
+shouldBeNull('element.getAttributeNodeNS(null, &quot;foo&quot;)');
+shouldBe('element.setAttributeNode(attr); element.getAttributeNodeNS(null, &quot;foo&quot;)', 'attr');
+
+&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="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (195151 => 195152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-01-15 23:03:02 UTC (rev 195151)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-01-15 23:06:32 UTC (rev 195152)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-01-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        createElementNS and createAttributeNS should treat undefined namespaceURI as null string
+        https://bugs.webkit.org/show_bug.cgi?id=153119
+
+        Reviewed by Chris Dumez.
+
+        Rebaseline a test now that more test cases are passing.
+
+        * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
+
</ins><span class="cx"> 2016-01-15  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Expose ReadableStream and relatives to Worker
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesDocumentcreateElementNSexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt (195151 => 195152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt        2016-01-15 23:03:02 UTC (rev 195151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt        2016-01-15 23:06:32 UTC (rev 195152)
</span><span class="lines">@@ -32,20 +32,20 @@
</span><span class="cx"> PASS createElementNS test 29: &quot;&quot;,&quot;:foo&quot;,&quot;NAMESPACE_ERR&quot; 
</span><span class="cx"> PASS createElementNS test 30: &quot;&quot;,&quot;f:oo&quot;,&quot;NAMESPACE_ERR&quot; 
</span><span class="cx"> PASS createElementNS test 31: &quot;&quot;,&quot;foo:&quot;,&quot;NAMESPACE_ERR&quot; 
</span><del>-FAIL createElementNS test 32: undefined,undefined,null assert_equals: expected (object) null but got (string) &quot;undefined&quot;
-FAIL createElementNS test 33: undefined,&quot;foo&quot;,null assert_equals: expected (object) null but got (string) &quot;undefined&quot;
</del><ins>+PASS createElementNS test 32: undefined,undefined,null 
+PASS createElementNS test 33: undefined,&quot;foo&quot;,null 
</ins><span class="cx"> PASS createElementNS test 34: undefined,&quot;1foo&quot;,&quot;INVALID_CHARACTER_ERR&quot; 
</span><del>-FAIL createElementNS test 35: undefined,&quot;f1oo&quot;,null assert_equals: expected (object) null but got (string) &quot;undefined&quot;
-FAIL createElementNS test 36: undefined,&quot;foo1&quot;,null assert_equals: expected (object) null but got (string) &quot;undefined&quot;
</del><ins>+PASS createElementNS test 35: undefined,&quot;f1oo&quot;,null 
+PASS createElementNS test 36: undefined,&quot;foo1&quot;,null 
</ins><span class="cx"> PASS createElementNS test 37: undefined,&quot;:foo&quot;,&quot;NAMESPACE_ERR&quot; 
</span><del>-FAIL createElementNS test 38: undefined,&quot;f:oo&quot;,&quot;NAMESPACE_ERR&quot; assert_throws: function &quot;function () { document.createElementNS(namespace, qualifi...&quot; did not throw
</del><ins>+PASS createElementNS test 38: undefined,&quot;f:oo&quot;,&quot;NAMESPACE_ERR&quot; 
</ins><span class="cx"> PASS createElementNS test 39: undefined,&quot;foo:&quot;,&quot;NAMESPACE_ERR&quot; 
</span><del>-FAIL createElementNS test 40: undefined,&quot;xml&quot;,null assert_equals: expected (object) null but got (string) &quot;undefined&quot;
</del><ins>+PASS createElementNS test 40: undefined,&quot;xml&quot;,null 
</ins><span class="cx"> PASS createElementNS test 41: undefined,&quot;xmlns&quot;,&quot;NAMESPACE_ERR&quot; 
</span><del>-FAIL createElementNS test 42: undefined,&quot;xmlfoo&quot;,null assert_equals: expected (object) null but got (string) &quot;undefined&quot;
</del><ins>+PASS createElementNS test 42: undefined,&quot;xmlfoo&quot;,null 
</ins><span class="cx"> PASS createElementNS test 43: undefined,&quot;xml:foo&quot;,&quot;NAMESPACE_ERR&quot; 
</span><span class="cx"> PASS createElementNS test 44: undefined,&quot;xmlns:foo&quot;,&quot;NAMESPACE_ERR&quot; 
</span><del>-FAIL createElementNS test 45: undefined,&quot;xmlfoo:bar&quot;,&quot;NAMESPACE_ERR&quot; assert_throws: function &quot;function () { document.createElementNS(namespace, qualifi...&quot; did not throw
</del><ins>+PASS createElementNS test 45: undefined,&quot;xmlfoo:bar&quot;,&quot;NAMESPACE_ERR&quot; 
</ins><span class="cx"> PASS createElementNS test 46: &quot;http://example.com/&quot;,&quot;foo&quot;,null 
</span><span class="cx"> PASS createElementNS test 47: &quot;http://example.com/&quot;,&quot;1foo&quot;,&quot;INVALID_CHARACTER_ERR&quot; 
</span><span class="cx"> PASS createElementNS test 48: &quot;http://example.com/&quot;,&quot;f1oo&quot;,null 
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx"> FAIL createElementNS test 156: null,null,null InvalidCharacterError: DOM Exception 5
</span><span class="cx"> PASS createElementNS test 157: null,&quot;&quot;,&quot;INVALID_CHARACTER_ERR&quot; 
</span><span class="cx"> FAIL createElementNS test 158: undefined,null,null InvalidCharacterError: DOM Exception 5
</span><del>-FAIL createElementNS test 159: undefined,undefined,null assert_equals: expected (object) null but got (string) &quot;undefined&quot;
</del><ins>+PASS createElementNS test 159: undefined,undefined,null 
</ins><span class="cx"> PASS createElementNS test 160: undefined,&quot;&quot;,&quot;INVALID_CHARACTER_ERR&quot; 
</span><span class="cx"> FAIL createElementNS test 161: &quot;http://example.com/&quot;,null,null InvalidCharacterError: DOM Exception 5
</span><span class="cx"> PASS createElementNS test 162: &quot;http://example.com/&quot;,&quot;&quot;,&quot;INVALID_CHARACTER_ERR&quot; 
</span><span class="lines">@@ -180,6 +180,6 @@
</span><span class="cx"> PASS Upper-case non-HTML element without a prefix 
</span><span class="cx"> PASS Upper-case non-HTML element with a prefix 
</span><span class="cx"> PASS null namespace 
</span><del>-FAIL undefined namespace assert_equals: expected (object) null but got (string) &quot;undefined&quot;
</del><ins>+PASS undefined namespace 
</ins><span class="cx"> PASS empty string namespace 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195151 => 195152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-15 23:03:02 UTC (rev 195151)
+++ trunk/Source/WebCore/ChangeLog        2016-01-15 23:06:32 UTC (rev 195152)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-01-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        createElementNS and createAttributeNS should treat undefined namespaceURI as null string
+        https://bugs.webkit.org/show_bug.cgi?id=153119
+
+        Reviewed by Chris Dumez.
+
+        Treat undefined as null in document.createElementNS and document.createAttributeNS as defined in:
+        https://dom.spec.whatwg.org/#document
+
+        Test: fast/dom/Document/createAttributeNS-undefined-namespace.html
+
+        * dom/Document.idl:
+
</ins><span class="cx"> 2016-01-15  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Font features are not applied to the system font
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.idl (195151 => 195152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.idl        2016-01-15 23:03:02 UTC (rev 195151)
+++ trunk/Source/WebCore/dom/Document.idl        2016-01-15 23:06:32 UTC (rev 195152)
</span><span class="lines">@@ -54,9 +54,9 @@
</span><span class="cx"> 
</span><span class="cx">     [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
</span><span class="cx">                     optional boolean deep);
</span><del>-    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
</del><ins>+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,TreatUndefinedAs=NullString,Default=Undefined] optional DOMString namespaceURI,
</ins><span class="cx">                             [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
</span><del>-    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
</del><ins>+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,TreatUndefinedAs=NullString,Default=Undefined] optional DOMString namespaceURI,
</ins><span class="cx">                                                                           [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
</span><span class="cx"> 
</span><span class="cx"> #if defined(LANGUAGE_OBJECTIVE_C) &amp;&amp; LANGUAGE_OBJECTIVE_C
</span></span></pre>
</div>
</div>

</body>
</html>