<!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>[189507] 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/189507">189507</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-09-08 14:57:06 -0700 (Tue, 08 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>new Comment(undefined) / new Text(undefined) should use default's empty string
https://bugs.webkit.org/show_bug.cgi?id=148973
&lt;rdar://problem/22548042&gt;

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* web-platform-tests/dom/nodes/Comment-constructor-expected.txt:
* web-platform-tests/dom/nodes/Text-constructor-expected.txt:
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-07-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor-expected.txt:
Rebaseline tests now that new checks are passing.

Source/WebCore:

new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
undefined to the &quot;undefined&quot; string:
- https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
- https://dom.spec.whatwg.org/#text (ditto)

undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
behavior of Firefox and Chrome.

No new tests, already covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):

LayoutTests:

Fix a couple of layout tests that were wrongly expecting undefined to
be converted to the &quot;undefined&quot; String for optional DOMString parameters.

* fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt:
* fast/dom/DOMImplementation/createHTMLDocument-optional-title.html:
* fast/dom/Window/custom-constructors-expected.txt:
* fast/dom/Window/custom-constructors.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomDOMImplementationcreateHTMLDocumentoptionaltitleexpectedtxt">trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomDOMImplementationcreateHTMLDocumentoptionaltitlehtml">trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title.html</a></li>
<li><a href="#trunkLayoutTestsfastdomWindowcustomconstructorsexpectedtxt">trunk/LayoutTests/fast/dom/Window/custom-constructors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomWindowcustomconstructorshtml">trunk/LayoutTests/fast/dom/Window/custom-constructors.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesCommentconstructorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Comment-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdomnodesTextconstructorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Text-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldomdocumentsdomtreeaccessorsdocumenttitle07expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-07-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsembeddedcontenttheaudioelementaudio_constructorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomcustomconstructorsexpectedtxt">trunk/LayoutTests/js/dom/custom-constructors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomscripttestscustomconstructorsjs">trunk/LayoutTests/js/dom/script-tests/custom-constructors.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/ChangeLog        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-09-08  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        new Comment(undefined) / new Text(undefined) should use default's empty string
+        https://bugs.webkit.org/show_bug.cgi?id=148973
+        &lt;rdar://problem/22548042&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Fix a couple of layout tests that were wrongly expecting undefined to
+        be converted to the &quot;undefined&quot; String for optional DOMString parameters.
+
+        * fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt:
+        * fast/dom/DOMImplementation/createHTMLDocument-optional-title.html:
+        * fast/dom/Window/custom-constructors-expected.txt:
+        * fast/dom/Window/custom-constructors.html:
+
</ins><span class="cx"> 2015-09-08  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ES6] Implement computed accessors
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomDOMImplementationcreateHTMLDocumentoptionaltitleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> PASS document.implementation.createHTMLDocument().querySelector(&quot;title&quot;) is null
</span><span class="cx"> PASS document.implementation.createHTMLDocument(null).querySelector(&quot;title&quot;).textContent is &quot;null&quot;
</span><del>-PASS document.implementation.createHTMLDocument(undefined).querySelector(&quot;title&quot;).textContent is &quot;undefined&quot;
</del><ins>+PASS document.implementation.createHTMLDocument(undefined).querySelector(&quot;title&quot;) is null
</ins><span class="cx"> PASS document.implementation.createHTMLDocument(&quot;&quot;).querySelector(&quot;title&quot;).textContent is &quot;&quot;
</span><span class="cx"> PASS document.implementation.createHTMLDocument(&quot;x&quot;).querySelector(&quot;title&quot;).textContent is &quot;x&quot;
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomDOMImplementationcreateHTMLDocumentoptionaltitlehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title.html (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title.html        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title.html        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -6,9 +6,9 @@
</span><span class="cx"> shouldBeNull('document.implementation.createHTMLDocument().querySelector(&quot;title&quot;)');
</span><span class="cx"> 
</span><span class="cx"> shouldBeEqualToString('document.implementation.createHTMLDocument(null).querySelector(&quot;title&quot;).textContent', 'null');
</span><del>-shouldBeEqualToString('document.implementation.createHTMLDocument(undefined).querySelector(&quot;title&quot;).textContent', 'undefined');
</del><ins>+shouldBeNull('document.implementation.createHTMLDocument(undefined).querySelector(&quot;title&quot;)');
</ins><span class="cx"> shouldBeEqualToString('document.implementation.createHTMLDocument(&quot;&quot;).querySelector(&quot;title&quot;).textContent', '');
</span><span class="cx"> shouldBeEqualToString('document.implementation.createHTMLDocument(&quot;x&quot;).querySelector(&quot;title&quot;).textContent', 'x');
</span><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span><del>-&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomWindowcustomconstructorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Window/custom-constructors-expected.txt (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Window/custom-constructors-expected.txt        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/fast/dom/Window/custom-constructors-expected.txt        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -8,8 +8,8 @@
</span><span class="cx"> PASS WebKitPoint.prototype.toString.call(new WebKitPoint) is '[object WebKitPoint]'
</span><span class="cx"> PASS WebKitCSSMatrix.prototype.toString.call(new WebKitCSSMatrix) is 'matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)'
</span><span class="cx"> PASS WebKitCSSMatrix.prototype.toString.call(new WebKitCSSMatrix()) is 'matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)'
</span><ins>+PASS WebKitCSSMatrix.prototype.toString.call(new WebKitCSSMatrix(undefined)) is 'matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)'
</ins><span class="cx"> PASS new WebKitCSSMatrix(null) threw exception Error: SyntaxError: DOM Exception 12.
</span><del>-PASS new WebKitCSSMatrix(undefined) threw exception Error: SyntaxError: DOM Exception 12.
</del><span class="cx"> PASS XMLHttpRequest.prototype.toString.call(new XMLHttpRequest) is '[object XMLHttpRequest]'
</span><span class="cx"> PASS XSLTProcessor.prototype.toString.call(new XSLTProcessor) is '[object XSLTProcessor]'
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomWindowcustomconstructorshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Window/custom-constructors.html (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Window/custom-constructors.html        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/fast/dom/Window/custom-constructors.html        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -17,8 +17,8 @@
</span><span class="cx">     shouldBe(&quot;WebKitPoint.prototype.toString.call(new WebKitPoint)&quot;, &quot;'[object WebKitPoint]'&quot;);
</span><span class="cx">     shouldBe(&quot;WebKitCSSMatrix.prototype.toString.call(new WebKitCSSMatrix)&quot;, &quot;'matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)'&quot;);
</span><span class="cx">     shouldBe(&quot;WebKitCSSMatrix.prototype.toString.call(new WebKitCSSMatrix())&quot;, &quot;'matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)'&quot;);
</span><ins>+    shouldBe(&quot;WebKitCSSMatrix.prototype.toString.call(new WebKitCSSMatrix(undefined))&quot;, &quot;'matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)'&quot;);
</ins><span class="cx">     shouldThrow(&quot;new WebKitCSSMatrix(null)&quot;);
</span><del>-    shouldThrow(&quot;new WebKitCSSMatrix(undefined)&quot;);
</del><span class="cx">     shouldBe(&quot;XMLHttpRequest.prototype.toString.call(new XMLHttpRequest)&quot;, &quot;'[object XMLHttpRequest]'&quot;);
</span><span class="cx">     shouldBe(&quot;XSLTProcessor.prototype.toString.call(new XSLTProcessor)&quot;, &quot;'[object XSLTProcessor]'&quot;);
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2015-09-08  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        new Comment(undefined) / new Text(undefined) should use default's empty string
+        https://bugs.webkit.org/show_bug.cgi?id=148973
+        &lt;rdar://problem/22548042&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        * web-platform-tests/dom/nodes/Comment-constructor-expected.txt:
+        * web-platform-tests/dom/nodes/Text-constructor-expected.txt:
+        * web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-07-expected.txt:
+        * web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor-expected.txt:
+        Rebaseline tests now that new checks are passing.
+
+2015-09-08  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         document.importNode(node, deep): deep's default value should be false
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=148959
</span><span class="cx">         &lt;rdar://problem/22558915&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesCommentconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Comment-constructor-expected.txt (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Comment-constructor-expected.txt        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Comment-constructor-expected.txt        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> PASS new Comment(): prototype chain 
</span><span class="cx"> PASS new Comment(): instanceof 
</span><span class="cx"> PASS new Comment(): no arguments 
</span><del>-FAIL new Comment(): undefined assert_equals: expected &quot;&quot; but got &quot;undefined&quot;
</del><ins>+PASS new Comment(): undefined 
</ins><span class="cx"> PASS new Comment(): null 
</span><span class="cx"> PASS new Comment(): 42 
</span><span class="cx"> PASS new Comment(): &quot;&quot; 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdomnodesTextconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Text-constructor-expected.txt (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Text-constructor-expected.txt        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Text-constructor-expected.txt        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> PASS new Text(): prototype chain 
</span><span class="cx"> PASS new Text(): instanceof 
</span><span class="cx"> PASS new Text(): no arguments 
</span><del>-FAIL new Text(): undefined assert_equals: expected &quot;&quot; but got &quot;undefined&quot;
</del><ins>+PASS new Text(): undefined 
</ins><span class="cx"> PASS new Text(): null 
</span><span class="cx"> PASS new Text(): 42 
</span><span class="cx"> PASS new Text(): &quot;&quot; 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldomdocumentsdomtreeaccessorsdocumenttitle07expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-07-expected.txt (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-07-expected.txt        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-07-expected.txt        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> 
</span><span class="cx"> PASS createHTMLDocument test 0: &quot;&quot;,&quot;&quot;,&quot;&quot; 
</span><span class="cx"> PASS createHTMLDocument test 1: null,&quot;null&quot;,&quot;null&quot; 
</span><del>-FAIL createHTMLDocument test 2: undefined,undefined,&quot;&quot; assert_equals: expected &quot;&quot; but got &quot;undefined&quot;
</del><ins>+PASS createHTMLDocument test 2: undefined,undefined,&quot;&quot; 
</ins><span class="cx"> PASS createHTMLDocument test 3: &quot;foo  bar baz&quot;,&quot;foo  bar baz&quot;,&quot;foo bar baz&quot; 
</span><span class="cx"> PASS createHTMLDocument test 4: &quot;foo\t\tbar baz&quot;,&quot;foo\t\tbar baz&quot;,&quot;foo bar baz&quot; 
</span><span class="cx"> PASS createHTMLDocument test 5: &quot;foo\n\nbar baz&quot;,&quot;foo\n\nbar baz&quot;,&quot;foo bar baz&quot; 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlsemanticsembeddedcontenttheaudioelementaudio_constructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor-expected.txt (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor-expected.txt        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor-expected.txt        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> FAIL Null argument, without new Audio is not a function. (In 'Audio(null)', 'Audio' is an instance of AudioConstructor)
</span><span class="cx"> PASS Null argument, with new 
</span><span class="cx"> FAIL Undefined argument, without new Audio is not a function. (In 'Audio(undefined)', 'Audio' is an instance of AudioConstructor)
</span><del>-FAIL Undefined argument, with new assert_equals: expected (object) null but got (string) &quot;undefined&quot;
</del><ins>+PASS Undefined argument, with new 
</ins><span class="cx"> FAIL Extra argument, without new Audio is not a function. (In 'Audio(&quot;&quot;, throwingObject)', 'Audio' is an instance of AudioConstructor)
</span><span class="cx"> PASS Extra argument, with new 
</span><span class="cx"> PASS Calling HTMLAudioElement should throw 
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomcustomconstructorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/custom-constructors-expected.txt (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/custom-constructors-expected.txt        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/js/dom/custom-constructors-expected.txt        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -17,11 +17,11 @@
</span><span class="cx"> PASS new Option().tagName is &quot;OPTION&quot;
</span><span class="cx"> PASS new Option().innerText is &quot;&quot;
</span><span class="cx"> PASS new Option(null).innerText is &quot;null&quot;
</span><del>-PASS new Option(undefined).innerText is &quot;undefined&quot;
</del><ins>+PASS new Option(undefined).innerText is &quot;&quot;
</ins><span class="cx"> PASS new Option('somedata').innerText is &quot;somedata&quot;
</span><span class="cx"> PASS new Option().value is &quot;&quot;
</span><span class="cx"> PASS new Option('somedata', null).value is &quot;null&quot;
</span><del>-PASS new Option('somedata', undefined).value is &quot;undefined&quot;
</del><ins>+PASS new Option('somedata', undefined).value is &quot;somedata&quot;
</ins><span class="cx"> PASS new Option('somedata', 'somevalue').value is &quot;somevalue&quot;
</span><span class="cx"> PASS new Option().defaultSelected is false
</span><span class="cx"> PASS new Option('somedata', 'somevalue').defaultSelected is false
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomscripttestscustomconstructorsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/script-tests/custom-constructors.js (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/script-tests/custom-constructors.js        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/LayoutTests/js/dom/script-tests/custom-constructors.js        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -23,12 +23,12 @@
</span><span class="cx"> 
</span><span class="cx"> shouldBeEqualToString(&quot;new Option().innerText&quot;, &quot;&quot;);
</span><span class="cx"> shouldBeEqualToString(&quot;new Option(null).innerText&quot;, &quot;null&quot;);
</span><del>-shouldBeEqualToString(&quot;new Option(undefined).innerText&quot;, &quot;undefined&quot;);
</del><ins>+shouldBeEqualToString(&quot;new Option(undefined).innerText&quot;, &quot;&quot;);
</ins><span class="cx"> shouldBeEqualToString(&quot;new Option('somedata').innerText&quot;, &quot;somedata&quot;);
</span><span class="cx"> 
</span><span class="cx"> shouldBeEqualToString(&quot;new Option().value&quot;, &quot;&quot;);
</span><span class="cx"> shouldBeEqualToString(&quot;new Option('somedata', null).value&quot;, &quot;null&quot;);
</span><del>-shouldBeEqualToString(&quot;new Option('somedata', undefined).value&quot;, &quot;undefined&quot;);
</del><ins>+shouldBeEqualToString(&quot;new Option('somedata', undefined).value&quot;, &quot;somedata&quot;);
</ins><span class="cx"> shouldBeEqualToString(&quot;new Option('somedata', 'somevalue').value&quot;, &quot;somevalue&quot;);
</span><span class="cx"> 
</span><span class="cx"> shouldBeFalse(&quot;new Option().defaultSelected&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/Source/WebCore/ChangeLog        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2015-09-08  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        new Comment(undefined) / new Text(undefined) should use default's empty string
+        https://bugs.webkit.org/show_bug.cgi?id=148973
+        &lt;rdar://problem/22548042&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
+        undefined to the &quot;undefined&quot; string:
+        - https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
+        - https://dom.spec.whatwg.org/#text (ditto)
+
+        undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
+        per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
+        behavior of Firefox and Chrome.
+
+        No new tests, already covered by existing tests.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateParametersCheck):
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
+
+2015-09-08  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         document.importNode(node, deep): deep's default value should be false
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=148959
</span><span class="cx">         &lt;rdar://problem/22558915&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -3388,7 +3388,7 @@
</span><span class="cx">                 my $outer;
</span><span class="cx">                 my $inner;
</span><span class="cx">                 if ($optional &amp;&amp; $defaultAttribute &amp;&amp; $defaultAttribute eq &quot;NullString&quot;) {
</span><del>-                    $outer = &quot;exec-&gt;argumentCount() &lt;= $argsIndex ? String() : &quot;;
</del><ins>+                    $outer = &quot;exec-&gt;argument($argsIndex).isUndefined() ? String() : &quot;;
</ins><span class="cx">                     $inner = &quot;exec-&gt;uncheckedArgument($argsIndex)&quot;;
</span><span class="cx">                 } else {
</span><span class="cx">                     $outer = &quot;&quot;;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">     String str2 = exec-&gt;argument(1).toString(exec)-&gt;value(exec);
</span><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    String str3 = exec-&gt;argumentCount() &lt;= 2 ? String() : exec-&gt;uncheckedArgument(2).toString(exec)-&gt;value(exec);
</del><ins>+    String str3 = exec-&gt;argument(2).isUndefined() ? String() : exec-&gt;uncheckedArgument(2).toString(exec)-&gt;value(exec);
</ins><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     RefPtr&lt;TestNamedConstructor&gt; object = TestNamedConstructor::createForJSConstructor(*castedThis-&gt;document(), str1, str2, str3, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (189506 => 189507)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-09-08 21:56:22 UTC (rev 189506)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-09-08 21:57:06 UTC (rev 189507)
</span><span class="lines">@@ -3592,7 +3592,7 @@
</span><span class="cx">         return throwThisTypeError(*exec, &quot;TestObj&quot;, &quot;methodWithOptionalStringIsNullString&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;impl();
</span><del>-    String str = exec-&gt;argumentCount() &lt;= 0 ? String() : exec-&gt;uncheckedArgument(0).toString(exec)-&gt;value(exec);
</del><ins>+    String str = exec-&gt;argument(0).isUndefined() ? String() : exec-&gt;uncheckedArgument(0).toString(exec)-&gt;value(exec);
</ins><span class="cx">     if (UNLIKELY(exec-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringIsNullString(str);
</span></span></pre>
</div>
</div>

</body>
</html>