<!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>[200619] 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/200619">200619</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-05-10 02:47:44 -0700 (Tue, 10 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>NodeList should be iterable
https://bugs.webkit.org/show_bug.cgi?id=131443
&lt;rdar://problem/25731519&gt;

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/dom/nodeListIterator.html

Updating JSKeyValueIterator to support map and set iterators,
depending on the signature of the result type of DOMClass::Iterator::next method.
Symbol.iterator method is made the same as values method for set iterators.

Adding support for NodeList.
Updating FontFaceSet to take benefit of that.

* bindings/js/JSDOMBinding.h:
(WebCore::jsPair):.
* bindings/js/JSKeyValueIterator.h:
(WebCore::IteratorInspector::decltype): IteratorInspector detects whether the iterator is a set or map iterator.
(WebCore::IteratorInspector::test):
(WebCore::fillForEachArgumentsWithIteratorValue): Specializing according set/map iterator.
(WebCore::iteratorValueToJS): Ditto.
(WebCore::keyValueIteratorForEach):
(WebCore::JSKeyValueIterator&lt;JSWrapper&gt;::next):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementationIterableFunctions): Removed the line forbidding set iterators.
Making Symbol.iterator function equal to values for set iterators.
* bindings/scripts/test/JS/JSTestNode.cpp: Rebasing with set iterator functions.
* bindings/scripts/test/JS/JSTestObj.cpp: Rebasing according updated function names.
* bindings/scripts/test/TestNode.idl: Making TestNode set iterable.
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next): Refactoring to make it a set iterator.
* css/FontFaceSet.h:
* css/FontFaceSet.idl:
* dom/NodeList.h: Making NodeList iterable.
(WebCore::NodeList::Iterator::Iterator):
(WebCore::NodeList::Iterator::next):
(WebCore::NodeList::createIterator):
* dom/NodeList.idl:

LayoutTests:

* fast/dom/domListEnumeration-expected.txt:
* fast/dom/nodeListIterator-expected.txt: Added.
* fast/dom/nodeListIterator.html: Added.
* fast/dom/script-tests/domListEnumeration.js:
* fast/text/font-face-set-javascript-expected.txt:
* fast/text/font-face-set-javascript.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomdomListEnumerationexpectedtxt">trunk/LayoutTests/fast/dom/domListEnumeration-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomscripttestsdomListEnumerationjs">trunk/LayoutTests/fast/dom/script-tests/domListEnumeration.js</a></li>
<li><a href="#trunkLayoutTestsfasttextfontfacesetjavascriptexpectedtxt">trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasttextfontfacesetjavascripthtml">trunk/LayoutTests/fast/text/font-face-set-javascript.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMIteratorh">trunk/Source/WebCore/bindings/js/JSDOMIterator.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestNodeidl">trunk/Source/WebCore/bindings/scripts/test/TestNode.idl</a></li>
<li><a href="#trunkSourceWebCorecssFontFaceSetcpp">trunk/Source/WebCore/css/FontFaceSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssFontFaceSeth">trunk/Source/WebCore/css/FontFaceSet.h</a></li>
<li><a href="#trunkSourceWebCorecssFontFaceSetidl">trunk/Source/WebCore/css/FontFaceSet.idl</a></li>
<li><a href="#trunkSourceWebCoredomNodeListh">trunk/Source/WebCore/dom/NodeList.h</a></li>
<li><a href="#trunkSourceWebCoredomNodeListidl">trunk/Source/WebCore/dom/NodeList.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomnodeListIteratorexpectedtxt">trunk/LayoutTests/fast/dom/nodeListIterator-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnodeListIteratorhtml">trunk/LayoutTests/fast/dom/nodeListIterator.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/LayoutTests/ChangeLog        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-05-10  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        NodeList should be iterable
+        https://bugs.webkit.org/show_bug.cgi?id=131443
+        &lt;rdar://problem/25731519&gt;
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/domListEnumeration-expected.txt:
+        * fast/dom/nodeListIterator-expected.txt: Added.
+        * fast/dom/nodeListIterator.html: Added.
+        * fast/dom/script-tests/domListEnumeration.js:
+        * fast/text/font-face-set-javascript-expected.txt:
+        * fast/text/font-face-set-javascript.html:
+
</ins><span class="cx"> 2016-05-09  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Implement auto-repeat computation
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomdomListEnumerationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/domListEnumeration-expected.txt (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/domListEnumeration-expected.txt        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/LayoutTests/fast/dom/domListEnumeration-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> [object NodeList]
</span><del>-PASS resultArray.length is 11
</del><ins>+PASS resultArray.length is 15
</ins><span class="cx"> PASS resultArray[0].i is '0'
</span><span class="cx"> PASS resultArray[0].item is nodeList.item(0)
</span><span class="cx"> PASS resultArray[1].i is '1'
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnodeListIteratorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/nodeListIterator-expected.txt (0 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/nodeListIterator-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/nodeListIterator-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+Testing of NodeList iterable capacities.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS nodeList.length is 2
+PASS item is children[index++]
+PASS item is children[index++]
+PASS pair[0] is children[0]
+PASS pair[1] is children[1]
+PASS forEachContainer is nodeList
+FAIL forEachIndex should be 0 (of type number). Was [object HTMLDivElement] (of type object).
+PASS node is children[index++]
+PASS forEachContainer is nodeList
+FAIL forEachIndex should be 1 (of type number). Was [object HTMLOListElement] (of type object).
+PASS node is children[index++]
+PASS iterator.next().value is children[0]
+PASS iterator.next().value is children[1]
+PASS end.done is true
+PASS end.value is undefined
+PASS iterator.next().value is children[0]
+PASS iterator.next().value is children[1]
+PASS end.done is true
+PASS end.value is undefined
+PASS pair.length is 2
+FAIL pair[0] should be 0 (of type number). Was [object HTMLDivElement] (of type object).
+PASS pair[1] is children[0]
+PASS pair.length is 2
+FAIL pair[0] should be 1 (of type number). Was [object HTMLOListElement] (of type object).
+PASS pair[1] is children[1]
+PASS end.done is true
+PASS end.value is undefined
+FAIL end.done should be true. Was false.
+FAIL end.value should be undefined (of type undefined). Was [object HTMLParagraphElement],[object HTMLParagraphElement] (of type object).
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnodeListIteratorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/nodeListIterator.html (0 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/nodeListIterator.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/nodeListIterator.html        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body&gt;
+        &lt;script&gt;
+            description('Testing of NodeList iterable capacities.');
+
+            if (window.testRunner)
+                testRunner.dumpAsText();
+
+            var end;
+            function checkEndIterator(iteratorValue) {
+              end = iteratorValue;
+              shouldBe('end.done', 'true');
+              shouldBe('end.value', 'undefined');
+            }
+
+            var testingGround = document.createElement('div');
+            var children = [document.createElement('div'), document.createElement('ol')];
+            testingGround.appendChild(children[0]);
+            testingGround.appendChild(children[1]);
+            document.body.appendChild(testingGround);
+
+            var nodeList = testingGround.childNodes;
+
+            shouldBe(&quot;nodeList.length&quot;, &quot;2&quot;);
+
+            var index = 0;
+            for (var item of nodeList)
+                shouldBe('item', 'children[index++]');
+
+            pair = Array.from(nodeList);
+            shouldBe('pair[0]', 'children[0]');
+            shouldBe('pair[1]', 'children[1]');
+
+            index = 0;
+            var node;
+            var forEachIndex;
+            var forEachContainer;
+            nodeList.forEach(function(n, i, c) {
+                node = n;
+                forEachIndex = i;
+                forEachContainer = c;
+                shouldBe('forEachContainer', 'nodeList');
+                shouldBe('forEachIndex', 'index');
+                shouldBe('node', 'children[index++]');
+            });
+                                                                   
+            var iterator = nodeList.keys();
+            shouldBe('iterator.next().value', 'children[0]');
+            shouldBe('iterator.next().value', 'children[1]');
+            checkEndIterator(iterator.next());
+
+            var iterator = nodeList.values();
+            shouldBe('iterator.next().value', 'children[0]');
+            shouldBe('iterator.next().value', 'children[1]');
+            checkEndIterator(iterator.next());
+
+            var iterator = nodeList.entries();
+            var pair = iterator.next().value;
+            shouldBe('pair.length', '2');
+            shouldBe('pair[0]', '0');
+            shouldBe('pair[1]', 'children[0]');
+            pair = iterator.next().value;
+            shouldBe('pair.length', '2');
+            shouldBe('pair[0]', '1');
+            shouldBe('pair[1]', 'children[1]');
+            checkEndIterator(iterator.next());
+
+            testingGround.appendChild(document.createElement('ul'));
+            testingGround.appendChild(document.createElement('p'));
+            checkEndIterator(iterator.next());
+
+        &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="trunkLayoutTestsfastdomscripttestsdomListEnumerationjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/script-tests/domListEnumeration.js (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/script-tests/domListEnumeration.js        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/LayoutTests/fast/dom/script-tests/domListEnumeration.js        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> var nodeList = testingGround.childNodes;
</span><span class="cx"> resultArray = iterateList(nodeList);
</span><span class="cx"> 
</span><del>-shouldBe(&quot;resultArray.length&quot;, &quot;11&quot;);
</del><ins>+shouldBe(&quot;resultArray.length&quot;, &quot;15&quot;);
</ins><span class="cx"> shouldBe(&quot;resultArray[0].i&quot;, &quot;'0'&quot;);
</span><span class="cx"> shouldBe(&quot;resultArray[0].item&quot;, &quot;nodeList.item(0)&quot;);
</span><span class="cx"> shouldBe(&quot;resultArray[1].i&quot;, &quot;'1'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextfontfacesetjavascriptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -3,8 +3,11 @@
</span><span class="cx"> PASS new FontFaceSet([fontFace1]).size is 1
</span><span class="cx"> PASS fontFaceSet.status is &quot;loaded&quot;
</span><span class="cx"> PASS item.done is false
</span><del>-PASS item.value is [fontFace1, fontFace1]
</del><ins>+PASS item.value.length is 2
+FAIL item.value[0] should be 0 (of type number). Was [object FontFace] (of type object).
+PASS item.value[1] is fontFace1
</ins><span class="cx"> PASS item.done is true
</span><ins>+PASS item.value is undefined
</ins><span class="cx"> PASS item.done is false
</span><span class="cx"> PASS item.value is fontFace1
</span><span class="cx"> PASS item.done is true
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextfontfacesetjavascripthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/font-face-set-javascript.html (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/font-face-set-javascript.html        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/LayoutTests/fast/text/font-face-set-javascript.html        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -23,9 +23,12 @@
</span><span class="cx"> var iterator = fontFaceSet.entries();
</span><span class="cx"> var item = iterator.next();
</span><span class="cx"> shouldBeFalse(&quot;item.done&quot;);
</span><del>-shouldBe(&quot;item.value&quot;, &quot;[fontFace1, fontFace1]&quot;);
</del><ins>+shouldBe(&quot;item.value.length&quot;, &quot;2&quot;);
+shouldBe(&quot;item.value[0]&quot;, &quot;0&quot;);
+shouldBe(&quot;item.value[1]&quot;, &quot;fontFace1&quot;);
</ins><span class="cx"> item = iterator.next();
</span><span class="cx"> shouldBeTrue(&quot;item.done&quot;);
</span><ins>+shouldBe(&quot;item.value&quot;, &quot;undefined&quot;);
</ins><span class="cx"> 
</span><span class="cx"> iterator = fontFaceSet.keys();
</span><span class="cx"> item = iterator.next();
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/ChangeLog        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-05-10  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        NodeList should be iterable
+        https://bugs.webkit.org/show_bug.cgi?id=131443
+        &lt;rdar://problem/25731519&gt;
+
+        Reviewed by Darin Adler.
+
+        Test: fast/dom/nodeListIterator.html
+
+        Updating JSKeyValueIterator to support map and set iterators,
+        depending on the signature of the result type of DOMClass::Iterator::next method.
+        Symbol.iterator method is made the same as values method for set iterators.
+
+        Adding support for NodeList.
+        Updating FontFaceSet to take benefit of that. 
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::jsPair):.
+        * bindings/js/JSKeyValueIterator.h:
+        (WebCore::IteratorInspector::decltype): IteratorInspector detects whether the iterator is a set or map iterator.
+        (WebCore::IteratorInspector::test):
+        (WebCore::fillForEachArgumentsWithIteratorValue): Specializing according set/map iterator.
+        (WebCore::iteratorValueToJS): Ditto.
+        (WebCore::keyValueIteratorForEach):
+        (WebCore::JSKeyValueIterator&lt;JSWrapper&gt;::next):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementationIterableFunctions): Removed the line forbidding set iterators.
+        Making Symbol.iterator function equal to values for set iterators.
+        * bindings/scripts/test/JS/JSTestNode.cpp: Rebasing with set iterator functions.
+        * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing according updated function names.
+        * bindings/scripts/test/TestNode.idl: Making TestNode set iterable.
+        * css/FontFaceSet.cpp:
+        (WebCore::FontFaceSet::Iterator::next): Refactoring to make it a set iterator.
+        * css/FontFaceSet.h:
+        * css/FontFaceSet.idl:
+        * dom/NodeList.h: Making NodeList iterable.
+        (WebCore::NodeList::Iterator::Iterator):
+        (WebCore::NodeList::Iterator::next):
+        (WebCore::NodeList::createIterator):
+        * dom/NodeList.idl:
+
</ins><span class="cx"> 2016-05-09  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid] Implement auto-repeat computation
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -266,7 +266,8 @@
</span><span class="cx"> template&lt;typename T, size_t inlineCapacity&gt; JSC::JSValue jsArray(JSC::ExecState*, JSDOMGlobalObject*, const Vector&lt;T, inlineCapacity&gt;*);
</span><span class="cx"> WEBCORE_EXPORT JSC::JSValue jsArray(JSC::ExecState*, JSDOMGlobalObject*, PassRefPtr&lt;DOMStringList&gt;);
</span><span class="cx"> 
</span><del>-template&lt;typename Value1, typename Value2&gt; JSC::JSValue jsPair(JSC::ExecState&amp;, JSDOMGlobalObject*, const Value1&amp;, const Value2&amp;);
</del><ins>+JSC::JSValue jsPair(JSC::ExecState&amp;, JSDOMGlobalObject*, JSC::JSValue, JSC::JSValue);
+template&lt;typename FirstType, typename SecondType&gt; JSC::JSValue jsPair(JSC::ExecState&amp;, JSDOMGlobalObject*, const FirstType&amp;, const SecondType&amp;);
</ins><span class="cx"> 
</span><span class="cx"> RefPtr&lt;JSC::ArrayBufferView&gt; toArrayBufferView(JSC::JSValue);
</span><span class="cx"> RefPtr&lt;JSC::Int8Array&gt; toInt8Array(JSC::JSValue);
</span><span class="lines">@@ -635,14 +636,19 @@
</span><span class="cx">     return jsArray(exec, globalObject, *vector);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename Value1, typename Value2&gt; inline JSC::JSValue jsPair(JSC::ExecState&amp; state, JSDOMGlobalObject* globalObject, const Value1&amp; value1, const Value2&amp; value2)
</del><ins>+inline JSC::JSValue jsPair(JSC::ExecState&amp; state, JSDOMGlobalObject* globalObject, JSC::JSValue value1, JSC::JSValue value2)
</ins><span class="cx"> {
</span><span class="cx">     JSC::MarkedArgumentBuffer args;
</span><del>-    args.append(toJS(&amp;state, globalObject, value1));
-    args.append(toJS(&amp;state, globalObject, value2));
</del><ins>+    args.append(value1);
+    args.append(value2);
</ins><span class="cx">     return constructArray(&amp;state, 0, globalObject, args);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename FirstType, typename SecondType&gt; inline JSC::JSValue jsPair(JSC::ExecState&amp; state, JSDOMGlobalObject* globalObject, const FirstType&amp; value1, const SecondType&amp; value2)
+{
+    return jsPair(state, globalObject, toJS(&amp;state, globalObject, value1), toJS(&amp;state, globalObject, value2));
+}
+
</ins><span class="cx"> inline RefPtr&lt;JSC::ArrayBufferView&gt; toArrayBufferView(JSC::JSValue value)
</span><span class="cx"> {
</span><span class="cx">     auto* wrapper = JSC::jsDynamicCast&lt;JSC::JSArrayBufferView*&gt;(value);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMIterator.h (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMIterator.h        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/bindings/js/JSDOMIterator.h        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -60,6 +60,16 @@
</span><span class="cx">     void finishCreation(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;typename IteratorValue&gt;
+class IteratorInspector {
+private:
+    template&lt;typename T&gt; static constexpr auto test(int) -&gt; decltype(std::declval&lt;T&gt;()-&gt;key, std::declval&lt;T&gt;()-&gt;value, bool()) { return true; }
+    template&lt;typename T&gt; static constexpr bool test(...) { return false; }
+public:
+    static constexpr bool isMap = test&lt;IteratorValue&gt;(0);
+    static constexpr bool isSet = !isMap;
+};
+
</ins><span class="cx"> enum class IterationKind { Key, Value, KeyValue };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><span class="lines">@@ -105,7 +115,12 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><del>-JSC::EncodedJSValue createKeyValueIterator(JSC::ExecState&amp; state, IterationKind kind, const char* propertyName)
</del><ins>+JSC::EncodedJSValue iteratorCreate(JSC::ExecState&amp;, IterationKind, const char*);
+template&lt;typename JSWrapper&gt;
+JSC::EncodedJSValue iteratorForEach(JSC::ExecState&amp;, const char*);
+
+template&lt;typename JSWrapper&gt;
+JSC::EncodedJSValue iteratorCreate(JSC::ExecState&amp; state, IterationKind kind, const char* propertyName)
</ins><span class="cx"> {
</span><span class="cx">     auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
</span><span class="cx">     if (UNLIKELY(!wrapper))
</span><span class="lines">@@ -114,8 +129,47 @@
</span><span class="cx">     return JSC::JSValue::encode(JSDOMIterator&lt;JSWrapper&gt;::create(globalObject.vm(), getDOMStructure&lt;JSDOMIterator&lt;JSWrapper&gt;&gt;(globalObject.vm(), globalObject), *wrapper, kind));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename IteratorValue&gt; typename std::enable_if&lt;IteratorInspector&lt;IteratorValue&gt;::isMap, JSC::JSValue&gt;::type
+toJS(JSC::ExecState&amp; state, JSDOMGlobalObject* globalObject, IteratorValue&amp; value, IterationKind kind)
+{
+    ASSERT(value);
+    if (kind != IterationKind::KeyValue)
+        return toJS(&amp;state, globalObject, (kind == IterationKind::Key) ? value-&gt;key : value-&gt;value);
+
+    return jsPair(state, globalObject, value-&gt;key, value-&gt;value);
+}
+
+template&lt;typename IteratorValue&gt; typename std::enable_if&lt;IteratorInspector&lt;IteratorValue&gt;::isSet, JSC::JSValue&gt;::type
+toJS(JSC::ExecState&amp; state, JSDOMGlobalObject* globalObject, IteratorValue&amp; value, IterationKind kind)
+{
+    ASSERT(value);
+    JSC::JSValue result = toJS(&amp;state, globalObject, *value);
+    if (kind != IterationKind::KeyValue)
+        return result;
+
+    // FIXME: first pair value should be the index of result.
+    return jsPair(state, globalObject, result, result);
+}
+
+template&lt;typename IteratorValue&gt; typename std::enable_if&lt;IteratorInspector&lt;IteratorValue&gt;::isMap, void&gt;::type
+appendForEachArguments(JSC::ExecState&amp; state, JSDOMGlobalObject* globalObject, JSC::MarkedArgumentBuffer&amp; arguments, IteratorValue&amp; value)
+{
+    ASSERT(value);
+    arguments.append(toJS(&amp;state, globalObject, value-&gt;value));
+    arguments.append(toJS(&amp;state, globalObject, value-&gt;key));
+}
+
+template&lt;typename IteratorValue&gt; typename std::enable_if&lt;IteratorInspector&lt;IteratorValue&gt;::isSet, void&gt;::type
+appendForEachArguments(JSC::ExecState&amp; state, JSDOMGlobalObject* globalObject, JSC::MarkedArgumentBuffer&amp; arguments, IteratorValue&amp; value)
+{
+    ASSERT(value);
+    JSC::JSValue argument = toJS(&amp;state, globalObject, *value);
+    arguments.append(argument);
+    arguments.append(argument);
+}
+
</ins><span class="cx"> template&lt;typename JSWrapper&gt;
</span><del>-JSC::EncodedJSValue keyValueIteratorForEach(JSC::ExecState&amp; state, const char* propertyName)
</del><ins>+JSC::EncodedJSValue iteratorForEach(JSC::ExecState&amp; state, const char* propertyName)
</ins><span class="cx"> {
</span><span class="cx">     auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
</span><span class="cx">     if (UNLIKELY(!wrapper))
</span><span class="lines">@@ -129,8 +183,7 @@
</span><span class="cx">     auto iterator = wrapper-&gt;wrapped().createIterator();
</span><span class="cx">     while (auto value = iterator.next()) {
</span><span class="cx">         JSC::MarkedArgumentBuffer arguments;
</span><del>-        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), value.value().value));
-        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), value.value().key));
</del><ins>+        appendForEachArguments(state, wrapper-&gt;globalObject(), arguments, value);
</ins><span class="cx">         arguments.append(wrapper);
</span><span class="cx">         JSC::call(&amp;state, state.argument(0), callType, callData, wrapper, arguments);
</span><span class="cx">         if (state.hadException())
</span><span class="lines">@@ -152,16 +205,7 @@
</span><span class="cx">     auto iteratorValue = m_iterator.next();
</span><span class="cx">     if (!iteratorValue)
</span><span class="cx">         return createIteratorResultObject(&amp;state, JSC::jsUndefined(), true);
</span><del>-
-    JSC::JSValue value;
-    if (m_kind == IterationKind::Value)
-        value = toJS(&amp;state, globalObject(), iteratorValue.value().value);
-    else if (m_kind == IterationKind::Key)
-        value = toJS(&amp;state, globalObject(), iteratorValue.value().key);
-    else
-        value = jsPair(state, globalObject(), iteratorValue.value().key, iteratorValue.value().value);
-
-    return createIteratorResultObject(&amp;state, value, false);
</del><ins>+    return createIteratorResultObject(&amp;state, toJS(state, globalObject(), iteratorValue, m_kind), false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -4208,10 +4208,6 @@
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><span class="cx"> 
</span><del>-    if (not $interface-&gt;iterable-&gt;isKeyValue) {
-        die &quot;No support yet for set iterators&quot;;
-    }
-
</del><span class="cx">     my $interfaceName = $interface-&gt;name;
</span><span class="cx">     my $className = &quot;JS$interfaceName&quot;;
</span><span class="cx">     my $visibleInterfaceName = $codeGenerator-&gt;GetVisibleInterfaceName($interface);
</span><span class="lines">@@ -4238,10 +4234,11 @@
</span><span class="cx">             my $iterationKind = &quot;KeyValue&quot;;
</span><span class="cx">             $iterationKind = &quot;Key&quot; if $propertyName eq &quot;keys&quot;;
</span><span class="cx">             $iterationKind = &quot;Value&quot; if $propertyName eq &quot;values&quot;;
</span><ins>+            $iterationKind = &quot;Value&quot; if $propertyName eq &quot;[Symbol.Iterator]&quot; and not $interface-&gt;iterable-&gt;isKeyValue;
</ins><span class="cx">             push(@implContent,  &lt;&lt;END);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return createKeyValueIterator&lt;${className}&gt;(*state, IterationKind::${iterationKind}, &quot;${propertyName}&quot;);
</del><ins>+    return iteratorCreate&lt;${className}&gt;(*state, IterationKind::${iterationKind}, &quot;${propertyName}&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> END
</span><span class="lines">@@ -4249,7 +4246,7 @@
</span><span class="cx">             push(@implContent,  &lt;&lt;END);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return keyValueIteratorForEach&lt;${className}&gt;(*state, &quot;${propertyName}&quot;);
</del><ins>+    return iteratorForEach&lt;${className}&gt;(*state, &quot;${propertyName}&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> END
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><ins>+#include &quot;JSDOMIterator.h&quot;
</ins><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/JSString.h&gt;
</span><span class="lines">@@ -33,6 +34,14 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionSymbolIterator(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionEntries(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionKeys(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionValues(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionForEach(JSC::ExecState*);
+
</ins><span class="cx"> // Attributes
</span><span class="cx"> 
</span><span class="cx"> JSC::EncodedJSValue jsTestNodeName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="lines">@@ -94,6 +103,10 @@
</span><span class="cx"> {
</span><span class="cx">     { &quot;constructor&quot;, DontEnum, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestNodeConstructor), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestNodeConstructor) } },
</span><span class="cx">     { &quot;name&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestNodeName), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestNodeName) } },
</span><ins>+    { &quot;entries&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestNodePrototypeFunctionEntries), (intptr_t) (0) } },
+    { &quot;keys&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestNodePrototypeFunctionKeys), (intptr_t) (0) } },
+    { &quot;values&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestNodePrototypeFunctionValues), (intptr_t) (0) } },
+    { &quot;forEach&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestNodePrototypeFunctionForEach), (intptr_t) (1) } },
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSTestNodePrototype::s_info = { &quot;TestNodePrototype&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNodePrototype) };
</span><span class="lines">@@ -102,6 +115,7 @@
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     reifyStaticProperties(vm, JSTestNodePrototypeTableValues, *this);
</span><ins>+    putDirect(vm, vm.propertyNames-&gt;iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(&quot;[Symbol.Iterator]&quot;), jsTestNodePrototypeFunctionSymbolIterator), ReadOnly | DontEnum);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSTestNode::s_info = { &quot;TestNode&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNode) };
</span><span class="lines">@@ -178,6 +192,40 @@
</span><span class="cx">     return getDOMConstructor&lt;JSTestNodeConstructor&gt;(vm, *jsCast&lt;const JSDOMGlobalObject*&gt;(globalObject));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+using TestNodeIterator = JSDOMIterator&lt;JSTestNode&gt;;
+using TestNodeIteratorPrototype = JSDOMIteratorPrototype&lt;JSTestNode&gt;;
+
+template&lt;&gt;
+const JSC::ClassInfo TestNodeIterator::s_info = { &quot;TestNode Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(TestNodeIterator) };
+
+template&lt;&gt;
+const JSC::ClassInfo TestNodeIteratorPrototype::s_info = { &quot;TestNode Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(TestNodeIteratorPrototype) };
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionSymbolIterator(JSC::ExecState* state)
+{
+    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::Value, &quot;[Symbol.Iterator]&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionEntries(JSC::ExecState* state)
+{
+    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::KeyValue, &quot;entries&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionKeys(JSC::ExecState* state)
+{
+    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::Key, &quot;keys&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionValues(JSC::ExecState* state)
+{
+    return iteratorCreate&lt;JSTestNode&gt;(*state, IterationKind::Value, &quot;values&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestNodePrototypeFunctionForEach(JSC::ExecState* state)
+{
+    return iteratorForEach&lt;JSTestNode&gt;(*state, &quot;forEach&quot;);
+}
+
</ins><span class="cx"> void JSTestNode::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     auto* thisObject = jsCast&lt;JSTestNode*&gt;(cell);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -6152,27 +6152,27 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSymbolIterator(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::KeyValue, &quot;[Symbol.Iterator]&quot;);
</del><ins>+    return iteratorCreate&lt;JSTestObj&gt;(*state, IterationKind::KeyValue, &quot;[Symbol.Iterator]&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionEntries(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::KeyValue, &quot;entries&quot;);
</del><ins>+    return iteratorCreate&lt;JSTestObj&gt;(*state, IterationKind::KeyValue, &quot;entries&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionKeys(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::Key, &quot;keys&quot;);
</del><ins>+    return iteratorCreate&lt;JSTestObj&gt;(*state, IterationKind::Key, &quot;keys&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionValues(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::Value, &quot;values&quot;);
</del><ins>+    return iteratorCreate&lt;JSTestObj&gt;(*state, IterationKind::Value, &quot;values&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionForEach(JSC::ExecState* state)
</span><span class="cx"> {
</span><del>-    return keyValueIteratorForEach&lt;JSTestObj&gt;(*state, &quot;forEach&quot;);
</del><ins>+    return iteratorForEach&lt;JSTestObj&gt;(*state, &quot;forEach&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSTestObj::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestNode.idl (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestNode.idl        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/bindings/scripts/test/TestNode.idl        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -23,5 +23,7 @@
</span><span class="cx">     ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
</span><span class="cx"> ] interface TestNode : Node {
</span><span class="cx">     attribute DOMString name;
</span><ins>+
+    iterable&lt;TestNode&gt;;
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.cpp (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.cpp        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/css/FontFaceSet.cpp        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -76,12 +76,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Optional&lt;WTF::KeyValuePair&lt;RefPtr&lt;FontFace&gt;, RefPtr&lt;FontFace&gt;&gt;&gt; FontFaceSet::Iterator::next()
</del><ins>+RefPtr&lt;FontFace&gt; FontFaceSet::Iterator::next()
</ins><span class="cx"> {
</span><span class="cx">     if (m_index == m_target-&gt;size())
</span><del>-        return Nullopt;
-    RefPtr&lt;FontFace&gt; item = m_target-&gt;backing()[m_index++].wrapper();
-    return WTF::KeyValuePair&lt;RefPtr&lt;FontFace&gt;, RefPtr&lt;FontFace&gt;&gt;(item, item);
</del><ins>+        return nullptr;
+    return m_target-&gt;backing()[m_index++].wrapper();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontFaceSet::PendingPromise::PendingPromise(Promise&amp;&amp; promise)
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.h (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.h        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/css/FontFaceSet.h        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     class Iterator {
</span><span class="cx">     public:
</span><span class="cx">         explicit Iterator(FontFaceSet&amp;);
</span><del>-        Optional&lt;WTF::KeyValuePair&lt;RefPtr&lt;FontFace&gt;, RefPtr&lt;FontFace&gt;&gt;&gt; next();
</del><ins>+        RefPtr&lt;FontFace&gt; next();
</ins><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx">         Ref&lt;FontFaceSet&gt; m_target;
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSetidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.idl (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.idl        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/css/FontFaceSet.idl        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -35,8 +35,7 @@
</span><span class="cx">     boolean has(FontFace font);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We should add support for the setlike declaration.
</span><del>-    // As a first step this map iterable declaration should be changed to a set iterable.
-    iterable&lt;FontFace, FontFace&gt;;
</del><ins>+    iterable&lt;FontFace&gt;;
</ins><span class="cx"> 
</span><span class="cx">     readonly attribute long size;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeList.h (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeList.h        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/dom/NodeList.h        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -40,6 +40,17 @@
</span><span class="cx">     virtual unsigned length() const = 0;
</span><span class="cx">     virtual Node* item(unsigned index) const = 0;
</span><span class="cx"> 
</span><ins>+    class Iterator {
+    public:
+        explicit Iterator(NodeList&amp; list) : m_list(list) { }
+        Node* next() { return m_list-&gt;item(m_index++); }
+
+    private:
+        size_t m_index { 0 };
+        Ref&lt;NodeList&gt; m_list;
+    };
+    Iterator createIterator() { return Iterator(*this); }
+
</ins><span class="cx">     // Other methods (not part of DOM)
</span><span class="cx">     virtual bool isLiveNodeList() const { return false; }
</span><span class="cx">     virtual bool isChildNodeList() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeList.idl (200618 => 200619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeList.idl        2016-05-10 07:46:08 UTC (rev 200618)
+++ trunk/Source/WebCore/dom/NodeList.idl        2016-05-10 09:47:44 UTC (rev 200619)
</span><span class="lines">@@ -27,5 +27,6 @@
</span><span class="cx"> ] interface NodeList {
</span><span class="cx">     getter Node item(unsigned long index);
</span><span class="cx">     readonly attribute unsigned long length;
</span><ins>+    iterable&lt;Node&gt;;
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>