<!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>[203731] 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/203731">203731</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-07-26 12:09:53 -0700 (Tue, 26 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Align NamedNodeMap with the specification
https://bugs.webkit.org/show_bug.cgi?id=160204

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

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

Source/WebCore:

Align NamedNodeMap with the specification:
- https://dom.spec.whatwg.org/#interface-namednodemap

In particular, mark parameters as mandatory when they should be, and
use tighter &quot;Attr&quot; typing instead of Node.

Chrome and Firefox agree with the specification.

Test: fast/dom/NamedNodeMap-parameters.html

* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::getNamedItem):
(WebCore::NamedNodeMap::getNamedItemNS):
(WebCore::NamedNodeMap::removeNamedItem):
(WebCore::NamedNodeMap::removeNamedItemNS):
(WebCore::NamedNodeMap::setNamedItem):
(WebCore::NamedNodeMap::item):
* dom/NamedNodeMap.h:
* dom/NamedNodeMap.idl:

LayoutTests:

* dom/html/level2/core/hc_namednodemapinvalidtype1-expected.txt: Removed.
* dom/html/level2/core/hc_namednodemapinvalidtype1.html: Removed.
* dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt: Removed.
* dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml: Removed.
Drop outdated DOM level 2 tests that expect the wrong exception type to
be thrown when passing a non-Attr node in.

* fast/dom/NamedNodeMap-parameters-expected.txt: Added.
* fast/dom/NamedNodeMap-parameters.html: Added.
Add layout test coverage. I have verified that this test is passing in
both Firefox and Chrome.

* fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt:
* fast/dom/non-numeric-values-numeric-parameters-expected.txt:
* fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
Update / rebaseline existing tests to reflect behavior change.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomNamedNodeMapsetNamedItemcrashexpectedtxt">trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnonnumericvaluesnumericparametersexpectedtxt">trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomscripttestsnonnumericvaluesnumericparametersjs">trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js</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="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomNamedNodeMapcpp">trunk/Source/WebCore/dom/NamedNodeMap.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNamedNodeMaph">trunk/Source/WebCore/dom/NamedNodeMap.h</a></li>
<li><a href="#trunkSourceWebCoredomNamedNodeMapidl">trunk/Source/WebCore/dom/NamedNodeMap.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomNamedNodeMapparametersexpectedtxt">trunk/LayoutTests/fast/dom/NamedNodeMap-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomNamedNodeMapparametershtml">trunk/LayoutTests/fast/dom/NamedNodeMap-parameters.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsdomhtmllevel2corehc_namednodemapinvalidtype1expectedtxt">trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsdomhtmllevel2corehc_namednodemapinvalidtype1html">trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1.html</a></li>
<li><a href="#trunkLayoutTestsdomxhtmllevel2corehc_namednodemapinvalidtype1expectedtxt">trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsdomxhtmllevel2corehc_namednodemapinvalidtype1xhtml">trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/ChangeLog        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-07-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Align NamedNodeMap with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=160204
+
+        Reviewed by Darin Adler.
+
+        * dom/html/level2/core/hc_namednodemapinvalidtype1-expected.txt: Removed.
+        * dom/html/level2/core/hc_namednodemapinvalidtype1.html: Removed.
+        * dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt: Removed.
+        * dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml: Removed.
+        Drop outdated DOM level 2 tests that expect the wrong exception type to
+        be thrown when passing a non-Attr node in.
+
+        * fast/dom/NamedNodeMap-parameters-expected.txt: Added.
+        * fast/dom/NamedNodeMap-parameters.html: Added.
+        Add layout test coverage. I have verified that this test is passing in
+        both Firefox and Chrome.
+
+        * fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt:
+        * fast/dom/non-numeric-values-numeric-parameters-expected.txt:
+        * fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
+        Update / rebaseline existing tests to reflect behavior change.
+
</ins><span class="cx"> 2016-07-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Infinite Canvas context save() causes WebKit to crash
</span></span></pre></div>
<a id="trunkLayoutTestsdomhtmllevel2corehc_namednodemapinvalidtype1expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1-expected.txt (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1-expected.txt        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1-expected.txt        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-Test:        http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_namednodemapinvalidtype1
-Status:        Success
</del></span></pre></div>
<a id="trunkLayoutTestsdomhtmllevel2corehc_namednodemapinvalidtype1html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1.html (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1.html        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/dom/html/level2/core/hc_namednodemapinvalidtype1.html        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,48 +0,0 @@
</span><del>-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; 
-    &quot;http://www.w3.org/TR/html4/strict.dtd&quot; &gt;
-&lt;!-- This is comment number 1.--&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;&lt;title&gt;hc_staff&lt;/title&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;selfhtml.js&quot;&gt;&lt;/script&gt;&lt;script charset=&quot;UTF-8&quot; type=&quot;text/javascript&quot; src=&quot;hc_namednodemapinvalidtype1.js&quot;&gt;&lt;/script&gt;&lt;script type='text/javascript'&gt;function loadComplete() { startTest(); }&lt;/script&gt;&lt;/head&gt;&lt;body onload=&quot;loadComplete()&quot;&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0001&lt;/em&gt;
-  &lt;strong&gt;Margaret Martin&lt;/strong&gt;
-  &lt;code&gt;Accountant&lt;/code&gt;           
-  &lt;sup&gt;56,000&lt;/sup&gt;
-  &lt;var&gt;Female&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot;&gt;1230 North Ave. Dallas, Texas 98551&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0002&lt;/em&gt;
-  &lt;strong&gt;Martha RaynoldsThis is a CDATASection with EntityReference number 2 &amp;amp;ent2;
-This is an adjacent CDATASection with a reference to a tab &amp;amp;tab;&lt;/strong&gt;
-  &lt;code&gt;Secretary&lt;/code&gt;
-  &lt;sup&gt;35,000&lt;/sup&gt;
-  &lt;var&gt;Female&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot; class=&quot;Yes&quot;&gt;&amp;beta; Dallas, &amp;gamma;
- 98554&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0003&lt;/em&gt;
-  &lt;strong&gt;Roger
- Jones&lt;/strong&gt;
-  &lt;code&gt;Department Manager&lt;/code&gt;
-  &lt;sup&gt;100,000&lt;/sup&gt;
-  &lt;var&gt;&amp;delta;&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot; class=&quot;No&quot;&gt;PO Box 27 Irving, texas 98553&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0004&lt;/em&gt;
-  &lt;strong&gt;Jeny Oconnor&lt;/strong&gt;
-  &lt;code&gt;Personnel Director&lt;/code&gt;
-  &lt;sup&gt;95,000&lt;/sup&gt;
-  &lt;var&gt;Female&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot; class=&quot;Y&amp;alpha;&quot;&gt;27 South Road. Dallas, Texas 98556&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0005&lt;/em&gt;
-  &lt;strong&gt;Robert Myers&lt;/strong&gt;
-  &lt;code&gt;Computer Specialist&lt;/code&gt;
-  &lt;sup&gt;90,000&lt;/sup&gt;
-  &lt;var&gt;male&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot;&gt;1821 Nordic. Road, Irving Texas 98558&lt;/acronym&gt;
- &lt;/p&gt;
-&lt;/body&gt;&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsdomxhtmllevel2corehc_namednodemapinvalidtype1expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-Test        http://www.w3.org/2001/DOM-Test-Suite/level2/core/hc_namednodemapinvalidtype1
-Status        Success
</del></span></pre></div>
<a id="trunkLayoutTestsdomxhtmllevel2corehc_namednodemapinvalidtype1xhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-&lt;?xml version=&quot;1.0&quot;?&gt;&lt;?TEST-STYLE PIDATA?&gt;
-&lt;!DOCTYPE html
-   PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
-   &quot;xhtml1-strict.dtd&quot; [
-   &lt;!ENTITY alpha &quot;&amp;#945;&quot;&gt;
-   &lt;!ENTITY beta &quot;&amp;#946;&quot;&gt;
-   &lt;!ENTITY gamma &quot;&amp;#947;&quot;&gt;
-   &lt;!ENTITY delta &quot;&amp;#948;&quot;&gt;
-   &lt;!ENTITY epsilon &quot;&amp;#949;&quot;&gt;
-   &lt;!ENTITY alpha &quot;&amp;#950;&quot;&gt;
-   &lt;!NOTATION notation1 PUBLIC &quot;notation1File&quot;&gt;
-   &lt;!NOTATION notation2 SYSTEM &quot;notation2File&quot;&gt;
-   &lt;!ATTLIST acronym dir CDATA &quot;ltr&quot;&gt;
-]&gt;
-&lt;!-- This is comment number 1.--&gt;
-&lt;html xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;head&gt;&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;/&gt;&lt;title&gt;hc_staff&lt;/title&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;selfxhtml.js&quot;/&gt;&lt;script charset=&quot;UTF-8&quot; type=&quot;text/javascript&quot; src=&quot;hc_namednodemapinvalidtype1.js&quot;/&gt;&lt;script type='text/javascript'&gt;function loadComplete() { startTest(); }&lt;/script&gt;&lt;/head&gt;&lt;body onload=&quot;loadComplete()&quot;&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0001&lt;/em&gt;
-  &lt;strong&gt;Margaret Martin&lt;/strong&gt;
-  &lt;code&gt;Accountant&lt;/code&gt;           
-  &lt;sup&gt;56,000&lt;/sup&gt;
-  &lt;var&gt;Female&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot;&gt;1230 North Ave. Dallas, Texas 98551&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0002&lt;/em&gt;
-  &lt;strong&gt;Martha RaynoldsThis is a CDATASection with EntityReference number 2 &amp;amp;ent2;
-This is an adjacent CDATASection with a reference to a tab &amp;amp;tab;&lt;/strong&gt;
-  &lt;code&gt;Secretary&lt;/code&gt;
-  &lt;sup&gt;35,000&lt;/sup&gt;
-  &lt;var&gt;Female&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot; class=&quot;Yes&quot;&gt;&amp;beta; Dallas, &amp;gamma;
- 98554&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0003&lt;/em&gt;
-  &lt;strong&gt;Roger
- Jones&lt;/strong&gt;
-  &lt;code&gt;Department Manager&lt;/code&gt;
-  &lt;sup&gt;100,000&lt;/sup&gt;
-  &lt;var&gt;&amp;delta;&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot; class=&quot;No&quot;&gt;PO Box 27 Irving, texas 98553&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0004&lt;/em&gt;
-  &lt;strong&gt;Jeny Oconnor&lt;/strong&gt;
-  &lt;code&gt;Personnel Director&lt;/code&gt;
-  &lt;sup&gt;95,000&lt;/sup&gt;
-  &lt;var&gt;Female&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot; class=&quot;Y&amp;alpha;&quot;&gt;27 South Road. Dallas, Texas 98556&lt;/acronym&gt;
- &lt;/p&gt;
- &lt;p&gt;
-  &lt;em&gt;EMP0005&lt;/em&gt;
-  &lt;strong&gt;Robert Myers&lt;/strong&gt;
-  &lt;code&gt;Computer Specialist&lt;/code&gt;
-  &lt;sup&gt;90,000&lt;/sup&gt;
-  &lt;var&gt;male&lt;/var&gt;
-  &lt;acronym title=&quot;Yes&quot;&gt;1821 Nordic. Road, Irving Texas 98558&lt;/acronym&gt;
- &lt;/p&gt;
-&lt;/body&gt;&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomNamedNodeMapparametersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/NamedNodeMap-parameters-expected.txt (0 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/NamedNodeMap-parameters-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/NamedNodeMap-parameters-expected.txt        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Tests related to parameters of the NamedNodeMap API
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS namedNodeMap.__proto__ is NamedNodeMap.prototype
+
+* Not enough parameters
+PASS namedNodeMap.getNamedItem() threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.setNamedItem() threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.removeNamedItem() threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.item() threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.getNamedItemNS() threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.getNamedItemNS(null) threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.setNamedItemNS() threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.removeNamedItemNS() threw exception TypeError: Not enough arguments.
+PASS namedNodeMap.removeNamedItemNS(null) threw exception TypeError: Not enough arguments.
+
+* Wrong parameter type
+PASS namedNodeMap.setNamedItem(notAnAttr) threw exception TypeError: Argument 1 ('attr') to NamedNodeMap.setNamedItem must be an instance of Attr.
+PASS namedNodeMap.setNamedItemNS(notAnAttr) threw exception TypeError: Argument 1 ('attr') to NamedNodeMap.setNamedItemNS must be an instance of Attr.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomNamedNodeMapparametershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/NamedNodeMap-parameters.html (0 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/NamedNodeMap-parameters.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/NamedNodeMap-parameters.html        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -0,0 +1,32 @@
</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(&quot;Tests related to parameters of the NamedNodeMap API&quot;);
+
+var namedNodeMap = document.body.attributes;
+shouldBe(&quot;namedNodeMap.__proto__&quot;, &quot;NamedNodeMap.prototype&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;* Not enough parameters&quot;);
+shouldThrow(&quot;namedNodeMap.getNamedItem()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.setNamedItem()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.removeNamedItem()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.item()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.getNamedItemNS()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.getNamedItemNS(null)&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.setNamedItemNS()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.removeNamedItemNS()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+shouldThrow(&quot;namedNodeMap.removeNamedItemNS(null)&quot;, &quot;'TypeError: Not enough arguments'&quot;);
+
+debug(&quot;&quot;);
+debug(&quot;* Wrong parameter type&quot;);
+var notAnAttr = document.body;
+shouldThrow(&quot;namedNodeMap.setNamedItem(notAnAttr)&quot;, &quot;'TypeError: Argument 1 (\\'attr\\') to NamedNodeMap.setNamedItem must be an instance of Attr'&quot;);
+shouldThrow(&quot;namedNodeMap.setNamedItemNS(notAnAttr)&quot;, &quot;'TypeError: Argument 1 (\\'attr\\') to NamedNodeMap.setNamedItemNS must be an instance of Attr'&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomNamedNodeMapsetNamedItemcrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,2 +1,2 @@
</span><del>-CONSOLE MESSAGE: line 7: TypeError: Argument 1 ('node') to NamedNodeMap.setNamedItem must be an instance of Node
</del><ins>+CONSOLE MESSAGE: line 7: TypeError: Argument 1 ('attr') to NamedNodeMap.setNamedItem must be an instance of Attr
</ins><span class="cx"> This passes if it does not crash. (see https://bugs.webkit.org/show_bug.cgi?id=18958)
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnonnumericvaluesnumericparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> PASS nonNumericPolicy('document.createEvent(&quot;MouseEvent&quot;).initMouseEvent(&quot;a&quot;, false, false, null, 0, 0, 0, x, 0, false, false, false, false, 0, null)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('document.createEvent(&quot;MouseEvent&quot;).initMouseEvent(&quot;a&quot;, false, false, null, 0, 0, 0, 0, x, false, false, false, false, 0, null)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('document.createEvent(&quot;MouseEvent&quot;).initMouseEvent(&quot;a&quot;, false, false, null, 0, 0, 0, 0, 0, false, false, false, false, x, null)') is 'any type allowed'
</span><del>-PASS nonNumericPolicy('document.body.attributes.item(x)') is 'any type allowed'
</del><ins>+PASS nonNumericPolicy('document.body.attributes.item(x)') is 'any type allowed (but not omitted)'
</ins><span class="cx"> PASS nonNumericPolicy('document.createNodeIterator(document, x, null, false)') is 'any type allowed'
</span><span class="cx"> PASS nonNumericPolicy('document.getElementsByTagName(&quot;div&quot;).item(x)') is 'any type allowed (but not omitted)'
</span><span class="cx"> PASS nonNumericPolicy('document.createRange().setStart(document, x)') is 'any type allowed (but not omitted)'
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomscripttestsnonnumericvaluesnumericparametersjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx"> 
</span><span class="cx"> // NamedNodeMap
</span><span class="cx"> 
</span><del>-shouldBe(&quot;nonNumericPolicy('document.body.attributes.item(x)')&quot;, &quot;'any type allowed'&quot;);
</del><ins>+shouldBe(&quot;nonNumericPolicy('document.body.attributes.item(x)')&quot;, &quot;'any type allowed (but not omitted)'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> // NodeIterator
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-07-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Align NamedNodeMap with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=160204
+
+        Reviewed by Darin Adler.
+
+        Rebaseline W3C test now that more checks are passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+
</ins><span class="cx"> 2016-07-26  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r203719.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -939,13 +939,13 @@
</span><span class="cx"> PASS NamedNodeMap interface: existence and properties of interface prototype object 
</span><span class="cx"> PASS NamedNodeMap interface: existence and properties of interface prototype object's &quot;constructor&quot; property 
</span><span class="cx"> PASS NamedNodeMap interface: attribute length 
</span><del>-FAIL NamedNodeMap interface: operation item(unsigned long) assert_equals: property has wrong .length expected 1 but got 0
-FAIL NamedNodeMap interface: operation getNamedItem(DOMString) assert_equals: property has wrong .length expected 1 but got 0
-FAIL NamedNodeMap interface: operation getNamedItemNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0
</del><ins>+PASS NamedNodeMap interface: operation item(unsigned long) 
+PASS NamedNodeMap interface: operation getNamedItem(DOMString) 
+PASS NamedNodeMap interface: operation getNamedItemNS(DOMString,DOMString) 
</ins><span class="cx"> PASS NamedNodeMap interface: operation setNamedItem(Attr) 
</span><span class="cx"> PASS NamedNodeMap interface: operation setNamedItemNS(Attr) 
</span><del>-FAIL NamedNodeMap interface: operation removeNamedItem(DOMString) assert_equals: property has wrong .length expected 1 but got 0
-FAIL NamedNodeMap interface: operation removeNamedItemNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0
</del><ins>+PASS NamedNodeMap interface: operation removeNamedItem(DOMString) 
+PASS NamedNodeMap interface: operation removeNamedItemNS(DOMString,DOMString) 
</ins><span class="cx"> FAIL Attr interface: existence and properties of interface object assert_equals: prototype of self's property &quot;Attr&quot; is not Function.prototype expected function &quot;function () {
</span><span class="cx">     [native code]
</span><span class="cx"> }&quot; but got function &quot;function Node() {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/Source/WebCore/ChangeLog        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-07-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Align NamedNodeMap with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=160204
+
+        Reviewed by Darin Adler.
+
+        Align NamedNodeMap with the specification:
+        - https://dom.spec.whatwg.org/#interface-namednodemap
+
+        In particular, mark parameters as mandatory when they should be, and
+        use tighter &quot;Attr&quot; typing instead of Node.
+
+        Chrome and Firefox agree with the specification.
+
+        Test: fast/dom/NamedNodeMap-parameters.html
+
+        * dom/NamedNodeMap.cpp:
+        (WebCore::NamedNodeMap::getNamedItem):
+        (WebCore::NamedNodeMap::getNamedItemNS):
+        (WebCore::NamedNodeMap::removeNamedItem):
+        (WebCore::NamedNodeMap::removeNamedItemNS):
+        (WebCore::NamedNodeMap::setNamedItem):
+        (WebCore::NamedNodeMap::item):
+        * dom/NamedNodeMap.h:
+        * dom/NamedNodeMap.idl:
+
</ins><span class="cx"> 2016-07-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Infinite Canvas context save() causes WebKit to crash
</span></span></pre></div>
<a id="trunkSourceWebCoredomNamedNodeMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NamedNodeMap.cpp (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NamedNodeMap.cpp        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/Source/WebCore/dom/NamedNodeMap.cpp        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -43,17 +43,17 @@
</span><span class="cx">     m_element.deref();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Node&gt; NamedNodeMap::getNamedItem(const AtomicString&amp; name) const
</del><ins>+RefPtr&lt;Attr&gt; NamedNodeMap::getNamedItem(const AtomicString&amp; name) const
</ins><span class="cx"> {
</span><span class="cx">     return m_element.getAttributeNode(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Node&gt; NamedNodeMap::getNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName) const
</del><ins>+RefPtr&lt;Attr&gt; NamedNodeMap::getNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName) const
</ins><span class="cx"> {
</span><span class="cx">     return m_element.getAttributeNodeNS(namespaceURI, localName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Node&gt; NamedNodeMap::removeNamedItem(const AtomicString&amp; name, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;Attr&gt; NamedNodeMap::removeNamedItem(const AtomicString&amp; name, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     unsigned index = m_element.hasAttributes() ? m_element.findAttributeIndexByName(name, shouldIgnoreAttributeCase(m_element)) : ElementData::attributeNotFound;
</span><span class="cx">     if (index == ElementData::attributeNotFound) {
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     return Vector&lt;AtomicString&gt;();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Node&gt; NamedNodeMap::removeNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;Attr&gt; NamedNodeMap::removeNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     unsigned index = m_element.hasAttributes() ? m_element.findAttributeIndexByName(QualifiedName(nullAtom, localName, namespaceURI)) : ElementData::attributeNotFound;
</span><span class="cx">     if (index == ElementData::attributeNotFound) {
</span><span class="lines">@@ -79,24 +79,22 @@
</span><span class="cx">     return m_element.detachAttribute(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Node&gt; NamedNodeMap::setNamedItem(Node&amp; node, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;Attr&gt; NamedNodeMap::setNamedItem(Attr&amp; attr, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    // Not mentioned in spec: throw a HIERARCHY_REQUEST_ERROR if the user passes in a non-attribute node
</del><ins>+    return m_element.setAttributeNode(attr, ec);
+}
+
+RefPtr&lt;Attr&gt; NamedNodeMap::setNamedItem(Node&amp; node, ExceptionCode&amp; ec)
+{
</ins><span class="cx">     if (!is&lt;Attr&gt;(node)) {
</span><del>-        ec = HIERARCHY_REQUEST_ERR;
</del><ins>+        ec = TypeError;
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-
-    return m_element.setAttributeNode(downcast&lt;Attr&gt;(node), ec);
</del><ins>+    return setNamedItem(downcast&lt;Attr&gt;(node), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Node&gt; NamedNodeMap::setNamedItemNS(Node&amp; node, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;Attr&gt; NamedNodeMap::item(unsigned index) const
</ins><span class="cx"> {
</span><del>-    return setNamedItem(node, ec);
-}
-
-RefPtr&lt;Node&gt; NamedNodeMap::item(unsigned index) const
-{
</del><span class="cx">     if (index &gt;= length())
</span><span class="cx">         return 0;
</span><span class="cx">     return m_element.ensureAttr(m_element.attributeAt(index).name());
</span></span></pre></div>
<a id="trunkSourceWebCoredomNamedNodeMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NamedNodeMap.h (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NamedNodeMap.h        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/Source/WebCore/dom/NamedNodeMap.h        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #ifndef NamedNodeMap_h
</span><span class="cx"> #define NamedNodeMap_h
</span><span class="cx"> 
</span><ins>+#include &quot;Attr.h&quot;
</ins><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="lines">@@ -31,7 +32,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class Node;
</del><span class="cx"> class Element;
</span><span class="cx"> 
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="lines">@@ -51,17 +51,17 @@
</span><span class="cx"> 
</span><span class="cx">     // Public DOM interface.
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Node&gt; getNamedItem(const AtomicString&amp;) const;
-    RefPtr&lt;Node&gt; removeNamedItem(const AtomicString&amp; name, ExceptionCode&amp;);
</del><ins>+    RefPtr&lt;Attr&gt; getNamedItem(const AtomicString&amp;) const;
+    RefPtr&lt;Attr&gt; removeNamedItem(const AtomicString&amp; name, ExceptionCode&amp;);
</ins><span class="cx">     Vector&lt;AtomicString&gt; supportedPropertyNames();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Node&gt; getNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName) const;
-    RefPtr&lt;Node&gt; removeNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName, ExceptionCode&amp;);
</del><ins>+    RefPtr&lt;Attr&gt; getNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName) const;
+    RefPtr&lt;Attr&gt; removeNamedItemNS(const AtomicString&amp; namespaceURI, const AtomicString&amp; localName, ExceptionCode&amp;);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;Node&gt; setNamedItem(Node&amp;, ExceptionCode&amp;);
-    RefPtr&lt;Node&gt; setNamedItemNS(Node&amp;, ExceptionCode&amp;);
</del><ins>+    RefPtr&lt;Attr&gt; setNamedItem(Attr&amp;, ExceptionCode&amp;);
+    RefPtr&lt;Attr&gt; setNamedItem(Node&amp;, ExceptionCode&amp;); // for legacy bindings.
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;Node&gt; item(unsigned index) const;
</del><ins>+    RefPtr&lt;Attr&gt; item(unsigned index) const;
</ins><span class="cx">     unsigned length() const;
</span><span class="cx"> 
</span><span class="cx">     Element&amp; element() const { return m_element; }
</span></span></pre></div>
<a id="trunkSourceWebCoredomNamedNodeMapidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NamedNodeMap.idl (203730 => 203731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NamedNodeMap.idl        2016-07-26 18:58:41 UTC (rev 203730)
+++ trunk/Source/WebCore/dom/NamedNodeMap.idl        2016-07-26 19:09:53 UTC (rev 203731)
</span><span class="lines">@@ -22,18 +22,23 @@
</span><span class="cx">     GenerateIsReachable=ImplElementRoot,
</span><span class="cx">     ImplementationLacksVTable,
</span><span class="cx"> ] interface NamedNodeMap {
</span><del>-
-    // FIXME: Using &quot;undefined&quot; as default parameter value is wrong.
-    getter Node getNamedItem(optional DOMString name = &quot;undefined&quot;);
-    [RaisesException] Node setNamedItem(Node node);
-    [RaisesException] Node removeNamedItem(optional DOMString name = &quot;undefined&quot;);
-    getter Node item(optional unsigned long index = 0);
</del><span class="cx">     readonly attribute unsigned long length;
</span><span class="cx"> 
</span><del>-    // Introduced in DOM Level 2:
-
-    // FIXME: Using &quot;undefined&quot; as default parameter value is wrong.
-    [ObjCLegacyUnnamedParameters] Node getNamedItemNS(optional DOMString? namespaceURI = null, optional DOMString localName = &quot;undefined&quot;);
-    [RaisesException] Node setNamedItemNS(Node node);
-    [ObjCLegacyUnnamedParameters, RaisesException] Node removeNamedItemNS(optional DOMString? namespaceURI = null, optional DOMString localName = &quot;undefined&quot;);
</del><ins>+#if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
+    getter Attr? getNamedItem(DOMString name);
+    [RaisesException] Attr? setNamedItem(Attr attr);
+    [RaisesException] Attr removeNamedItem(DOMString name);
+    getter Attr? item(unsigned long index);
+    Attr? getNamedItemNS(DOMString? namespaceURI, DOMString localName);
+    [RaisesException, ImplementedAs=setNamedItem] Attr? setNamedItemNS(Attr attr);
+    [RaisesException] Attr removeNamedItemNS(DOMString? namespaceURI, DOMString localName);
+#else
+    getter Node? getNamedItem(DOMString name);
+    [RaisesException] Node? setNamedItem(Node node);
+    [RaisesException] Node removeNamedItem(DOMString name);
+    getter Node? item(unsigned long index);
+    [ObjCLegacyUnnamedParameters] Node? getNamedItemNS(DOMString? namespaceURI, DOMString localName);
+    [RaisesException, ImplementedAs=setNamedItem] Node? setNamedItemNS(Node node);
+    [ObjCLegacyUnnamedParameters, RaisesException] Node removeNamedItemNS(DOMString? namespaceURI, DOMString localName);
+#endif
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>