<!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>[203610] 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/203610">203610</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-07-22 12:54:13 -0700 (Fri, 22 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Parameters to Node.replaceChild() / insertBefore() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=160091

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Parameters to Node.replaceChild() / insertBefore() should be mandatory:
- https://dom.spec.whatwg.org/#node

The compatibility risk should be low since Firefox and Chrome both agree
with the specification and because it does not make much sense to omit
parameters when using this API.

No new tests, rebaselined existing tests.

* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::insertBefore):
(WebCore::JSNode::replaceChild):

LayoutTests:

Update existing tests due to the behavior change.

* fast/block/basic/empty-anonymous-block-remove-crash.html:
* fast/html/details-summary-document-child.html:
* fast/repaint/focus-ring-with-negative-offset-repaint.html:
* svg/animations/mpath-remove-from-dependents-on-delete-crash.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastblockbasicemptyanonymousblockremovecrashhtml">trunk/LayoutTests/fast/block/basic/empty-anonymous-block-remove-crash.html</a></li>
<li><a href="#trunkLayoutTestsfastdommovenodesacrossdocumentshtml">trunk/LayoutTests/fast/dom/move-nodes-across-documents.html</a></li>
<li><a href="#trunkLayoutTestsfasthtmldetailssummarydocumentchildhtml">trunk/LayoutTests/fast/html/details-summary-document-child.html</a></li>
<li><a href="#trunkLayoutTestsfastrepaintfocusringwithnegativeoffsetrepainthtml">trunk/LayoutTests/fast/repaint/focus-ring-with-negative-offset-repaint.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsmpathremovefromdependentsondeletecrashhtml">trunk/LayoutTests/svg/animations/mpath-remove-from-dependents-on-delete-crash.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/ChangeLog        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2016-07-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Parameters to Node.replaceChild() / insertBefore() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160091
+
+        Reviewed by Darin Adler.
+
+        Update existing tests due to the behavior change.
+
+        * fast/block/basic/empty-anonymous-block-remove-crash.html:
+        * fast/html/details-summary-document-child.html:
+        * fast/repaint/focus-ring-with-negative-offset-repaint.html:
+        * svg/animations/mpath-remove-from-dependents-on-delete-crash.html:
+
+2016-07-22  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         First parameter to getElementById() should be mandatory
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160087
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastblockbasicemptyanonymousblockremovecrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/block/basic/empty-anonymous-block-remove-crash.html (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/block/basic/empty-anonymous-block-remove-crash.html        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/fast/block/basic/empty-anonymous-block-remove-crash.html        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">             function runTest()
</span><span class="cx">             {
</span><span class="cx">                 var button = document.getElementById(&quot;test&quot;);
</span><del>-                button.insertBefore(document.createElement(&quot;tbody&quot;));
</del><ins>+                button.insertBefore(document.createElement(&quot;tbody&quot;), null);
</ins><span class="cx">                 document.body.offsetTop;
</span><span class="cx">                 document.body.removeChild(button);
</span><span class="cx">                 
</span></span></pre></div>
<a id="trunkLayoutTestsfastdommovenodesacrossdocumentshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/move-nodes-across-documents.html (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/move-nodes-across-documents.html        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/fast/dom/move-nodes-across-documents.html        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">         };
</span><span class="cx">         document.body.addEventListener('DOMSubtreeModified', mutationHandler, true);
</span><span class="cx">         try {
</span><del>-            iframeDoc.body.insertBefore(element);
</del><ins>+            iframeDoc.body.insertBefore(element, null);
</ins><span class="cx">         } catch (e) {
</span><span class="cx">           throw e;
</span><span class="cx">         } finally {
</span></span></pre></div>
<a id="trunkLayoutTestsfasthtmldetailssummarydocumentchildhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/html/details-summary-document-child.html (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/html/details-summary-document-child.html        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/fast/html/details-summary-document-child.html        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> 
</span><span class="cx"> function test() {
</span><span class="cx">     document.open();
</span><del>-    document.insertBefore(document.createElement(&quot;summary&quot;));
</del><ins>+    document.insertBefore(document.createElement(&quot;summary&quot;), null);
</ins><span class="cx">     // The document don't have &lt;body&gt; so we need use console.log()
</span><span class="cx">     // to make readable expectation.
</span><span class="cx">     console.log(&quot;PASS unless crash&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastrepaintfocusringwithnegativeoffsetrepainthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/repaint/focus-ring-with-negative-offset-repaint.html (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/repaint/focus-ring-with-negative-offset-repaint.html        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/fast/repaint/focus-ring-with-negative-offset-repaint.html        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">         var element = document.createElement(&quot;div&quot;);
</span><span class="cx">         element.style.outlineOffset = -i + &quot;px&quot;;
</span><span class="cx">         element.style.top = (30 * i) + &quot;px&quot;;
</span><del>-        document.body.insertBefore(element);
</del><ins>+        document.body.insertBefore(element, null);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> onload = runRepaintTest;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2016-07-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Parameters to Node.replaceChild() / insertBefore() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160091
+
+        Reviewed by Darin Adler.
+
+        Rebaseline several W3C tests now that more checks are passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-07-22  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Parameter to Node.contains() should be mandatory
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160084
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -391,9 +391,7 @@
</span><span class="cx"> PASS Node interface: new Document() must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on new Document() with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: new Document() must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on new Document() with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on new Document() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: new Document() must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on new Document() with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: new Document() must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span><span class="lines">@@ -521,9 +519,7 @@
</span><span class="cx"> PASS Node interface: xmlDoc must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on xmlDoc with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: xmlDoc must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on xmlDoc with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: xmlDoc must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on xmlDoc with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: xmlDoc must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span><span class="lines">@@ -631,9 +627,7 @@
</span><span class="cx"> PASS Node interface: document.doctype must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on document.doctype with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.doctype must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on document.doctype with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on document.doctype with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: document.doctype must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on document.doctype with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.doctype must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span><span class="lines">@@ -727,9 +721,7 @@
</span><span class="cx"> PASS Node interface: document.createDocumentFragment() must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on document.createDocumentFragment() with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createDocumentFragment() must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on document.createDocumentFragment() with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; did not throw
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on document.createDocumentFragment() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: document.createDocumentFragment() must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on document.createDocumentFragment() with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createDocumentFragment() must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span><span class="lines">@@ -934,9 +926,7 @@
</span><span class="cx"> PASS Node interface: element must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on element with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: element must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on element with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; did not throw
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on element with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: element must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on element with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: element must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span><span class="lines">@@ -1097,9 +1087,7 @@
</span><span class="cx"> PASS Node interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on document.createTextNode(&quot;abc&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span><span class="lines">@@ -1193,9 +1181,7 @@
</span><span class="cx"> PASS Node interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: xmlDoc.createProcessingInstruction(&quot;abc&quot;, &quot;def&quot;) must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span><span class="lines">@@ -1287,9 +1273,7 @@
</span><span class="cx"> PASS Node interface: document.createComment(&quot;abc&quot;) must inherit property &quot;isDefaultNamespace&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createComment(&quot;abc&quot;) must inherit property &quot;insertBefore&quot; with the proper type (42) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: document.createComment(&quot;abc&quot;) must inherit property &quot;appendChild&quot; with the proper type (43) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on document.createComment(&quot;abc&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createComment(&quot;abc&quot;) must inherit property &quot;replaceChild&quot; with the proper type (44) 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -372,9 +372,7 @@
</span><span class="cx"> PASS Node interface: iframe.contentDocument must inherit property &quot;isDefaultNamespace&quot; with the proper type (39) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on iframe.contentDocument with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: iframe.contentDocument must inherit property &quot;insertBefore&quot; with the proper type (40) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on iframe.contentDocument with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: iframe.contentDocument must inherit property &quot;appendChild&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on iframe.contentDocument with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: iframe.contentDocument must inherit property &quot;replaceChild&quot; with the proper type (42) 
</span><span class="lines">@@ -638,9 +636,7 @@
</span><span class="cx"> PASS Node interface: new Document() must inherit property &quot;isDefaultNamespace&quot; with the proper type (39) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on new Document() with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: new Document() must inherit property &quot;insertBefore&quot; with the proper type (40) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on new Document() with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on new Document() with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: new Document() must inherit property &quot;appendChild&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on new Document() with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: new Document() must inherit property &quot;replaceChild&quot; with the proper type (42) 
</span><span class="lines">@@ -907,9 +903,7 @@
</span><span class="cx"> PASS Node interface: document.implementation.createDocument(null, &quot;&quot;, null) must inherit property &quot;isDefaultNamespace&quot; with the proper type (39) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on document.implementation.createDocument(null, &quot;&quot;, null) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.implementation.createDocument(null, &quot;&quot;, null) must inherit property &quot;insertBefore&quot; with the proper type (40) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on document.implementation.createDocument(null, &quot;&quot;, null) with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; threw object &quot;HierarchyRequestError (DOM Exception 3): The operation wo...&quot; (&quot;HierarchyRequestError&quot;) expected object &quot;TypeError&quot; (&quot;TypeError&quot;)
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on document.implementation.createDocument(null, &quot;&quot;, null) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: document.implementation.createDocument(null, &quot;&quot;, null) must inherit property &quot;appendChild&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on document.implementation.createDocument(null, &quot;&quot;, null) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.implementation.createDocument(null, &quot;&quot;, null) must inherit property &quot;replaceChild&quot; with the proper type (42) 
</span><span class="lines">@@ -1301,9 +1295,7 @@
</span><span class="cx"> PASS Node interface: document.createElement(&quot;noscript&quot;) must inherit property &quot;isDefaultNamespace&quot; with the proper type (39) 
</span><span class="cx"> PASS Node interface: calling isDefaultNamespace(DOMString) on document.createElement(&quot;noscript&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createElement(&quot;noscript&quot;) must inherit property &quot;insertBefore&quot; with the proper type (40) 
</span><del>-FAIL Node interface: calling insertBefore(Node,Node) on document.createElement(&quot;noscript&quot;) with too few arguments must throw TypeError assert_throws: Called with 1 arguments function &quot;function () {
-            fn.apply(obj, args);
-        }&quot; did not throw
</del><ins>+PASS Node interface: calling insertBefore(Node,Node) on document.createElement(&quot;noscript&quot;) with too few arguments must throw TypeError 
</ins><span class="cx"> PASS Node interface: document.createElement(&quot;noscript&quot;) must inherit property &quot;appendChild&quot; with the proper type (41) 
</span><span class="cx"> PASS Node interface: calling appendChild(Node) on document.createElement(&quot;noscript&quot;) with too few arguments must throw TypeError 
</span><span class="cx"> PASS Node interface: document.createElement(&quot;noscript&quot;) must inherit property &quot;replaceChild&quot; with the proper type (42) 
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsmpathremovefromdependentsondeletecrashhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/mpath-remove-from-dependents-on-delete-crash.html (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/mpath-remove-from-dependents-on-delete-crash.html        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/LayoutTests/svg/animations/mpath-remove-from-dependents-on-delete-crash.html        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx">             window.GCController.collect();
</span><span class="cx">           else if (window.gc)
</span><span class="cx">             gc();
</span><del>-          document.getElementById(&quot;A&quot;).insertBefore(document.getElementById(&quot;path_a&quot;));
</del><ins>+          document.getElementById(&quot;A&quot;).insertBefore(document.getElementById(&quot;path_a&quot;), null);
</ins><span class="cx">           if (location.hash == '')
</span><span class="cx">             location.hash = '#1';
</span><span class="cx">           else
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/Source/WebCore/ChangeLog        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2016-07-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Parameters to Node.replaceChild() / insertBefore() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160091
+
+        Reviewed by Darin Adler.
+
+        Parameters to Node.replaceChild() / insertBefore() should be mandatory:
+        - https://dom.spec.whatwg.org/#node
+
+        The compatibility risk should be low since Firefox and Chrome both agree
+        with the specification and because it does not make much sense to omit
+        parameters when using this API.
+
+        No new tests, rebaselined existing tests.
+
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::JSNode::insertBefore):
+        (WebCore::JSNode::replaceChild):
+
+2016-07-22  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Parameter to Node.contains() should be mandatory
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160084
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (203609 => 203610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp        2016-07-22 19:34:58 UTC (rev 203609)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp        2016-07-22 19:54:13 UTC (rev 203610)
</span><span class="lines">@@ -114,13 +114,16 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSNode::insertBefore(ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    JSValue newChildValue = state.argument(0);
</del><ins>+    if (UNLIKELY(state.argumentCount() &lt; 2))
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    JSValue newChildValue = state.uncheckedArgument(0);
</ins><span class="cx">     auto* newChild = JSNode::toWrapped(newChildValue);
</span><span class="cx">     if (UNLIKELY(!newChild))
</span><span class="cx">         return JSValue::decode(throwArgumentTypeError(state, 0, &quot;node&quot;, &quot;Node&quot;, &quot;insertBefore&quot;, &quot;Node&quot;));
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    if (UNLIKELY(!wrapped().insertBefore(*newChild, JSNode::toWrapped(state.argument(1)), ec))) {
</del><ins>+    if (UNLIKELY(!wrapped().insertBefore(*newChild, JSNode::toWrapped(state.uncheckedArgument(1)), ec))) {
</ins><span class="cx">         setDOMException(&amp;state, ec);
</span><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="lines">@@ -131,8 +134,11 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSNode::replaceChild(ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    auto* newChild = JSNode::toWrapped(state.argument(0));
-    JSValue oldChildValue = state.argument(1);
</del><ins>+    if (UNLIKELY(state.argumentCount() &lt; 2))
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    auto* newChild = JSNode::toWrapped(state.uncheckedArgument(0));
+    JSValue oldChildValue = state.uncheckedArgument(1);
</ins><span class="cx">     auto* oldChild = JSNode::toWrapped(oldChildValue);
</span><span class="cx">     if (UNLIKELY(!newChild || !oldChild)) {
</span><span class="cx">         if (!newChild)
</span></span></pre>
</div>
</div>

</body>
</html>