<!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>[196900] 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/196900">196900</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-02-22 00:31:14 -0800 (Mon, 22 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Binding generator should support key value iterable
https://bugs.webkit.org/show_bug.cgi?id=154413

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/headers/headers-basic-expected.txt:
* web-platform-tests/fetch/api/headers/headers-basic.html:

Source/WebCore:

Covered by added layout and binding tests.

iterable&lt;key, value&gt; in a IDL file will trigger the generation of entries, keys, values, [Symbol.iterator] and forEach methods to the prototype.
Updated FetchHeaders and FontFaceSet to use it.

IDLParser.pm parses the iterable&lt;&gt; and adds an iterable field in the interface containing the iterable information and objects for the five operations.
IDLParser.pm is cleaned up a bit to remove previous Iterator support, which does not seem to be supported.

CodeGeneratorJS.pm is updated to generate the code for the five operations, using JSKeyValueIterator. Set iterators are not yet supported.
Moved definition of Iterator Key and Value Type to binding generated JSXX class based on iterable&lt;&gt; declaration in the IDL.

Added binding test and Fetch Headers tests.

* CMakeLists.txt:
* Modules/fetch/FetchHeaders.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSFetchHeadersCustom.cpp: Removed.
* bindings/js/JSFontFaceSetCustom.cpp:
(WebCore::JSFontFaceSet::ready): Removed iterable custom methods.
* bindings/js/JSKeyValueIterator.h:
(WebCore::createKeyValueIterator):
(WebCore::keyValueIteratorForEach):
* bindings/scripts/CodeGeneratorJS.pm:
(GetFunctionName):
(PrototypeFunctionCount):
(PrototypePropertyCount):
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateImplementationFunctionCall):
(GenerateImplementationIterableFunctions):
* bindings/scripts/IDLParser.pm:
(parseOperationOrIterator):
(parseOperationOrIteratorRest):
(parseIterableRest):
(parseOptionalIterableInterface):
(applyMemberList):
(parseSpecial): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjPrototypeFunctionSymbolIterator):
(WebCore::jsTestObjPrototypeFunctionEntries):
(WebCore::jsTestObjPrototypeFunctionKeys):
(WebCore::jsTestObjPrototypeFunctionValues):
(WebCore::jsTestObjPrototypeFunctionForEach):
* bindings/scripts/test/TestObj.idl:
* css/FontFaceSet.idl:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheadersbasicexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheadersbasichtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheaderserrorsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheaderserrorshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchHeadersh">trunk/Source/WebCore/Modules/fetch/FetchHeaders.h</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchHeadersidl">trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSFontFaceSetCustomcpp">trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSKeyValueIteratorh">trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.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>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSFetchHeadersCustomcpp">trunk/Source/WebCore/bindings/js/JSFetchHeadersCustom.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-02-22  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        Binding generator should support key value iterable
+        https://bugs.webkit.org/show_bug.cgi?id=154413
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/fetch/api/headers/headers-basic-expected.txt:
+        * web-platform-tests/fetch/api/headers/headers-basic.html:
+
</ins><span class="cx"> 2016-02-21  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rebaseline html/dom/interfaces.html.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheadersbasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic-expected.txt (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic-expected.txt        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic-expected.txt        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -15,4 +15,6 @@
</span><span class="cx"> PASS Check keys method 
</span><span class="cx"> PASS Check values method 
</span><span class="cx"> PASS Check entries method 
</span><ins>+PASS Check Symbol.iterator method 
+PASS Check forEach method 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheadersbasichtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -163,6 +163,33 @@
</span><span class="cx">         assert_true(actual.next().done);
</span><span class="cx">         assert_true(actual.next().done);
</span><span class="cx">       }, &quot;Check entries method&quot;);
</span><ins>+
+      test(function() {
+        var headers = new Headers(headerEntriesDict);
+        var actual = headers[Symbol.iterator]();
+
+        sortedHeaderKeys.forEach(function(key) {
+            entry = actual.next();
+            assert_false(entry.done);
+            assert_equals(entry.value[0], key);
+            assert_equals(entry.value[1], sortedHeaderDict[key]);
+        });
+        assert_true(actual.next().done);
+        assert_true(actual.next().done);
+      }, &quot;Check Symbol.iterator method&quot;);
+
+      test(function() {
+        var headers = new Headers(headerEntriesDict);
+        var reference = sortedHeaderKeys[Symbol.iterator]();
+        headers.forEach(function(value, key, container) {
+            assert_equals(headers, container);
+            entry = reference.next();
+            assert_false(entry.done);
+            assert_equals(key, entry.value);
+            assert_equals(value, sortedHeaderDict[entry.value]);
+        });
+        assert_true(reference.next().done);
+      }, &quot;Check forEach method&quot;);
</ins><span class="cx">    &lt;/script&gt;
</span><span class="cx">   &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheaderserrorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors-expected.txt (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors-expected.txt        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors-expected.txt        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -15,4 +15,6 @@
</span><span class="cx"> PASS Check headers append with an invalid name invalidÄ€ 
</span><span class="cx"> PASS Check headers append with an invalid name [object Object] 
</span><span class="cx"> PASS Check headers append with an invalid value invalidÄ€ 
</span><ins>+PASS Headers forEach throws if argument is not callable 
+PASS Headers forEach loop should stop if callback is throwing exception 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsfetchapiheadersheaderserrorshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -78,6 +78,30 @@
</span><span class="cx">           assert_throws(new TypeError() , function() { headers.append(&quot;name&quot;, value); });
</span><span class="cx">         }, &quot;Check headers append with an invalid value &quot; + value);
</span><span class="cx">       });
</span><del>-    &lt;/script&gt;
</del><ins>+
+      test(function() {
+        var headers = new Headers([[&quot;name&quot;, &quot;value&quot;]]);
+        assert_throws(new TypeError() , function() { headers.forEach(); });
+        assert_throws(new TypeError() , function() { headers.forEach(undefined); });
+        assert_throws(new TypeError() , function() { headers.forEach(1); });
+      }, &quot;Headers forEach throws if argument is not callable&quot;);
+
+      test(function() {
+        var headers = new Headers([[&quot;name1&quot;, &quot;value1&quot;], [&quot;name2&quot;, &quot;value2&quot;], [&quot;name3&quot;, &quot;value3&quot;]]);
+        var counter = 0;
+        try {
+            headers.forEach(function(value, name) {
+                counter++;
+                if (name == &quot;name2&quot;)
+                     throw &quot;error&quot;;
+            });
+        } catch (e) {
+            assert_equals(counter, 2);
+            assert_equals(e, &quot;error&quot;);
+            return;
+        }
+        assert_unreached();
+      }, &quot;Headers forEach loop should stop if callback is throwing exception&quot;);
+   &lt;/script&gt;
</ins><span class="cx">   &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -1161,7 +1161,6 @@
</span><span class="cx">     bindings/js/JSEventListener.cpp
</span><span class="cx">     bindings/js/JSEventTargetCustom.cpp
</span><span class="cx">     bindings/js/JSExceptionBase.cpp
</span><del>-    bindings/js/JSFetchHeadersCustom.cpp
</del><span class="cx">     bindings/js/JSFileReaderCustom.cpp
</span><span class="cx">     bindings/js/JSGeolocationCustom.cpp
</span><span class="cx">     bindings/js/JSHTMLAllCollectionCustom.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/ChangeLog        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -1,3 +1,58 @@
</span><ins>+2016-02-22  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        Binding generator should support key value iterable
+        https://bugs.webkit.org/show_bug.cgi?id=154413
+
+        Reviewed by Darin Adler.
+
+        Covered by added layout and binding tests.
+
+        iterable&lt;key, value&gt; in a IDL file will trigger the generation of entries, keys, values, [Symbol.iterator] and forEach methods to the prototype.
+        Updated FetchHeaders and FontFaceSet to use it.
+
+        IDLParser.pm parses the iterable&lt;&gt; and adds an iterable field in the interface containing the iterable information and objects for the five operations.
+        IDLParser.pm is cleaned up a bit to remove previous Iterator support, which does not seem to be supported.
+
+        CodeGeneratorJS.pm is updated to generate the code for the five operations, using JSKeyValueIterator. Set iterators are not yet supported.
+        Moved definition of Iterator Key and Value Type to binding generated JSXX class based on iterable&lt;&gt; declaration in the IDL.
+
+        Added binding test and Fetch Headers tests.
+
+        * CMakeLists.txt:
+        * Modules/fetch/FetchHeaders.idl:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSFetchHeadersCustom.cpp: Removed.
+        * bindings/js/JSFontFaceSetCustom.cpp:
+        (WebCore::JSFontFaceSet::ready): Removed iterable custom methods.
+        * bindings/js/JSKeyValueIterator.h:
+        (WebCore::createKeyValueIterator):
+        (WebCore::keyValueIteratorForEach):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GetFunctionName):
+        (PrototypeFunctionCount):
+        (PrototypePropertyCount):
+        (GeneratePropertiesHashTable):
+        (GenerateImplementation):
+        (GenerateImplementationFunctionCall):
+        (GenerateImplementationIterableFunctions):
+        * bindings/scripts/IDLParser.pm:
+        (parseOperationOrIterator):
+        (parseOperationOrIteratorRest):
+        (parseIterableRest):
+        (parseOptionalIterableInterface):
+        (applyMemberList):
+        (parseSpecial): Deleted.
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObjPrototype::finishCreation):
+        (WebCore::jsTestObjPrototypeFunctionSymbolIterator):
+        (WebCore::jsTestObjPrototypeFunctionEntries):
+        (WebCore::jsTestObjPrototypeFunctionKeys):
+        (WebCore::jsTestObjPrototypeFunctionValues):
+        (WebCore::jsTestObjPrototypeFunctionForEach):
+        * bindings/scripts/test/TestObj.idl:
+        * css/FontFaceSet.idl:
+
</ins><span class="cx"> 2016-02-21  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         HTMLScriptElement.crossOrigin / HTMLImageElement.crossOrigin should only return known values
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchHeadersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.h (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.h        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.h        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -65,11 +65,6 @@
</span><span class="cx">     class Iterator {
</span><span class="cx">     public:
</span><span class="cx">         explicit Iterator(FetchHeaders&amp;);
</span><del>-
-        // FIXME: Binding generator should be able to generate iterator key and value types.
-        using Key = String;
-        using Value = String;
-
</del><span class="cx">         bool next(String&amp; nextKey, String&amp; nextValue);
</span><span class="cx"> 
</span><span class="cx">     private:
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchHeadersidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -40,11 +40,7 @@
</span><span class="cx">     [RaisesException] boolean has(DOMString name);
</span><span class="cx">     [RaisesException] void set(DOMString name, DOMString value);
</span><span class="cx"> 
</span><del>-    // FIXME: Support iterable within binding generator.
-    //iterable&lt;DOMString, DOMString&gt;;
-    [Custom] any entries();
-    [Custom] any keys();
-    [Custom] any values();
</del><ins>+    iterable&lt;DOMString, DOMString&gt;;
</ins><span class="cx"> 
</span><span class="cx">     [Private, RaisesException, ImplementedAs=append] void appendFromJS(DOMString name, DOMString value);
</span><span class="cx">     [Private, RaisesException] void initializeWith(FetchHeaders headers);
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -1549,7 +1549,6 @@
</span><span class="cx">                 41D015CB0F4B5C71004A662F /* ContentType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41D015C90F4B5C71004A662F /* ContentType.cpp */; };
</span><span class="cx">                 41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41E1B1CA0FF5986900576B3B /* AbstractWorker.cpp */; };
</span><span class="cx">                 41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CB0FF5986900576B3B /* AbstractWorker.h */; };
</span><del>-                41E910A71C60FD6C007A453F /* JSFetchHeadersCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41E910A61C60FD6C007A453F /* JSFetchHeadersCustom.cpp */; };
</del><span class="cx">                 41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */; };
</span><span class="cx">                 41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */; };
</span><span class="cx">                 41F066E40F64BCF600A07EAC /* ScriptGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F066E20F64BCF600A07EAC /* ScriptGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -9022,7 +9021,6 @@
</span><span class="cx">                 41E1B1CA0FF5986900576B3B /* AbstractWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AbstractWorker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41E1B1CB0FF5986900576B3B /* AbstractWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractWorker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41E1B1CC0FF5986900576B3B /* AbstractWorker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AbstractWorker.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                41E910A61C60FD6C007A453F /* JSFetchHeadersCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchHeadersCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseResource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseResource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 41F066E20F64BCF600A07EAC /* ScriptGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGlobalObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22409,7 +22407,6 @@
</span><span class="cx">                                 BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */,
</span><span class="cx">                                 ADEC78F718EE5308001315C2 /* JSElementCustom.h */,
</span><span class="cx">                                 BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
</span><del>-                                41E910A61C60FD6C007A453F /* JSFetchHeadersCustom.cpp */,
</del><span class="cx">                                 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */,
</span><span class="cx">                                 FE80D7A60E9C1ED2000D6F75 /* JSGeolocationCustom.cpp */,
</span><span class="cx">                                 BCE7B1920D4E86960075A539 /* JSHistoryCustom.cpp */,
</span><span class="lines">@@ -29563,7 +29560,6 @@
</span><span class="cx">                                 97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */,
</span><span class="cx">                                 97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */,
</span><span class="cx">                                 AA2A5AD716A4861A00975A25 /* DOMWindowSpeechSynthesis.cpp in Sources */,
</span><del>-                                41E910A71C60FD6C007A453F /* JSFetchHeadersCustom.cpp in Sources */,
</del><span class="cx">                                 A8CCBB48151F831600AB7CE9 /* DOMWindowWebDatabase.cpp in Sources */,
</span><span class="cx">                                 BC53DA481143134D000D817E /* DOMWrapperWorld.cpp in Sources */,
</span><span class="cx">                                 1A1D13810A5325520064BF5F /* DOMXPath.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -77,7 +77,6 @@
</span><span class="cx"> #include &quot;JSEventListener.cpp&quot;
</span><span class="cx"> #include &quot;JSEventTargetCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSExceptionBase.cpp&quot;
</span><del>-#include &quot;JSFetchHeadersCustom.cpp&quot;
</del><span class="cx"> #include &quot;JSFileReaderCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSGeolocationCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSHTMLAllCollectionCustom.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFetchHeadersCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSFetchHeadersCustom.cpp (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFetchHeadersCustom.cpp        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/js/JSFetchHeadersCustom.cpp        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 Canon Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted, provided that the following conditions
- * are required to be met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Canon Inc. nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;JSFetchHeaders.h&quot;
-
-#if ENABLE(FETCH_API)
-
-#include &quot;JSKeyValueIterator.h&quot;
-
-namespace WebCore {
-
-// FIXME: Move this code to JSFetchHeaders.
-using FetchHeadersIterator = JSKeyValueIterator&lt;JSFetchHeaders&gt;;
-using FetchHeadersIteratorPrototype = JSKeyValueIteratorPrototype&lt;JSFetchHeaders&gt;;
-
-template&lt;&gt;
-const JSC::ClassInfo FetchHeadersIterator::s_info = { &quot;Headers Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(FetchHeadersIterator) };
-
-template&lt;&gt;
-const JSC::ClassInfo FetchHeadersIteratorPrototype::s_info = { &quot;Headers Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(FetchHeadersIteratorPrototype) };
-
-JSC::JSValue JSFetchHeaders::entries(JSC::ExecState&amp;)
-{
-    return createIterator&lt;JSFetchHeaders&gt;(*globalObject(), *this, IterationKind::KeyValue);
-}
-
-JSC::JSValue JSFetchHeaders::keys(JSC::ExecState&amp;)
-{
-    return createIterator&lt;JSFetchHeaders&gt;(*globalObject(), *this, IterationKind::Key);
-}
-
-JSC::JSValue JSFetchHeaders::values(JSC::ExecState&amp;)
-{
-    return createIterator&lt;JSFetchHeaders&gt;(*globalObject(), *this, IterationKind::Value);
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFontFaceSetCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -32,34 +32,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-using FontFaceSetIterator = JSKeyValueIterator&lt;JSFontFaceSet&gt;;
-using FontFaceSetIteratorPrototype = JSKeyValueIteratorPrototype&lt;JSFontFaceSet&gt;;
-
-template&lt;&gt;
-const JSC::ClassInfo FontFaceSetIterator::s_info = { &quot;Font Face Set Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(FontFaceSetIterator) };
-
-template&lt;&gt;
-const JSC::ClassInfo FontFaceSetIteratorPrototype::s_info = { &quot;Font Face Set Iterator Prototype&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(FontFaceSetIteratorPrototype) };
-
</del><span class="cx"> JSC::JSValue JSFontFaceSet::ready(JSC::ExecState&amp; execState) const
</span><span class="cx"> {
</span><span class="cx">     auto&amp; promise = wrapped().promise(execState);
</span><span class="cx">     return promise.deferred().promise();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSFontFaceSet::entries(JSC::ExecState&amp;)
-{
-    return createIterator&lt;JSFontFaceSet&gt;(*globalObject(), *this, IterationKind::KeyValue);
</del><span class="cx"> }
</span><del>-
-JSC::JSValue JSFontFaceSet::keys(JSC::ExecState&amp;)
-{
-    return createIterator&lt;JSFontFaceSet&gt;(*globalObject(), *this, IterationKind::Key);
-}
-
-JSC::JSValue JSFontFaceSet::values(JSC::ExecState&amp;)
-{
-    return createIterator&lt;JSFontFaceSet&gt;(*globalObject(), *this, IterationKind::Value);
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSKeyValueIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/js/JSKeyValueIterator.h        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -105,12 +105,43 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><del>-JSKeyValueIterator&lt;JSWrapper&gt;* createIterator(JSDOMGlobalObject&amp; globalObject, JSWrapper&amp; wrapper, IterationKind kind)
</del><ins>+JSC::EncodedJSValue createKeyValueIterator(JSC::ExecState&amp; state, IterationKind kind, const char* propertyName)
</ins><span class="cx"> {
</span><del>-    return JSKeyValueIterator&lt;JSWrapper&gt;::create(globalObject.vm(), getDOMStructure&lt;JSKeyValueIterator&lt;JSWrapper&gt;&gt;(globalObject.vm(), globalObject), wrapper, kind);
</del><ins>+    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
+    if (UNLIKELY(!wrapper))
+        return throwThisTypeError(state, JSWrapper::info()-&gt;className, propertyName);
+    JSDOMGlobalObject&amp; globalObject = *wrapper-&gt;globalObject();
+    return JSC::JSValue::encode(JSKeyValueIterator&lt;JSWrapper&gt;::create(globalObject.vm(), getDOMStructure&lt;JSKeyValueIterator&lt;JSWrapper&gt;&gt;(globalObject.vm(), globalObject), *wrapper, kind));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><ins>+JSC::EncodedJSValue keyValueIteratorForEach(JSC::ExecState&amp; state, const char* propertyName)
+{
+    auto wrapper = JSC::jsDynamicCast&lt;JSWrapper*&gt;(state.thisValue());
+    if (UNLIKELY(!wrapper))
+        return throwThisTypeError(state, JSWrapper::info()-&gt;className, propertyName);
+
+    JSC::CallData callData;
+    JSC::CallType callType = JSC::getCallData(state.argument(0), callData);
+    if (callType == JSC::CallTypeNone)
+        return throwVMTypeError(&amp;state);
+
+    typename JSWrapper::IteratorKey nextKey;
+    typename JSWrapper::IteratorValue nextValue;
+    auto iterator = wrapper-&gt;wrapped().createIterator();
+    while (!iterator.next(nextKey, nextValue)) {
+        JSC::MarkedArgumentBuffer arguments;
+        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), nextValue));
+        arguments.append(toJS(&amp;state, wrapper-&gt;globalObject(), nextKey));
+        arguments.append(wrapper);
+        JSC::call(&amp;state, state.argument(0), callType, callData, wrapper, arguments);
+        if (state.hadException())
+            break;
+    } 
+    return JSC::JSValue::encode(JSC::jsUndefined());
+}
+
+template&lt;typename JSWrapper&gt;
</ins><span class="cx"> void JSKeyValueIterator&lt;JSWrapper&gt;::destroy(JSCell* cell)
</span><span class="cx"> {
</span><span class="cx">     JSKeyValueIterator&lt;JSWrapper&gt;* thisObject = JSC::jsCast&lt;JSKeyValueIterator&lt;JSWrapper&gt;*&gt;(cell);
</span><span class="lines">@@ -120,8 +151,8 @@
</span><span class="cx"> template&lt;typename JSWrapper&gt;
</span><span class="cx"> bool JSKeyValueIterator&lt;JSWrapper&gt;::next(JSC::ExecState&amp; state, JSC::JSValue&amp; value)
</span><span class="cx"> {
</span><del>-    typename DOMWrapped::Iterator::Key nextKey;
-    typename DOMWrapped::Iterator::Value nextValue;
</del><ins>+    typename JSWrapper::IteratorKey nextKey;
+    typename JSWrapper::IteratorValue nextValue;
</ins><span class="cx">     if (m_iterator.next(nextKey, nextValue)) {
</span><span class="cx">         value = JSC::jsUndefined();
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx"> # Copyright (C) 2012 Ericsson AB. All rights reserved.
</span><span class="cx"> # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
</span><span class="cx"> # Copyright (C) 2013 Samsung Electronics. All rights reserved.
</span><del>-# Copyright (C) 2015 Canon Inc. All rights reserved.
</del><ins>+# Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # This library is free software; you can redistribute it and/or
</span><span class="cx"> # modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -605,8 +605,11 @@
</span><span class="cx">         return GetJSBuiltinFunctionName($className, $function);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    my $functionName = $function-&gt;signature-&gt;name;
+    $functionName = &quot;SymbolIterator&quot; if $functionName eq &quot;[Symbol.Iterator]&quot;;
+
</ins><span class="cx">     my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : (OperationShouldBeOnInstance($interface, $function) ? &quot;Instance&quot; : &quot;Prototype&quot;);
</span><del>-    return $codeGenerator-&gt;WK_lcfirst($className) . $kind . &quot;Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name);
</del><ins>+    return $codeGenerator-&gt;WK_lcfirst($className) . $kind . &quot;Function&quot; . $codeGenerator-&gt;WK_ucfirst($functionName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetSpecialAccessorFunctionForType
</span><span class="lines">@@ -764,6 +767,8 @@
</span><span class="cx">         $count++ if !$function-&gt;isStatic &amp;&amp; !OperationShouldBeOnInstance($interface, $function);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    $count += scalar @{$interface-&gt;iterable-&gt;functions} if $interface-&gt;iterable;
+
</ins><span class="cx">     return $count;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1045,6 +1050,16 @@
</span><span class="cx">         push(@headerContent, &quot;    static void destroy(JSC::JSCell*);\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if ($interface-&gt;iterable) {
+        push(@headerContent, &quot;\n&quot;);
+        if ($interface-&gt;iterable-&gt;keyType) {
+            my $keyType = GetNativeType($interface-&gt;iterable-&gt;keyType);
+            push(@headerContent, &quot;    using IteratorKey = $keyType;\n&quot;);
+        }
+        my $valueType = GetNativeType($interface-&gt;iterable-&gt;valueType);
+        push(@headerContent, &quot;    using IteratorValue = $valueType;\n&quot;);
+    }
+
</ins><span class="cx">     # Class info
</span><span class="cx">     if ($interfaceName eq &quot;Node&quot;) {
</span><span class="cx">         push(@headerContent, &quot;\n&quot;);
</span><span class="lines">@@ -1419,11 +1434,15 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    foreach my $function (@{$interface-&gt;functions}) {
</del><ins>+    my @functions = @{$interface-&gt;functions};
+    push(@functions, @{$interface-&gt;iterable-&gt;functions}) if $interface-&gt;iterable;
+    foreach my $function (@functions) {
</ins><span class="cx">         next if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Private&quot;});
</span><span class="cx">         next if ($function-&gt;isStatic);
</span><span class="cx">         next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><span class="cx">         next if OperationShouldBeOnInstance($interface, $function) != $isInstance;
</span><ins>+        next if $function-&gt;signature-&gt;name eq &quot;[Symbol.Iterator]&quot;;
+
</ins><span class="cx">         my $name = $function-&gt;signature-&gt;name;
</span><span class="cx">         push(@$hashKeys, $name);
</span><span class="cx"> 
</span><span class="lines">@@ -1829,14 +1848,17 @@
</span><span class="cx">     push(@implContent, &quot;\nusing namespace JSC;\n\n&quot;);
</span><span class="cx">     push(@implContent, &quot;namespace WebCore {\n\n&quot;);
</span><span class="cx"> 
</span><ins>+    my @functions = @{$interface-&gt;functions};
+    push(@functions, @{$interface-&gt;iterable-&gt;functions}) if $interface-&gt;iterable;
+
</ins><span class="cx">     my $numConstants = @{$interface-&gt;constants};
</span><del>-    my $numFunctions = @{$interface-&gt;functions};
</del><ins>+    my $numFunctions = @functions;
</ins><span class="cx">     my $numAttributes = @{$interface-&gt;attributes};
</span><span class="cx"> 
</span><span class="cx">     if ($numFunctions &gt; 0) {
</span><span class="cx">         my $inAppleCopyright = 0;
</span><span class="cx">         push(@implContent,&quot;// Functions\n\n&quot;);
</span><del>-        foreach my $function (@{$interface-&gt;functions}) {
</del><ins>+        foreach my $function (@functions) {
</ins><span class="cx">             next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><span class="cx">             next if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ForwardDeclareInHeader&quot;};
</span><span class="cx">             next if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CustomBinding&quot;};
</span><span class="lines">@@ -2117,6 +2139,11 @@
</span><span class="cx">                 push(@implContent, &quot;    putDirect(vm, clientData.builtinNames().&quot; . $function-&gt;signature-&gt;name . &quot;PrivateName(), JSFunction::create(vm, globalObject(), 0, String(), &quot; . GetFunctionName($interface, $className, $function) . &quot;), ReadOnly | DontEnum);\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            if ($interface-&gt;iterable) {
+                my $functionName = GetFunctionName($interface, $className, @{$interface-&gt;iterable-&gt;functions}[0]);
+                push(@implContent, &quot;    putDirect(vm, vm.propertyNames-&gt;iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(\&quot;[Symbol.Iterator]\&quot;), $functionName), ReadOnly | DontEnum);\n&quot;);
+            }
+
</ins><span class="cx">             push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">         } else {
</span><span class="cx">             push(@implContent, &quot;void ${className}Prototype::finishCreation(VM&amp; vm)\n&quot;);
</span><span class="lines">@@ -2984,6 +3011,10 @@
</span><span class="cx"> 
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if ($interface-&gt;iterable) {
+        GenerateImplementationIterableFunctions($interface);
+    }
+
</ins><span class="cx">     if ($needsVisitChildren) {
</span><span class="cx">         push(@implContent, &quot;void ${className}::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><span class="lines">@@ -3916,6 +3947,59 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GenerateImplementationIterableFunctions
+{
+    my $interface = shift;
+
+    if (not $interface-&gt;iterable-&gt;isKeyValue) {
+        die &quot;No support yet for set iterators&quot;;
+    }
+
+    my $interfaceName = $interface-&gt;name;
+    my $className = &quot;JS$interfaceName&quot;;
+    my $visibleInterfaceName = $codeGenerator-&gt;GetVisibleInterfaceName($interface);
+
+    AddToImplIncludes(&quot;JSKeyValueIterator.h&quot;);
+
+    push(@implContent,  &lt;&lt;END);
+using ${interfaceName}Iterator = JSKeyValueIterator&lt;${className}&gt;;
+using ${interfaceName}IteratorPrototype = JSKeyValueIteratorPrototype&lt;${className}&gt;;
+
+template&lt;&gt;
+const JSC::ClassInfo ${interfaceName}Iterator::s_info = { &quot;${visibleInterfaceName} Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(${interfaceName}Iterator) };
+
+template&lt;&gt;
+const JSC::ClassInfo ${interfaceName}IteratorPrototype::s_info = { &quot;${visibleInterfaceName} Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(${interfaceName}IteratorPrototype) };
+
+END
+
+    foreach my $function (@{$interface-&gt;iterable-&gt;functions}) {
+        my $propertyName = $function-&gt;signature-&gt;name;
+        my $functionName = GetFunctionName($interface, $className, $function);
+
+        if (not $propertyName eq &quot;forEach&quot;) {
+            my $iterationKind = &quot;KeyValue&quot;;
+            $iterationKind = &quot;Key&quot; if $propertyName eq &quot;keys&quot;;
+            $iterationKind = &quot;Value&quot; if $propertyName eq &quot;values&quot;;
+            push(@implContent,  &lt;&lt;END);
+JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState* state)
+{
+    return createKeyValueIterator&lt;${className}&gt;(*state, IterationKind::${iterationKind}, &quot;${propertyName}&quot;);
+}
+
+END
+        } else {
+            push(@implContent,  &lt;&lt;END);
+JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState* state)
+{
+    return keyValueIteratorForEach&lt;${className}&gt;(*state, &quot;${propertyName}&quot;);
+}
+
+END
+        }
+    }
+}
+
</ins><span class="cx"> sub GetNativeTypeFromSignature
</span><span class="cx"> {
</span><span class="cx">     my $signature = shift;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx">     isException =&gt; '$', # Used for exception interfaces
</span><span class="cx">     isCallback =&gt; '$', # Used for callback interfaces
</span><span class="cx">     isPartial =&gt; '$', # Used for partial interfaces
</span><ins>+    iterable =&gt; '$', # Used for iterable interfaces
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> # Used to represent domInterface contents (name of method, signature)
</span><span class="lines">@@ -85,6 +86,15 @@
</span><span class="cx">     default =&gt; '$', # Default value for parameters
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+# Used to represent Iterable interfaces
+struct( domIterable =&gt; {
+    isKeyValue =&gt; '$',# Is map iterable or set iterable
+    keyType =&gt; '$',   # Key type for map iterables
+    valueType =&gt; '$', # Value type for map or set iterables
+    functions =&gt; '@', # Iterable functions (entries, keys, values, [Symbol.Iterator], forEach)
+});
+
+
</ins><span class="cx"> # Used to represent string constants
</span><span class="cx"> struct( domConstant =&gt; {
</span><span class="cx">     name =&gt; '$',      # DOM Constant identifier
</span><span class="lines">@@ -325,9 +335,8 @@
</span><span class="cx"> my $nextArgumentList_1 = '^(\(|::|ByteString|DOMString|Date|\[|any|boolean|byte|double|float|in|int|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
</span><span class="cx"> my $nextNonAnyType_1 = '^(boolean|byte|double|float|int|long|octet|short|unrestricted|unsigned)$';
</span><span class="cx"> my $nextInterfaceMember_1 = '^(\(|::|ByteString|DOMString|Date|any|attribute|boolean|byte|creator|deleter|double|float|getter|inherit|int|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
</span><del>-my $nextOptionalIteratorInterfaceOrObject_1 = '^(;|=)$';
-my $nextAttributeOrOperationOrIterator_1 = '^(static|stringifier)$';
-my $nextAttributeOrOperationOrIterator_2 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|creator|deleter|double|float|getter|int|legacycaller|long|object|octet|sequence|setter|short|unrestricted|unsigned|void)$';
</del><ins>+my $nextAttributeOrOperation_1 = '^(static|stringifier)$';
+my $nextAttributeOrOperation_2 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|creator|deleter|double|float|getter|int|legacycaller|long|object|octet|sequence|setter|short|unrestricted|unsigned|void)$';
</ins><span class="cx"> my $nextUnrestrictedFloatType_1 = '^(double|float)$';
</span><span class="cx"> my $nextExtendedAttributeRest3_1 = '^(\,|::|\])$';
</span><span class="cx"> my $nextExceptionField_1 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsigned)$';
</span><span class="lines">@@ -961,7 +970,7 @@
</span><span class="cx">     if ($next-&gt;value() eq &quot;serializer&quot;) {
</span><span class="cx">         return $self-&gt;parseSerializer($extendedAttributeList);
</span><span class="cx">     }
</span><del>-    if ($next-&gt;value() =~ /$nextAttributeOrOperationOrIterator_1/) {
</del><ins>+    if ($next-&gt;value() =~ /$nextAttributeOrOperation_1/) {
</ins><span class="cx">         my $qualifier = $self-&gt;parseQualifier();
</span><span class="cx">         my $newDataNode = $self-&gt;parseAttributeOrOperationRest($extendedAttributeList);
</span><span class="cx">         if (defined($newDataNode) &amp;&amp; $qualifier eq &quot;static&quot;) {
</span><span class="lines">@@ -972,7 +981,7 @@
</span><span class="cx">     if ($next-&gt;value() =~ /$nextAttribute_1/) {
</span><span class="cx">         return $self-&gt;parseAttribute($extendedAttributeList);
</span><span class="cx">     }
</span><del>-    if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextAttributeOrOperationOrIterator_2/) {
</del><ins>+    if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextAttributeOrOperation_2/) {
</ins><span class="cx">         return $self-&gt;parseOperationOrIterator($extendedAttributeList);
</span><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="lines">@@ -1206,13 +1215,17 @@
</span><span class="cx">     if ($next-&gt;value() =~ /$nextSpecials_1/) {
</span><span class="cx">         return $self-&gt;parseSpecialOperation($extendedAttributeList);
</span><span class="cx">     }
</span><ins>+    if ($next-&gt;value() eq &quot;iterable&quot;) {
+        return $self-&gt;parseIterableRest($extendedAttributeList);
+    }
</ins><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextAttributeOrOperationRest_1/) {
</span><span class="cx">         my $returnType = $self-&gt;parseReturnType();
</span><del>-        my $interface = $self-&gt;parseOperationOrIteratorRest($extendedAttributeList);
-        if (defined ($interface)) {
-            $interface-&gt;signature-&gt;type($returnType);
</del><ins>+        my $next = $self-&gt;nextToken();
+        if ($next-&gt;type() == IdentifierToken || $next-&gt;value() eq &quot;(&quot;) {
+            my $operation = $self-&gt;parseOperationRest($extendedAttributeList);
+            $operation-&gt;signature-&gt;type($returnType);
+            return $operation;
</ins><span class="cx">         }
</span><del>-        return $interface;
</del><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -1280,62 +1293,76 @@
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub parseOperationOrIteratorRest
</del><ins>+sub parseIterableRest
</ins><span class="cx"> {
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $extendedAttributeList = shift;
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><del>-    if ($next-&gt;value() eq &quot;iterator&quot;) {
-        return $self-&gt;parseIteratorRest($extendedAttributeList);
</del><ins>+    if ($next-&gt;value() eq &quot;iterable&quot;) {
+        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;iterable&quot;, __LINE__);
+        my $iterableNode = $self-&gt;parseOptionalIterableInterface($extendedAttributeList);
+        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;;&quot;, __LINE__);
+        return $iterableNode;
</ins><span class="cx">     }
</span><del>-    if ($next-&gt;type() == IdentifierToken || $next-&gt;value() eq &quot;(&quot;) {
-        return $self-&gt;parseOperationRest($extendedAttributeList);
-    }
</del><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub parseIteratorRest
</del><ins>+sub parseOptionalIterableInterface
</ins><span class="cx"> {
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $extendedAttributeList = shift;
</span><span class="cx"> 
</span><del>-    my $next = $self-&gt;nextToken();
-    if ($next-&gt;value() eq &quot;iterator&quot;) {
-        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;iterator&quot;, __LINE__);
-        $self-&gt;parseOptionalIteratorInterfaceOrObject($extendedAttributeList);
-        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;;&quot;, __LINE__);
-        return;
-    }
-    $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
-}
</del><ins>+    my $symbolIteratorFunction = domFunction-&gt;new();
+    $symbolIteratorFunction-&gt;signature(domSignature-&gt;new());
+    $symbolIteratorFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
+    $symbolIteratorFunction-&gt;signature-&gt;name(&quot;[Symbol.Iterator]&quot;);
</ins><span class="cx"> 
</span><del>-sub parseOptionalIteratorInterfaceOrObject
-{
-    my $self = shift;
-    my $extendedAttributeList = shift;
</del><ins>+    my $entriesFunction = domFunction-&gt;new();
+    $entriesFunction-&gt;signature(domSignature-&gt;new());
+    $entriesFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
+    $entriesFunction-&gt;signature-&gt;name(&quot;entries&quot;);
</ins><span class="cx"> 
</span><del>-    my $next = $self-&gt;nextToken();
-    if ($next-&gt;value() =~ /$nextOptionalIteratorInterfaceOrObject_1/) {
-        return $self-&gt;parseOptionalIteratorInterface($extendedAttributeList);
-    }
-    if ($next-&gt;value() eq &quot;object&quot;) {
-        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;object&quot;, __LINE__);
-        return;
-    }
-    $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
-}
</del><ins>+    my $keysFunction = domFunction-&gt;new();
+    $keysFunction-&gt;signature(domSignature-&gt;new());
+    $keysFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
+    $keysFunction-&gt;signature-&gt;name(&quot;keys&quot;);
</ins><span class="cx"> 
</span><del>-sub parseOptionalIteratorInterface
-{
-    my $self = shift;
-    my $extendedAttributeList = shift;
</del><ins>+    my $valuesFunction = domFunction-&gt;new();
+    $valuesFunction-&gt;signature(domSignature-&gt;new());
+    $valuesFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
+    $valuesFunction-&gt;signature-&gt;name(&quot;values&quot;);
</ins><span class="cx"> 
</span><del>-    my $next = $self-&gt;nextToken();
-    if ($next-&gt;value() eq &quot;=&quot;) {
-        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;=&quot;, __LINE__);
-        $self-&gt;assertTokenType($self-&gt;getToken(), IdentifierToken);
</del><ins>+    my $forEachFunction = domFunction-&gt;new();
+    $forEachFunction-&gt;signature(domSignature-&gt;new());
+    $forEachFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
+    $forEachFunction-&gt;signature-&gt;name(&quot;forEach&quot;);
+    my $forEachArgument = domSignature-&gt;new();
+    $forEachArgument-&gt;name(&quot;callback&quot;);
+    $forEachArgument-&gt;type(&quot;any&quot;);
+    push(@{$forEachFunction-&gt;parameters}, ($forEachArgument));
+
+    my $newDataNode = domIterable-&gt;new();
+    push(@{$newDataNode-&gt;functions}, $symbolIteratorFunction);
+    push(@{$newDataNode-&gt;functions}, $entriesFunction);
+    push(@{$newDataNode-&gt;functions}, $keysFunction);
+    push(@{$newDataNode-&gt;functions}, $valuesFunction);
+    push(@{$newDataNode-&gt;functions}, $forEachFunction);
+
+    $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;&lt;&quot;, __LINE__);
+    my $type1 = $self-&gt;getToken()-&gt;value();
+    if ($self-&gt;nextToken()-&gt;value() eq &quot;,&quot;) {
+        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;,&quot;, __LINE__);
+        $newDataNode-&gt;isKeyValue(1);
+        $newDataNode-&gt;keyType($type1);
+        $newDataNode-&gt;valueType($self-&gt;getToken()-&gt;value());
+    } else {
+        $newDataNode-&gt;isKeyValue(0);
+        $newDataNode-&gt;valueType($type1);
</ins><span class="cx">     }
</span><ins>+    $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;&gt;&quot;, __LINE__);
+
+    return $newDataNode;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub parseOperationRest
</span><span class="lines">@@ -2177,6 +2204,10 @@
</span><span class="cx">             push(@{$interface-&gt;constants}, $item);
</span><span class="cx">             next;
</span><span class="cx">         }
</span><ins>+        if (ref($item) eq &quot;domIterable&quot;) {
+            $interface-&gt;iterable($item);
+            next;
+        }
</ins><span class="cx">         if (ref($item) eq &quot;domFunction&quot;) {
</span><span class="cx">             if ($item-&gt;signature-&gt;name eq &quot;&quot;) {
</span><span class="cx">                 push(@{$interface-&gt;anonymousFunctions}, $item);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;JSDOMStringList.h&quot;
</span><span class="cx"> #include &quot;JSDocument.h&quot;
</span><span class="cx"> #include &quot;JSEventListener.h&quot;
</span><ins>+#include &quot;JSKeyValueIterator.h&quot;
</ins><span class="cx"> #include &quot;JSNode.h&quot;
</span><span class="cx"> #include &quot;JSSVGDocument.h&quot;
</span><span class="cx"> #include &quot;JSSVGPoint.h&quot;
</span><span class="lines">@@ -179,6 +180,11 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunctionWithException(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSymbolIterator(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionEntries(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionKeys(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionValues(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionForEach(JSC::ExecState*);
</ins><span class="cx"> 
</span><span class="cx"> // Attributes
</span><span class="cx"> 
</span><span class="lines">@@ -695,6 +701,10 @@
</span><span class="cx">     { &quot;testPromiseFunctionWithFloatArgument&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument), (intptr_t) (1) } },
</span><span class="cx">     { &quot;testPromiseFunctionWithException&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunctionWithException), (intptr_t) (0) } },
</span><span class="cx">     { &quot;testPromiseFunctionWithOptionalIntArgument&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument), (intptr_t) (0) } },
</span><ins>+    { &quot;entries&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionEntries), (intptr_t) (0) } },
+    { &quot;keys&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionKeys), (intptr_t) (0) } },
+    { &quot;values&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionValues), (intptr_t) (0) } },
+    { &quot;forEach&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionForEach), (intptr_t) (1) } },
</ins><span class="cx"> #if ENABLE(Condition1)
</span><span class="cx">     { &quot;CONDITIONAL_CONST&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
</span><span class="cx"> #else
</span><span class="lines">@@ -722,6 +732,7 @@
</span><span class="cx">     reifyStaticProperties(vm, JSTestObjPrototypeTableValues, *this);
</span><span class="cx">     JSVMClientData&amp; clientData = *static_cast&lt;JSVMClientData*&gt;(vm.clientData);
</span><span class="cx">     putDirect(vm, clientData.builtinNames().privateMethodPrivateName(), JSFunction::create(vm, globalObject(), 0, String(), jsTestObjPrototypeFunctionPrivateMethod), ReadOnly | DontEnum);
</span><ins>+    putDirect(vm, vm.propertyNames-&gt;iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(&quot;[Symbol.Iterator]&quot;), jsTestObjPrototypeFunctionSymbolIterator), ReadOnly | DontEnum);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSTestObj::s_info = { &quot;TestObject&quot;, &amp;Base::s_info, &amp;JSTestObjTable, CREATE_METHOD_TABLE(JSTestObj) };
</span><span class="lines">@@ -4886,6 +4897,40 @@
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+using TestObjIterator = JSKeyValueIterator&lt;JSTestObj&gt;;
+using TestObjIteratorPrototype = JSKeyValueIteratorPrototype&lt;JSTestObj&gt;;
+
+template&lt;&gt;
+const JSC::ClassInfo TestObjIterator::s_info = { &quot;TestObject Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(TestObjIterator) };
+
+template&lt;&gt;
+const JSC::ClassInfo TestObjIteratorPrototype::s_info = { &quot;TestObject Iterator&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(TestObjIteratorPrototype) };
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSymbolIterator(JSC::ExecState* state)
+{
+    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::KeyValue, &quot;[Symbol.Iterator]&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionEntries(JSC::ExecState* state)
+{
+    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::KeyValue, &quot;entries&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionKeys(JSC::ExecState* state)
+{
+    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::Key, &quot;keys&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionValues(JSC::ExecState* state)
+{
+    return createKeyValueIterator&lt;JSTestObj&gt;(*state, IterationKind::Value, &quot;values&quot;);
+}
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionForEach(JSC::ExecState* state)
+{
+    return keyValueIteratorForEach&lt;JSTestObj&gt;(*state, &quot;forEach&quot;);
+}
+
</ins><span class="cx"> void JSTestObj::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     auto* thisObject = jsCast&lt;JSTestObj*&gt;(cell);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -45,6 +45,9 @@
</span><span class="cx">     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&amp;);
</span><span class="cx">     static void destroy(JSC::JSCell*);
</span><span class="cx"> 
</span><ins>+    using IteratorKey = String;
+    using IteratorValue = TestObj*;
+
</ins><span class="cx">     DECLARE_INFO;
</span><span class="cx"> 
</span><span class="cx">     static JSC::Structure* createStructure(JSC::VM&amp; vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx">     // TypedArray attribute
</span><span class="cx">     attribute Float32Array typedArrayAttr;
</span><span class="cx"> 
</span><ins>+    iterable&lt;DOMString, TestObj&gt;;
+
</ins><span class="cx">     // Methods
</span><span class="cx">     void    voidMethod();
</span><span class="cx">     void    voidMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.cpp (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.cpp        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/css/FontFaceSet.cpp        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FontFaceSet::Iterator::next(RefPtr&lt;FontFace&gt;&amp; key, RefPtr&lt;FontFace&gt;&amp; value)
</del><ins>+bool FontFaceSet::Iterator::next(FontFace*&amp; key, FontFace*&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     if (m_index == m_target-&gt;size())
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.h (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.h        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/css/FontFaceSet.h        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -72,12 +72,8 @@
</span><span class="cx">     class Iterator {
</span><span class="cx">     public:
</span><span class="cx">         explicit Iterator(FontFaceSet&amp;);
</span><ins>+        bool next(FontFace*&amp; nextKey, FontFace*&amp; nextValue);
</ins><span class="cx"> 
</span><del>-        using Key = RefPtr&lt;FontFace&gt;;
-        using Value = RefPtr&lt;FontFace&gt;;
-
-        bool next(Key&amp; nextKey, Value&amp; nextValue);
-
</del><span class="cx">     private:
</span><span class="cx">         Ref&lt;FontFaceSet&gt; m_target;
</span><span class="cx">         size_t m_index { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSetidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.idl (196899 => 196900)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.idl        2016-02-22 08:14:59 UTC (rev 196899)
+++ trunk/Source/WebCore/css/FontFaceSet.idl        2016-02-22 08:31:14 UTC (rev 196900)
</span><span class="lines">@@ -32,12 +32,12 @@
</span><span class="cx">     ConstructorCallWith=ScriptState&amp;Document,
</span><span class="cx">     Constructor(sequence&lt;FontFace&gt; initialFaces)
</span><span class="cx"> ] interface FontFaceSet : EventTarget {
</span><del>-    [Custom] Object entries();
-    // forEach(): Maybe implement this in Javascript on top of keys().
</del><span class="cx">     boolean has(FontFace font);
</span><del>-    [Custom] Object keys();
-    [Custom] Object values();
-    // @iterator
</del><ins>+
+    // FIXME: We should add support for the setlike declaration.
+    // As a first step this map iterable declaration should be changed to a set iterable.
+    iterable&lt;FontFace, FontFace&gt;;
+
</ins><span class="cx">     readonly attribute long size;
</span><span class="cx"> 
</span><span class="cx">     FontFaceSet add(FontFace font);
</span><span class="lines">@@ -53,4 +53,4 @@
</span><span class="cx"> 
</span><span class="cx">     [Custom] readonly attribute Promise ready;
</span><span class="cx">     readonly attribute FontFaceSetLoadStatus status;
</span><del>-};
</del><span class="cx">\ No newline at end of file
</span><ins>+};
</ins></span></pre>
</div>
</div>

</body>
</html>