<!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>[208408] trunk/Source/WebCore</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/208408">208408</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-11-04 17:03:32 -0700 (Fri, 04 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebIDL] Add support for modern callback syntax
https://bugs.webkit.org/show_bug.cgi?id=164435

Patch by Sam Weinig &lt;sam@webkit.org&gt; on 2016-11-04
Reviewed by Chris Dumez.

Support new callback syntax:
    callback Function = void (DOMString arg1, long arg2);

This replaces &quot;callback interface&quot; types with a Callback=FunctionOnly
extended attribute.

* Modules/geolocation/PositionCallback.idl:
* Modules/geolocation/PositionErrorCallback.idl:
* Modules/notifications/NotificationPermissionCallback.idl:
* Modules/quota/StorageErrorCallback.idl:
* Modules/quota/StorageQuotaCallback.idl:
* Modules/quota/StorageUsageCallback.idl:
* Modules/webaudio/AudioBufferCallback.idl:
* Modules/webdatabase/DatabaseCallback.idl:
* Modules/webdatabase/SQLStatementCallback.idl:
* Modules/webdatabase/SQLStatementErrorCallback.idl:
* Modules/webdatabase/SQLTransactionCallback.idl:
* Modules/webdatabase/SQLTransactionErrorCallback.idl:
* dom/RequestAnimationFrameCallback.idl:
* dom/StringCallback.idl:
* html/VoidCallback.idl:
* page/IntersectionObserverCallback.idl:
* css/MediaQueryListListener.idl:
Update to new syntax.

* css/MediaQueryListListener.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::styleResolverChanged):
Switch to using the now required 'handleEvent' name. This is an implementation detail
that we should change.

* bindings/scripts/CodeGenerator.pm:
Update document processing to allow a callback only file. Update callback
type checks to look for a regex that matches in the new format.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludesForIDLType):
(AddToIncludesForIDLType):
(AddToImplIncludes):
(AddToIncludes):
Abstract includes functions to allow passing in an include hash.

(GenerateCallbackFunctionHeader):
(GenerateCallbackFunctionImplementation):
(GenerateCallbackInterfaceHeader):
(GenerateCallbackInterfaceImplementation):
(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
to allow using it for both the new callbacks as well as the old callback interfaces.

* bindings/scripts/IDLParser.pm:
(Parse):
(applyTypedefs):
(applyTypedefsToOperation):
(parseCallbackRest):
Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.

* bindings/scripts/IDLAttributes.txt:
Remove support for Callback=FunctionOnly.

* bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
* bindings/scripts/test/JS/JSTestCallback.h: Removed.
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
* bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestCallback.idl: Removed.
* bindings/scripts/test/TestCallbackFunction.idl:
* bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
* bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestTypedefs.idl:
Update existing tests and add new ones to test callback functions specifically.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationPositionCallbackidl">trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationPositionErrorCallbackidl">trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesnotificationsNotificationPermissionCallbackidl">trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesquotaStorageErrorCallbackidl">trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesquotaStorageQuotaCallbackidl">trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesquotaStorageUsageCallbackidl">trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioBufferCallbackidl">trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseCallbackidl">trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLStatementErrorCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionErrorCallbackidl">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackFunctionidl">trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestTypedefsidl">trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryListListenerh">trunk/Source/WebCore/css/MediaQueryListListener.h</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryListListeneridl">trunk/Source/WebCore/css/MediaQueryListListener.idl</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryMatchercpp">trunk/Source/WebCore/css/MediaQueryMatcher.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRequestAnimationFrameCallbackidl">trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl</a></li>
<li><a href="#trunkSourceWebCoredomStringCallbackidl">trunk/Source/WebCore/dom/StringCallback.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlVoidCallbackidl">trunk/Source/WebCore/html/VoidCallback.idl</a></li>
<li><a href="#trunkSourceWebCorepageIntersectionObserverCallbackidl">trunk/Source/WebCore/page/IntersectionObserverCallback.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackFunctionWithTypedefsidl">trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackInterfaceidl">trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestCallbackidl">trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/ChangeLog        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,3 +1,89 @@
</span><ins>+2016-11-04  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] Add support for modern callback syntax
+        https://bugs.webkit.org/show_bug.cgi?id=164435
+
+        Reviewed by Chris Dumez.
+
+        Support new callback syntax:
+            callback Function = void (DOMString arg1, long arg2);
+
+        This replaces &quot;callback interface&quot; types with a Callback=FunctionOnly
+        extended attribute.
+
+        * Modules/geolocation/PositionCallback.idl:
+        * Modules/geolocation/PositionErrorCallback.idl:
+        * Modules/notifications/NotificationPermissionCallback.idl:
+        * Modules/quota/StorageErrorCallback.idl:
+        * Modules/quota/StorageQuotaCallback.idl:
+        * Modules/quota/StorageUsageCallback.idl:
+        * Modules/webaudio/AudioBufferCallback.idl:
+        * Modules/webdatabase/DatabaseCallback.idl:
+        * Modules/webdatabase/SQLStatementCallback.idl:
+        * Modules/webdatabase/SQLStatementErrorCallback.idl:
+        * Modules/webdatabase/SQLTransactionCallback.idl:
+        * Modules/webdatabase/SQLTransactionErrorCallback.idl:
+        * dom/RequestAnimationFrameCallback.idl:
+        * dom/StringCallback.idl:
+        * html/VoidCallback.idl:
+        * page/IntersectionObserverCallback.idl:
+        * css/MediaQueryListListener.idl:
+        Update to new syntax.
+
+        * css/MediaQueryListListener.h:
+        * css/MediaQueryMatcher.cpp:
+        (WebCore::MediaQueryMatcher::styleResolverChanged):
+        Switch to using the now required 'handleEvent' name. This is an implementation detail
+        that we should change.
+
+        * bindings/scripts/CodeGenerator.pm:
+        Update document processing to allow a callback only file. Update callback
+        type checks to look for a regex that matches in the new format.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (AddToImplIncludesForIDLType):
+        (AddToIncludesForIDLType):
+        (AddToImplIncludes):
+        (AddToIncludes):
+        Abstract includes functions to allow passing in an include hash.
+
+        (GenerateCallbackFunctionHeader):
+        (GenerateCallbackFunctionImplementation):
+        (GenerateCallbackInterfaceHeader):
+        (GenerateCallbackInterfaceImplementation):
+        (GenerateCallbackHeaderContent):
+        (GenerateCallbackImplementationContent):
+        Refactor callback generation code into GenerateCallbackHeaderContent and GenerateCallbackImplementationContent
+        to allow using it for both the new callbacks as well as the old callback interfaces.
+
+        * bindings/scripts/IDLParser.pm:
+        (Parse):
+        (applyTypedefs):
+        (applyTypedefsToOperation):
+        (parseCallbackRest):
+        Parse callbacks into the new IDLCallbackFunction type. Ensure that typedefs are applied as well.
+
+        * bindings/scripts/IDLAttributes.txt:
+        Remove support for Callback=FunctionOnly.
+
+        * bindings/scripts/test/JS/JSTestCallback.cpp: Removed.
+        * bindings/scripts/test/JS/JSTestCallback.h: Removed.
+        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
+        * bindings/scripts/test/JS/JSTestCallbackFunction.h:
+        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: Added.
+        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: Added.
+        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp.
+        * bindings/scripts/test/JS/JSTestCallbackInterface.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h.
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        * bindings/scripts/test/TestCallback.idl: Removed.
+        * bindings/scripts/test/TestCallbackFunction.idl:
+        * bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: Added.
+        * bindings/scripts/test/TestCallbackInterface.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallback.idl.
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/TestTypedefs.idl:
+        Update existing tests and add new ones to test callback functions specifically.
+
</ins><span class="cx"> 2016-11-04  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Move isDefaultPortForProtocol from URLParser.cpp back to URL.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationPositionCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/geolocation/PositionCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -24,7 +24,4 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=GEOLOCATION,
</span><del>-    Callback=FunctionOnly,
-] callback interface PositionCallback {
-    boolean handleEvent(Geoposition position);
-};
</del><ins>+] callback PositionCallback = void (Geoposition position);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationPositionErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -24,7 +24,4 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=GEOLOCATION,
</span><del>-    Callback=FunctionOnly,
-] callback interface PositionErrorCallback {
-    boolean handleEvent(PositionError error);
-};
</del><ins>+] callback PositionErrorCallback = void (PositionError error);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesnotificationsNotificationPermissionCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/notifications/NotificationPermissionCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,5 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=NOTIFICATIONS,
</span><del>-    Callback=FunctionOnly,
-] callback interface NotificationPermissionCallback {
-    boolean handleEvent(DOMString permission);
-};
</del><ins>+] callback NotificationPermissionCallback = void (DOMString permission);
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesquotaStorageErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/quota/StorageErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -30,7 +30,4 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=QUOTA,
</span><del>-    Callback=FunctionOnly,
-] callback interface StorageErrorCallback {
-    boolean handleEvent(DOMCoreException error);
-};
</del><ins>+] callback StorageErrorCallback = void (DOMCoreException error);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesquotaStorageQuotaCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/quota/StorageQuotaCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -30,7 +30,4 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=QUOTA,
</span><del>-    Callback=FunctionOnly,
-] callback interface StorageQuotaCallback {
-    boolean handleEvent(unsigned long long grantedQuotaInBytes);
-};
</del><ins>+] callback StorageQuotaCallback = void (unsigned long long grantedQuotaInBytes);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesquotaStorageUsageCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/quota/StorageUsageCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -30,7 +30,4 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=QUOTA,
</span><del>-    Callback=FunctionOnly,
-] callback interface StorageUsageCallback {
-    boolean handleEvent(unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes);
-};
</del><ins>+] callback StorageUsageCallback = void (unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioBufferCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBufferCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,7 +25,4 @@
</span><span class="cx"> [
</span><span class="cx">     Conditional=WEB_AUDIO,
</span><span class="cx">     JSGenerateToJSObject,
</span><del>-    Callback=FunctionOnly,
-] callback interface AudioBufferCallback {
-    boolean handleEvent(AudioBuffer audioBuffer);
-};
</del><ins>+] callback AudioBufferCallback = void (AudioBuffer audioBuffer);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,8 +26,4 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-[
-    Callback=FunctionOnly,
-] callback interface DatabaseCallback {
-    boolean handleEvent(Database database);
-};
</del><ins>+callback DatabaseCallback = void (Database database);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,5 @@
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><del>-[
-    Callback=FunctionOnly,
-] callback interface SQLStatementCallback {
-    boolean handleEvent(SQLTransaction transaction, SQLResultSet resultSet);
-};
</del><ins>+
+callback SQLStatementCallback = void (SQLTransaction transaction, SQLResultSet resultSet);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLStatementErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,7 @@
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><ins>+
</ins><span class="cx"> [
</span><del>-    Callback=FunctionOnly,
-] callback interface SQLStatementErrorCallback {
-    [Custom] boolean handleEvent(SQLTransaction transaction, SQLError error);
-};
</del><ins>+    Custom
+] callback SQLStatementErrorCallback = boolean (SQLTransaction transaction, SQLError error);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,8 +25,5 @@
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><del>-[
-    Callback=FunctionOnly,
-] callback interface SQLTransactionCallback {
-    boolean handleEvent(SQLTransaction transaction);
-};
</del><ins>+
+callback SQLTransactionCallback = void (SQLTransaction transaction);
</ins></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionErrorCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,8 +26,4 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-[
-    Callback=FunctionOnly,
-] callback interface SQLTransactionErrorCallback {
-    boolean handleEvent(SQLError error);
-};
</del><ins>+callback SQLTransactionErrorCallback = void (SQLError error);
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -64,18 +64,11 @@
</span><span class="cx">     &quot;unrestricted double&quot; =&gt; 1,
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-my %primitiveTypeHash = ( &quot;boolean&quot; =&gt; 1, &quot;void&quot; =&gt; 1, &quot;Date&quot; =&gt; 1 );
-
-# WebCore types used directly in IDL files.
-my %webCoreTypeHash = (
-    &quot;Dictionary&quot; =&gt; 1,
-    &quot;SerializedScriptValue&quot; =&gt; 1,
</del><ins>+my %stringTypeHash = (
+    &quot;DOMString&quot; =&gt; 1,
+    &quot;USVString&quot; =&gt; 1,
</ins><span class="cx"> );
</span><span class="cx"> 
</span><del>-my %dictionaryTypeImplementationNameOverrides = ();
-my %enumTypeImplementationNameOverrides = ();
-
-
</del><span class="cx"> my %typedArrayTypes = (
</span><span class="cx">     &quot;ArrayBuffer&quot; =&gt; 1,
</span><span class="cx">     &quot;ArrayBufferView&quot; =&gt; 1,
</span><span class="lines">@@ -91,6 +84,21 @@
</span><span class="cx">     &quot;Uint8ClampedArray&quot; =&gt; 1,
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+my %primitiveTypeHash = ( 
+    &quot;boolean&quot; =&gt; 1, 
+    &quot;void&quot; =&gt; 1,
+    &quot;Date&quot; =&gt; 1
+);
+
+# WebCore types used directly in IDL files.
+my %webCoreTypeHash = (
+    &quot;Dictionary&quot; =&gt; 1,
+    &quot;SerializedScriptValue&quot; =&gt; 1,
+);
+
+my %dictionaryTypeImplementationNameOverrides = ();
+my %enumTypeImplementationNameOverrides = ();
+
</ins><span class="cx"> my %svgAttributesInHTMLHash = (
</span><span class="cx">     &quot;class&quot; =&gt; 1,
</span><span class="cx">     &quot;id&quot; =&gt; 1,
</span><span class="lines">@@ -209,6 +217,17 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    my $callbackFunctions = $useDocument-&gt;callbackFunctions;
+    if (@$callbackFunctions) {
+        die &quot;Multiple standalone callback functions per document are not supported&quot; if @$callbackFunctions &gt; 1;
+
+        my $callbackFunction = @$callbackFunctions[0];
+        print &quot;Generating $useGenerator bindings code for IDL callback function \&quot;&quot; . $callbackFunction-&gt;type-&gt;name . &quot;\&quot;...\n&quot; if $verbose;
+        $codeGenerator-&gt;GenerateCallbackFunction($callbackFunction, $useDocument-&gt;enumerations, $useDocument-&gt;dictionaries);
+        $codeGenerator-&gt;WriteData($callbackFunction, $useOutputDir, $useOutputHeadersDir);
+        return;
+    }
+
</ins><span class="cx">     my $dictionaries = $useDocument-&gt;dictionaries;
</span><span class="cx">     if (@$dictionaries) {
</span><span class="cx">         die &quot;Multiple standalone dictionaries per document are not supported&quot; if @$dictionaries &gt; 1;
</span><span class="lines">@@ -364,8 +383,7 @@
</span><span class="cx">     return 1 if $integerTypeHash{$typeName};
</span><span class="cx">     return 1 if $floatingPointTypeHash{$typeName};
</span><span class="cx">     return 1 if $typedArrayTypes{$typeName};
</span><del>-    return 1 if $typeName eq &quot;DOMString&quot;;
-    return 1 if $typeName eq &quot;USVString&quot;;
</del><ins>+    return 1 if $stringTypeHash{$typeName};
</ins><span class="cx">     return 1 if $typeName eq &quot;BufferSource&quot;;
</span><span class="cx">     return 1 if $typeName eq &quot;SVGNumber&quot;;
</span><span class="cx">     return 1 if $typeName eq &quot;any&quot;;
</span><span class="lines">@@ -426,7 +444,6 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-# Currently used outside WebKit in an internal Apple project; can be removed soon.
</del><span class="cx"> sub IsStringType
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="lines">@@ -433,8 +450,7 @@
</span><span class="cx"> 
</span><span class="cx">     assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</span><span class="cx"> 
</span><del>-    return 1 if $type-&gt;name eq &quot;DOMString&quot;;
-    return 1 if $type-&gt;name eq &quot;USVString&quot;;
</del><ins>+    return 1 if $stringTypeHash{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1031,16 +1047,13 @@
</span><span class="cx">     return $result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-# Callback interface with [Callback=FunctionOnly].
-# FIXME: This should be a callback function:
-# https://heycam.github.io/webidl/#idl-callback-functions
-sub ComputeIsFunctionOnlyCallbackInterface
</del><ins>+sub ComputeIsCallbackFunction
</ins><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><span class="cx">     assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</span><span class="cx"> 
</span><del>-    return 0 unless $object-&gt;IsCallbackInterface($type);
</del><ins>+    return 0 unless $object-&gt;IsWrapperType($type);
</ins><span class="cx"> 
</span><span class="cx">     my $typeName = $type-&gt;name;
</span><span class="cx">     my $idlFile = $object-&gt;IDLFileForInterface($typeName) or assert(&quot;Could NOT find IDL file for interface \&quot;$typeName\&quot;!\n&quot;);
</span><span class="lines">@@ -1050,25 +1063,12 @@
</span><span class="cx">     close FILE;
</span><span class="cx"> 
</span><span class="cx">     my $fileContents = join('', @lines);
</span><del>-    if ($fileContents =~ /\[(.*)\]\s+callback\s+interface\s+(\w+)/gs) {
-        my @parts = split(',', $1);
-        foreach my $part (@parts) {
-            my @keyValue = split('=', $part);
-            my $key = trim($keyValue[0]);
-            next unless length($key);
-            my $value = &quot;VALUE_IS_MISSING&quot;;
-            $value = trim($keyValue[1]) if @keyValue &gt; 1;
-
-            return 1 if ($key eq &quot;Callback&quot; &amp;&amp; $value eq &quot;FunctionOnly&quot;);
-        }
-    }
-
-    return 0;
</del><ins>+    return ($fileContents =~ /(.*)callback\s+(\w+)\s+=/gs);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-my %isFunctionOnlyCallbackInterface = ();
</del><ins>+my %isCallbackFunction = ();
</ins><span class="cx"> 
</span><del>-sub IsFunctionOnlyCallbackInterface
</del><ins>+sub IsCallbackFunction
</ins><span class="cx"> {
</span><span class="cx">     # FIXME: It's bad to have a function like this that opens another IDL file to answer a question.
</span><span class="cx">     # Overusing this kind of function can make things really slow. Lets avoid these if we can.
</span><span class="lines">@@ -1078,9 +1078,9 @@
</span><span class="cx"> 
</span><span class="cx">     assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</span><span class="cx"> 
</span><del>-    return $isFunctionOnlyCallbackInterface{$type-&gt;name} if exists $isFunctionOnlyCallbackInterface{$type-&gt;name};
-    my $result = $object-&gt;ComputeIsFunctionOnlyCallbackInterface($type);
-    $isFunctionOnlyCallbackInterface{$type-&gt;name} = $result;
</del><ins>+    return $isCallbackFunction{$type-&gt;name} if exists $isCallbackFunction{$type-&gt;name};
+    my $result = $object-&gt;ComputeIsCallbackFunction($type);
+    $isCallbackFunction{$type-&gt;name} = $result;
</ins><span class="cx">     return $result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -150,6 +150,14 @@
</span><span class="cx">     $object-&gt;GenerateDictionaryImplementation($dictionary, $className, $enumerations);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub GenerateCallbackFunction
+{
+    my ($object, $callbackFunction, $enumerations, $dictionaries) = @_;
+
+    $object-&gt;GenerateCallbackFunctionHeader($callbackFunction, $enumerations, $dictionaries);
+    $object-&gt;GenerateCallbackFunctionImplementation($callbackFunction, $enumerations, $dictionaries);
+}
+
</ins><span class="cx"> sub GenerateInterface
</span><span class="cx"> {
</span><span class="cx">     my ($object, $interface, $defines, $enumerations, $dictionaries) = @_;
</span><span class="lines">@@ -158,8 +166,8 @@
</span><span class="cx">     AddStringifierOperationIfNeeded($interface);
</span><span class="cx"> 
</span><span class="cx">     if ($interface-&gt;isCallback) {
</span><del>-        $object-&gt;GenerateCallbackHeader($interface, $enumerations, $dictionaries);
-        $object-&gt;GenerateCallbackImplementation($interface, $enumerations, $dictionaries);
</del><ins>+        $object-&gt;GenerateCallbackInterfaceHeader($interface, $enumerations, $dictionaries);
+        $object-&gt;GenerateCallbackInterfaceImplementation($interface, $enumerations, $dictionaries);
</ins><span class="cx">     } else {
</span><span class="cx">         $object-&gt;GenerateHeader($interface, $enumerations, $dictionaries);
</span><span class="cx">         $object-&gt;GenerateImplementation($interface, $enumerations, $dictionaries);
</span><span class="lines">@@ -222,9 +230,9 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetJSCallbackDataType
</span><span class="cx"> {
</span><del>-    my $callbackInterface = shift;
</del><ins>+    my $callback = shift;
</ins><span class="cx"> 
</span><del>-    return $callbackInterface-&gt;extendedAttributes-&gt;{IsWeakCallback} ? &quot;JSCallbackDataWeak&quot; : &quot;JSCallbackDataStrong&quot;;
</del><ins>+    return $callback-&gt;extendedAttributes-&gt;{IsWeakCallback} ? &quot;JSCallbackDataWeak&quot; : &quot;JSCallbackDataStrong&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetExportMacroForJSClass
</span><span class="lines">@@ -261,6 +269,13 @@
</span><span class="cx"> sub AddToImplIncludesForIDLType
</span><span class="cx"> {
</span><span class="cx">     my ($type, $conditional) = @_;
</span><ins>+
+    return AddToIncludesForIDLType($type, \%implIncludes, $conditional)
+}
+
+sub AddToIncludesForIDLType
+{
+    my ($type, $includesRef, $conditional) = @_;
</ins><span class="cx">     
</span><span class="cx">     return if $codeGenerator-&gt;IsPrimitiveType($type);
</span><span class="cx">     return if $codeGenerator-&gt;IsStringType($type);
</span><span class="lines">@@ -269,10 +284,10 @@
</span><span class="cx">     return if $type-&gt;name eq &quot;any&quot;;
</span><span class="cx"> 
</span><span class="cx">     if ($type-&gt;isUnion) {
</span><del>-        AddToImplIncludes(&quot;&lt;wtf/Variant.h&gt;&quot;, $conditional);
</del><ins>+        AddToIncludes(&quot;&lt;wtf/Variant.h&gt;&quot;, $includesRef, $conditional);
</ins><span class="cx"> 
</span><span class="cx">         foreach my $memberType (@{$type-&gt;subtypes}) {
</span><del>-            AddToImplIncludesForIDLType($memberType, $conditional);
</del><ins>+            AddToIncludesForIDLType($memberType, $includesRef, $conditional);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return;
</span><span class="lines">@@ -279,23 +294,23 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;IsSequenceOrFrozenArrayType($type)) {
</span><del>-        AddToImplIncludes(&quot;&lt;runtime/JSArray.h&gt;&quot;, $conditional);
-        AddToImplIncludesForIDLType(@{$type-&gt;subtypes}[0], $conditional);
</del><ins>+        AddToIncludes(&quot;&lt;runtime/JSArray.h&gt;&quot;, $includesRef, $conditional);
+        AddToIncludesForIDLType(@{$type-&gt;subtypes}[0], $includesRef, $conditional);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsExternalDictionaryType($type) || $codeGenerator-&gt;IsExternalEnumType($type)) {
</span><del>-        AddToImplIncludes(&quot;JS&quot; . $type-&gt;name . &quot;.h&quot;, $conditional);
</del><ins>+        AddToIncludes(&quot;JS&quot; . $type-&gt;name . &quot;.h&quot;, $includesRef, $conditional);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if ($type-&gt;name eq &quot;SerializedScriptValue&quot;) {
</span><del>-        AddToImplIncludes(&quot;SerializedScriptValue.h&quot;, $conditional);
</del><ins>+        AddToIncludes(&quot;SerializedScriptValue.h&quot;, $includesRef, $conditional);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($type-&gt;name eq &quot;Dictionary&quot;) {
</span><del>-        AddToImplIncludes(&quot;Dictionary.h&quot;, $conditional);
</del><ins>+        AddToIncludes(&quot;Dictionary.h&quot;, $includesRef, $conditional);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -302,16 +317,22 @@
</span><span class="cx"> 
</span><span class="cx"> sub AddToImplIncludes
</span><span class="cx"> {
</span><del>-    my $header = shift;
-    my $conditional = shift;
</del><ins>+    my ($header, $conditional) = @_;
</ins><span class="cx"> 
</span><ins>+    AddToIncludes($header, \%implIncludes, $conditional);
+}
+
+sub AddToIncludes
+{
+    my ($header, $includesRef, $conditional) = @_;
+
</ins><span class="cx">     if (not $conditional) {
</span><del>-        $implIncludes{$header} = 1;
-    } elsif (not exists($implIncludes{$header})) {
-        $implIncludes{$header} = $conditional;
</del><ins>+        $includesRef-&gt;{$header} = 1;
+    } elsif (not exists($includesRef-&gt;{$header})) {
+        $includesRef-&gt;{$header} = $conditional;
</ins><span class="cx">     } else {
</span><del>-        my $oldValue = $implIncludes{$header};
-        $implIncludes{$header} = &quot;$oldValue|$conditional&quot; if $oldValue ne 1;
</del><ins>+        my $oldValue = $includesRef-&gt;{$header};
+        $includesRef-&gt;{$header} = &quot;$oldValue|$conditional&quot; if $oldValue ne 1;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2028,7 +2049,7 @@
</span><span class="cx">     };
</span><span class="cx">     my $isCallbackFunctionOrDictionary = sub {
</span><span class="cx">         my $type = shift;
</span><del>-        return $codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type) || &amp;$isDictionary($type);
</del><ins>+        return $codeGenerator-&gt;IsCallbackFunction($type) || &amp;$isDictionary($type);
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     # Two types are distinguishable for overload resolution if at most one of the two includes a nullable type.
</span><span class="lines">@@ -2183,7 +2204,7 @@
</span><span class="cx">     };
</span><span class="cx">     my $isObjectOrCallbackFunctionParameter = sub {
</span><span class="cx">         my ($type, $optionality) = @_;
</span><del>-        return $type-&gt;name eq &quot;object&quot; || $codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type);
</del><ins>+        return $type-&gt;name eq &quot;object&quot; || $codeGenerator-&gt;IsCallbackFunction($type);
</ins><span class="cx">     };
</span><span class="cx">     my $isSequenceOrFrozenArrayParameter = sub {
</span><span class="cx">         my ($type, $optionality) = @_;
</span><span class="lines">@@ -2193,7 +2214,7 @@
</span><span class="cx">         my ($type, $optionality) = @_;
</span><span class="cx">         return 1 if &amp;$isDictionaryParameter($type, $optionality);
</span><span class="cx">         return 1 if $type-&gt;name eq &quot;object&quot;;
</span><del>-        return 1 if $codeGenerator-&gt;IsCallbackInterface($type) &amp;&amp; !$codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type);
</del><ins>+        return 1 if $codeGenerator-&gt;IsCallbackInterface($type) &amp;&amp; !$codeGenerator-&gt;IsCallbackFunction($type);
</ins><span class="cx">         return 0;
</span><span class="cx">     };
</span><span class="cx">     my $isBooleanParameter = sub {
</span><span class="lines">@@ -4444,13 +4465,13 @@
</span><span class="cx">             $argument-&gt;default(&quot;null&quot;) if $type-&gt;isNullable;
</span><span class="cx"> 
</span><span class="cx">             # For callback arguments, the generated bindings treat undefined as null, so use null as implicit default value.
</span><del>-            $argument-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($type);
</del><ins>+            $argument-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($type) || $codeGenerator-&gt;IsCallbackFunction($type);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         my $name = $argument-&gt;name;
</span><span class="cx">         my $value = $name;
</span><span class="cx"> 
</span><del>-        if ($codeGenerator-&gt;IsCallbackInterface($type)) {
</del><ins>+        if ($codeGenerator-&gt;IsCallbackInterface($type) || $codeGenerator-&gt;IsCallbackFunction($type)) {
</ins><span class="cx">             my $callbackClassName = GetCallbackClassName($type-&gt;name);
</span><span class="cx">             my $typeName = $type-&gt;name;
</span><span class="cx">             $implIncludes{&quot;$callbackClassName.h&quot;} = 1;
</span><span class="lines">@@ -4457,7 +4478,7 @@
</span><span class="cx">             if ($argument-&gt;isOptional) {
</span><span class="cx">                 push(@$outputArray, &quot;    RefPtr&lt;$typeName&gt; $name;\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;    if (!state-&gt;argument($argumentIndex).isUndefinedOrNull()) {\n&quot;);
</span><del>-                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
</del><ins>+                if ($codeGenerator-&gt;IsCallbackFunction($type)) {
</ins><span class="cx">                     push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argumentIndex).isFunction())\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argumentIndex).isObject())\n&quot;);
</span><span class="lines">@@ -4472,7 +4493,7 @@
</span><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;);
</span><span class="cx">             } else {
</span><span class="cx">                 die &quot;CallbackInterface does not support Variadic arguments&quot; if $argument-&gt;isVariadic;
</span><del>-                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
</del><ins>+                if ($codeGenerator-&gt;IsCallbackFunction($type)) {
</ins><span class="cx">                     push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;uncheckedArgument($argumentIndex).isFunction()))\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;uncheckedArgument($argumentIndex).isObject()))\n&quot;);
</span><span class="lines">@@ -4676,138 +4697,210 @@
</span><span class="cx">     push(@implContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GenerateCallbackHeader
</del><ins>+sub GenerateCallbackFunctionHeader
</ins><span class="cx"> {
</span><del>-    my ($object, $interface, $enumerations, $dictionaries) = @_;
</del><ins>+    my ($object, $callbackFunction, $enumerations, $dictionaries) = @_;
</ins><span class="cx"> 
</span><del>-    my $interfaceName = $interface-&gt;type-&gt;name;
-    my $className = &quot;JS$interfaceName&quot;;
</del><ins>+    push(@headerContentHeader, GenerateHeaderContentHeader($callbackFunction));
</ins><span class="cx"> 
</span><del>-    # - Add default header template and header protection
-    push(@headerContentHeader, GenerateHeaderContentHeader($interface));
</del><ins>+    push(@headerContent, &quot;\nnamespace WebCore {\n\n&quot;);
</ins><span class="cx"> 
</span><del>-    $headerIncludes{&quot;ActiveDOMCallback.h&quot;} = 1;
-    $headerIncludes{&quot;$interfaceName.h&quot;} = 1;
-    $headerIncludes{&quot;JSCallbackData.h&quot;} = 1;
-    $headerIncludes{&quot;&lt;wtf/Forward.h&gt;&quot;} = 1;
</del><ins>+    my @functions = ();
+    push(@functions, $callbackFunction-&gt;operation);
+    my @constants = ();
</ins><span class="cx"> 
</span><ins>+    $object-&gt;GenerateCallbackHeaderContent($callbackFunction, \@functions, \@constants, \@headerContent, \%headerIncludes);
+
+    push(@headerContent, GenerateEnumerationsHeaderContent($callbackFunction, $enumerations));
+    push(@headerContent, GenerateDictionariesHeaderContent($callbackFunction, $dictionaries));
+
+    push(@headerContent, &quot;} // namespace WebCore\n&quot;);
+
+    my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($callbackFunction);
+    push(@headerContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
+}
+
+sub GenerateCallbackFunctionImplementation
+{
+    my ($object, $callbackFunction, $enumerations, $dictionaries) = @_;
+
+    push(@implContentHeader, GenerateImplementationContentHeader($callbackFunction));
+
+    push(@implContent, &quot;\nusing namespace JSC;\n\n&quot;);
+    push(@implContent, &quot;namespace WebCore {\n\n&quot;);
+
+    push(@implContent, GenerateEnumerationsImplementationContent($callbackFunction, $enumerations));
+    push(@implContent, GenerateDictionariesImplementationContent($callbackFunction, $dictionaries));
+
+    my @functions = ();
+    push(@functions, $callbackFunction-&gt;operation);
+    my @constants = ();
+
+    $object-&gt;GenerateCallbackImplementationContent($callbackFunction, \@functions, \@constants, \@implContent, \%implIncludes);
+
+    push(@implContent, &quot;} // namespace WebCore\n&quot;);
+
+    my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($callbackFunction);
+    push(@implContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
+}
+
+sub GenerateCallbackInterfaceHeader
+{
+    my ($object, $callbackInterface, $enumerations, $dictionaries) = @_;
+
+    push(@headerContentHeader, GenerateHeaderContentHeader($callbackInterface));
+
</ins><span class="cx">     push(@headerContent, &quot;\nnamespace WebCore {\n\n&quot;);
</span><del>-    push(@headerContent, &quot;class $className : public $interfaceName, public ActiveDOMCallback {\n&quot;);
-    push(@headerContent, &quot;public:\n&quot;);
</del><ins>+    
+    $object-&gt;GenerateCallbackHeaderContent($callbackInterface, $callbackInterface-&gt;functions, $callbackInterface-&gt;constants, \@headerContent, \%headerIncludes);
</ins><span class="cx"> 
</span><ins>+    push(@headerContent, GenerateEnumerationsHeaderContent($callbackInterface, $enumerations));
+    push(@headerContent, GenerateDictionariesHeaderContent($callbackInterface, $dictionaries));
+
+    push(@headerContent, &quot;} // namespace WebCore\n&quot;);
+
+    my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($callbackInterface);
+    push(@headerContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
+}
+
+sub GenerateCallbackInterfaceImplementation
+{
+    my ($object, $callbackInterface, $enumerations, $dictionaries) = @_;
+
+    push(@implContentHeader, GenerateImplementationContentHeader($callbackInterface));
+
+    push(@implContent, &quot;\nusing namespace JSC;\n\n&quot;);
+    push(@implContent, &quot;namespace WebCore {\n\n&quot;);
+
+    push(@implContent, GenerateEnumerationsImplementationContent($callbackInterface, $enumerations));
+    push(@implContent, GenerateDictionariesImplementationContent($callbackInterface, $dictionaries));
+
+    $object-&gt;GenerateCallbackImplementationContent($callbackInterface, $callbackInterface-&gt;functions, $callbackInterface-&gt;constants, \@implContent, \%implIncludes);
+
+    push(@implContent, &quot;} // namespace WebCore\n&quot;);
+
+    my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($callbackInterface);
+    push(@implContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
+}
+
+sub GenerateCallbackHeaderContent
+{
+    my ($object, $interfaceOrCallback, $functions, $constants, $contentRef, $includesRef) = @_;
+
+    my $name = $interfaceOrCallback-&gt;type-&gt;name;
+    my $callbackDataType = GetJSCallbackDataType($interfaceOrCallback);
+    my $className = &quot;JS${name}&quot;;
+
+    $includesRef-&gt;{&quot;ActiveDOMCallback.h&quot;} = 1;
+    $includesRef-&gt;{&quot;JSCallbackData.h&quot;} = 1;
+    $includesRef-&gt;{&quot;&lt;wtf/Forward.h&gt;&quot;} = 1;
+    $includesRef-&gt;{&quot;${name}.h&quot;} = 1;
+
+    push(@$contentRef, &quot;class $className : public ${name}, public ActiveDOMCallback {\n&quot;);
+    push(@$contentRef, &quot;public:\n&quot;);
+
</ins><span class="cx">     # The static create() method.
</span><del>-    push(@headerContent, &quot;    static Ref&lt;$className&gt; create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)\n&quot;);
-    push(@headerContent, &quot;    {\n&quot;);
-    push(@headerContent, &quot;        return adoptRef(*new $className(callback, globalObject));\n&quot;);
-    push(@headerContent, &quot;    }\n\n&quot;);
</del><ins>+    push(@$contentRef, &quot;    static Ref&lt;$className&gt; create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)\n&quot;);
+    push(@$contentRef, &quot;    {\n&quot;);
+    push(@$contentRef, &quot;        return adoptRef(*new ${className}(callback, globalObject));\n&quot;);
+    push(@$contentRef, &quot;    }\n\n&quot;);
</ins><span class="cx"> 
</span><del>-    push(@headerContent, &quot;    virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }\n\n&quot;);
</del><ins>+    push(@$contentRef, &quot;    virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }\n\n&quot;);
</ins><span class="cx"> 
</span><del>-    push(@headerContent, &quot;    virtual ~$className();\n&quot;);
</del><ins>+    push(@$contentRef, &quot;    virtual ~$className();\n&quot;);
</ins><span class="cx"> 
</span><del>-    push(@headerContent, &quot;    &quot; . GetJSCallbackDataType($interface) . &quot;* callbackData() { return m_data; }\n&quot;);
</del><ins>+    push(@$contentRef, &quot;    ${callbackDataType}* callbackData() { return m_data; }\n&quot;);
</ins><span class="cx"> 
</span><del>-    push(@headerContent, &quot;    static JSC::JSValue getConstructor(JSC::VM&amp;, const JSC::JSGlobalObject*);\n&quot;) if @{$interface-&gt;constants};
</del><ins>+    push(@$contentRef, &quot;    static JSC::JSValue getConstructor(JSC::VM&amp;, const JSC::JSGlobalObject*);\n&quot;) if @{$constants};
</ins><span class="cx"> 
</span><del>-    push(@headerContent, &quot;    virtual bool operator==(const $interfaceName&amp;) const;\n\n&quot;) if $interface-&gt;extendedAttributes-&gt;{CallbackNeedsOperatorEqual};
</del><ins>+    push(@$contentRef, &quot;    virtual bool operator==(const ${name}&amp;) const;\n\n&quot;) if $interfaceOrCallback-&gt;extendedAttributes-&gt;{CallbackNeedsOperatorEqual};
</ins><span class="cx"> 
</span><span class="cx">     # Functions
</span><del>-    my $numFunctions = @{$interface-&gt;functions};
</del><ins>+    my $numFunctions = @{$functions};
</ins><span class="cx">     if ($numFunctions &gt; 0) {
</span><del>-        push(@headerContent, &quot;\n    // Functions\n&quot;);
-        foreach my $function (@{$interface-&gt;functions}) {
</del><ins>+        push(@$contentRef, &quot;\n    // Functions\n&quot;);
+        foreach my $function (@{$functions}) {
</ins><span class="cx">             my @arguments = ();
</span><span class="cx">             foreach my $argument (@{$function-&gt;arguments}) {
</span><del>-                push(@arguments, GetNativeTypeForCallbacks($interface, $argument-&gt;type) . &quot; &quot; . $argument-&gt;name);
</del><ins>+                push(@arguments, GetNativeTypeForCallbacks($argument-&gt;type, $interfaceOrCallback) . &quot; &quot; . $argument-&gt;name);
</ins><span class="cx">             }
</span><del>-            push(@headerContent, &quot;    virtual &quot; . GetNativeTypeForCallbacks($interface, $function-&gt;type) . &quot; &quot; . $function-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @arguments) . &quot;);\n&quot;);
</del><ins>+
+            # FIXME: Add support for non-void return types (the bool actually is returning exception state), for non-custom functions.
+            my $nativeReturnType = $function-&gt;extendedAttributes-&gt;{Custom} ? GetNativeTypeForCallbacks($function-&gt;type, $interfaceOrCallback) : &quot;bool&quot;;
+            
+            # FIXME: Change the default name (used for callback functions) to something other than handleEvent. It makes little sense.
+            my $functionName = $function-&gt;name ? $function-&gt;name : &quot;handleEvent&quot;;
+
+            push(@$contentRef, &quot;    virtual ${nativeReturnType} ${functionName}(&quot; . join(&quot;, &quot;, @arguments) . &quot;);\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    push(@headerContent, &quot;\nprivate:\n&quot;);
</del><ins>+    push(@$contentRef, &quot;\nprivate:\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     # Constructor
</span><del>-    push(@headerContent, &quot;    $className(JSC::JSObject* callback, JSDOMGlobalObject*);\n\n&quot;);
</del><ins>+    push(@$contentRef, &quot;    $className(JSC::JSObject* callback, JSDOMGlobalObject*);\n\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     # Private members
</span><del>-    push(@headerContent, &quot;    &quot; . GetJSCallbackDataType($interface) . &quot;* m_data;\n&quot;);
-    push(@headerContent, &quot;};\n\n&quot;);
</del><ins>+    push(@$contentRef, &quot;    ${callbackDataType}* m_data;\n&quot;);
+    push(@$contentRef, &quot;};\n\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     # toJS().
</span><del>-    push(@headerContent, &quot;JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName&amp;);\n&quot;);
-    push(@headerContent, &quot;inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, $interfaceName* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }\n\n&quot;);
-
-    push(@headerContent, GenerateEnumerationsHeaderContent($interface, $enumerations));
-    push(@headerContent, GenerateDictionariesHeaderContent($interface, $dictionaries));
-
-    push(@headerContent, &quot;} // namespace WebCore\n&quot;);
-
-    my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($interface);
-    push(@headerContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
</del><ins>+    push(@$contentRef, &quot;JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, ${name}&amp;);\n&quot;);
+    push(@$contentRef, &quot;inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, ${name}* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }\n\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GenerateCallbackImplementation
</del><ins>+sub GenerateCallbackImplementationContent
</ins><span class="cx"> {
</span><del>-    my ($object, $interface, $enumerations, $dictionaries) = @_;
</del><ins>+    my ($object, $interfaceOrCallback, $functions, $constants, $contentRef, $includesRef) = @_;
</ins><span class="cx"> 
</span><del>-    my $interfaceName = $interface-&gt;type-&gt;name;
-    my $visibleInterfaceName = $codeGenerator-&gt;GetVisibleInterfaceName($interface);
-    my $className = &quot;JS$interfaceName&quot;;
</del><ins>+    my $name = $interfaceOrCallback-&gt;type-&gt;name;
+    my $callbackDataType = GetJSCallbackDataType($interfaceOrCallback);
+    my $visibleName = $codeGenerator-&gt;GetVisibleInterfaceName($interfaceOrCallback);
+    my $className = &quot;JS${name}&quot;;
</ins><span class="cx"> 
</span><del>-    # - Add default header template
-    push(@implContentHeader, GenerateImplementationContentHeader($interface));
</del><ins>+    $includesRef-&gt;{&quot;ScriptExecutionContext.h&quot;} = 1;
+    $includesRef-&gt;{&quot;&lt;runtime/JSLock.h&gt;&quot;} = 1;
</ins><span class="cx"> 
</span><del>-    $implIncludes{&quot;ScriptExecutionContext.h&quot;} = 1;
-    $implIncludes{&quot;&lt;runtime/JSLock.h&gt;&quot;} = 1;
-
-    @implContent = ();
-
-    push(@implContent, &quot;\nusing namespace JSC;\n\n&quot;);
-    push(@implContent, &quot;namespace WebCore {\n\n&quot;);
-
-    push(@implContent, GenerateEnumerationsImplementationContent($interface, $enumerations));
-    push(@implContent, GenerateDictionariesImplementationContent($interface, $dictionaries));
-
</del><span class="cx">     # Constructor
</span><del>-    push(@implContent, &quot;${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n&quot;);
-    if ($interface-&gt;extendedAttributes-&gt;{CallbackNeedsOperatorEqual}) {
-        push(@implContent, &quot;    : ${interfaceName}(${className}Type)\n&quot;);
</del><ins>+    push(@$contentRef, &quot;${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n&quot;);
+    if ($interfaceOrCallback-&gt;extendedAttributes-&gt;{CallbackNeedsOperatorEqual}) {
+        push(@$contentRef, &quot;    : ${name}(${className}Type)\n&quot;);
</ins><span class="cx">     } else {
</span><del>-        push(@implContent, &quot;    : ${interfaceName}()\n&quot;);
</del><ins>+        push(@$contentRef, &quot;    : ${name}()\n&quot;);
</ins><span class="cx">     }
</span><del>-    push(@implContent, &quot;    , ActiveDOMCallback(globalObject-&gt;scriptExecutionContext())\n&quot;);
-    push(@implContent, &quot;    , m_data(new &quot; . GetJSCallbackDataType($interface) . &quot;(callback, this))\n&quot;);
-    push(@implContent, &quot;{\n&quot;);
-    push(@implContent, &quot;}\n\n&quot;);
</del><ins>+    push(@$contentRef, &quot;    , ActiveDOMCallback(globalObject-&gt;scriptExecutionContext())\n&quot;);
+    push(@$contentRef, &quot;    , m_data(new ${callbackDataType}(callback, this))\n&quot;);
+    push(@$contentRef, &quot;{\n&quot;);
+    push(@$contentRef, &quot;}\n\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     # Destructor
</span><del>-    push(@implContent, &quot;${className}::~${className}()\n&quot;);
-    push(@implContent, &quot;{\n&quot;);
-    push(@implContent, &quot;    ScriptExecutionContext* context = scriptExecutionContext();\n&quot;);
-    push(@implContent, &quot;    // When the context is destroyed, all tasks with a reference to a callback\n&quot;);
-    push(@implContent, &quot;    // should be deleted. So if the context is 0, we are on the context thread.\n&quot;);
-    push(@implContent, &quot;    if (!context || context-&gt;isContextThread())\n&quot;);
-    push(@implContent, &quot;        delete m_data;\n&quot;);
-    push(@implContent, &quot;    else\n&quot;);
-    push(@implContent, &quot;        context-&gt;postTask(DeleteCallbackDataTask(m_data));\n&quot;);
-    push(@implContent, &quot;#ifndef NDEBUG\n&quot;);
-    push(@implContent, &quot;    m_data = nullptr;\n&quot;);
-    push(@implContent, &quot;#endif\n&quot;);
-    push(@implContent, &quot;}\n\n&quot;);
</del><ins>+    push(@$contentRef, &quot;${className}::~${className}()\n&quot;);
+    push(@$contentRef, &quot;{\n&quot;);
+    push(@$contentRef, &quot;    ScriptExecutionContext* context = scriptExecutionContext();\n&quot;);
+    push(@$contentRef, &quot;    // When the context is destroyed, all tasks with a reference to a callback\n&quot;);
+    push(@$contentRef, &quot;    // should be deleted. So if the context is 0, we are on the context thread.\n&quot;);
+    push(@$contentRef, &quot;    if (!context || context-&gt;isContextThread())\n&quot;);
+    push(@$contentRef, &quot;        delete m_data;\n&quot;);
+    push(@$contentRef, &quot;    else\n&quot;);
+    push(@$contentRef, &quot;        context-&gt;postTask(DeleteCallbackDataTask(m_data));\n&quot;);
+    push(@$contentRef, &quot;#ifndef NDEBUG\n&quot;);
+    push(@$contentRef, &quot;    m_data = nullptr;\n&quot;);
+    push(@$contentRef, &quot;#endif\n&quot;);
+    push(@$contentRef, &quot;}\n\n&quot;);
</ins><span class="cx"> 
</span><del>-    if ($interface-&gt;extendedAttributes-&gt;{CallbackNeedsOperatorEqual}) {
-        push(@implContent, &quot;bool ${className}::operator==(const ${interfaceName}&amp; other) const\n&quot;);
-        push(@implContent, &quot;{\n&quot;);
-        push(@implContent, &quot;    if (other.type() != type())\n&quot;);
-        push(@implContent, &quot;        return false;\n&quot;);
-        push(@implContent, &quot;    return static_cast&lt;const ${className}*&gt;(&amp;other)-&gt;m_data-&gt;callback() == m_data-&gt;callback();\n&quot;);
-        push(@implContent, &quot;}\n\n&quot;);
</del><ins>+    if ($interfaceOrCallback-&gt;extendedAttributes-&gt;{CallbackNeedsOperatorEqual}) {
+        push(@$contentRef, &quot;bool ${className}::operator==(const ${name}&amp; other) const\n&quot;);
+        push(@$contentRef, &quot;{\n&quot;);
+        push(@$contentRef, &quot;    if (other.type() != type())\n&quot;);
+        push(@$contentRef, &quot;        return false;\n&quot;);
+        push(@$contentRef, &quot;    return static_cast&lt;const ${className}*&gt;(&amp;other)-&gt;m_data-&gt;callback() == m_data-&gt;callback();\n&quot;);
+        push(@$contentRef, &quot;}\n\n&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Constants.
</span><del>-    my $numConstants = @{$interface-&gt;constants};
</del><ins>+    my $numConstants = @{$constants};
</ins><span class="cx">     if ($numConstants &gt; 0) {
</span><del>-        GenerateConstructorDeclaration(\@implContent, $className, $interface, $interfaceName);
</del><ins>+        GenerateConstructorDeclaration($contentRef, $className, $interfaceOrCallback, $name);
</ins><span class="cx"> 
</span><span class="cx">         my $hashSize = 0;
</span><span class="cx">         my $hashName = $className . &quot;ConstructorTable&quot;;
</span><span class="lines">@@ -4818,7 +4911,7 @@
</span><span class="cx">         my @hashSpecials = ();
</span><span class="cx">         my %conditionals = ();
</span><span class="cx"> 
</span><del>-        foreach my $constant (@{$interface-&gt;constants}) {
</del><ins>+        foreach my $constant (@{$constants}) {
</ins><span class="cx">             my $name = $constant-&gt;name;
</span><span class="cx">             push(@hashKeys, $name);
</span><span class="cx">             push(@hashValue1, $constant-&gt;value);
</span><span class="lines">@@ -4835,93 +4928,71 @@
</span><span class="cx">         }
</span><span class="cx">         $object-&gt;GenerateHashTable($hashName, $hashSize, \@hashKeys, \@hashSpecials, \@hashValue1, \@hashValue2, \%conditionals, 1) if $hashSize &gt; 0;
</span><span class="cx"> 
</span><del>-        push(@implContent, $codeGenerator-&gt;GenerateCompileTimeCheckForEnumsIfNeeded($interface));
</del><ins>+        push(@$contentRef, $codeGenerator-&gt;GenerateCompileTimeCheckForEnumsIfNeeded($interfaceOrCallback));
</ins><span class="cx"> 
</span><del>-        GenerateConstructorDefinitions(\@implContent, $className, &quot;&quot;, $visibleInterfaceName, $interface);
</del><ins>+        GenerateConstructorDefinitions($contentRef, $className, &quot;&quot;, $visibleName, $interfaceOrCallback);
</ins><span class="cx"> 
</span><del>-        push(@implContent, &quot;JSValue ${className}::getConstructor(VM&amp; vm, const JSGlobalObject* globalObject)\n{\n&quot;);
-        push(@implContent, &quot;    return getDOMConstructor&lt;${className}Constructor&gt;(vm, *jsCast&lt;const JSDOMGlobalObject*&gt;(globalObject));\n&quot;);
-        push(@implContent, &quot;}\n\n&quot;);
</del><ins>+        push(@$contentRef, &quot;JSValue ${className}::getConstructor(VM&amp; vm, const JSGlobalObject* globalObject)\n{\n&quot;);
+        push(@$contentRef, &quot;    return getDOMConstructor&lt;${className}Constructor&gt;(vm, *jsCast&lt;const JSDOMGlobalObject*&gt;(globalObject));\n&quot;);
+        push(@$contentRef, &quot;}\n\n&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Functions.
</span><del>-    my $numFunctions = @{$interface-&gt;functions};
</del><ins>+    my $numFunctions = @{$functions};
</ins><span class="cx">     if ($numFunctions &gt; 0) {
</span><del>-        push(@implContent, &quot;\n// Functions\n&quot;);
-        foreach my $function (@{$interface-&gt;functions}) {
-            my @params = @{$function-&gt;arguments};
-            if ($function-&gt;extendedAttributes-&gt;{Custom} || GetNativeType($interface, $function-&gt;type) ne &quot;bool&quot;) {
-                next;
-            }
</del><ins>+        foreach my $function (@{$functions}) {
+            next if $function-&gt;extendedAttributes-&gt;{Custom};
+        
+            assert(&quot;Unsupport return type: &quot; . $function-&gt;type-&gt;name . &quot;.&quot;) unless $function-&gt;type-&gt;name eq &quot;void&quot;;
</ins><span class="cx"> 
</span><del>-            AddToImplIncludesForIDLType($function-&gt;type);
-            my $functionName = $function-&gt;name;
-            push(@implContent, &quot;\n&quot; . GetNativeTypeForCallbacks($interface, $function-&gt;type) . &quot; ${className}::${functionName}(&quot;);
</del><ins>+            AddToIncludesForIDLType($function-&gt;type, $includesRef);
+            
+            # FIXME: Change the default name (used for callback functions) to something other than handleEvent. It makes little sense.
+            my $functionName = $function-&gt;name ? $function-&gt;name : &quot;handleEvent&quot;;
</ins><span class="cx"> 
</span><span class="cx">             my @args = ();
</span><del>-            my @argsCheck = ();
-            foreach my $param (@params) {
-                my $paramName = $param-&gt;name;
-                AddToImplIncludesForIDLType($param-&gt;type, 1);
-                push(@args, GetNativeTypeForCallbacks($interface, $param-&gt;type) . &quot; &quot; . $paramName);
</del><ins>+            foreach my $argument (@{$function-&gt;arguments}) {
+                AddToIncludesForIDLType($argument-&gt;type, $includesRef, 1);
+                push(@args, GetNativeTypeForCallbacks($argument-&gt;type, $interfaceOrCallback) . &quot; &quot; . $argument-&gt;name);
</ins><span class="cx">             }
</span><del>-            push(@implContent, join(&quot;, &quot;, @args));
-            push(@implContent, &quot;)\n&quot;);
</del><ins>+            push(@$contentRef, &quot;bool ${className}::${functionName}(&quot; . join(&quot;, &quot;, @args) . &quot;)\n&quot;);
+            push(@$contentRef, &quot;{\n&quot;);
+            push(@$contentRef, &quot;    if (!canInvokeCallback())\n&quot;);
+            push(@$contentRef, &quot;        return true;\n\n&quot;);
+            push(@$contentRef, &quot;    Ref&lt;$className&gt; protectedThis(*this);\n\n&quot;);
+            push(@$contentRef, &quot;    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());\n\n&quot;);
+            push(@$contentRef, &quot;    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();\n&quot;);
+            push(@$contentRef, &quot;    MarkedArgumentBuffer args;\n&quot;);
</ins><span class="cx"> 
</span><del>-            push(@implContent, &quot;{\n&quot;);
-            push(@implContent, @argsCheck) if @argsCheck;
-            push(@implContent, &quot;    if (!canInvokeCallback())\n&quot;);
-            push(@implContent, &quot;        return true;\n\n&quot;);
-            push(@implContent, &quot;    Ref&lt;$className&gt; protectedThis(*this);\n\n&quot;);
-            push(@implContent, &quot;    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());\n\n&quot;);
-            push(@implContent, &quot;    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();\n&quot;);
-            push(@implContent, &quot;    MarkedArgumentBuffer args;\n&quot;);
-
-            foreach my $param (@params) {
-                my $paramName = $param-&gt;name;
-                push(@implContent, &quot;    args.append(&quot; . NativeToJSValueUsingPointers($param, 1, $interface, $paramName, &quot;m_data&quot;) . &quot;);\n&quot;);
</del><ins>+            foreach my $argument (@{$function-&gt;arguments}) {
+                push(@$contentRef, &quot;    args.append(&quot; . NativeToJSValueUsingPointers($argument, 1, $interfaceOrCallback, $argument-&gt;name, &quot;m_data&quot;) . &quot;);\n&quot;);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            push(@implContent, &quot;\n    NakedPtr&lt;JSC::Exception&gt; returnedException;\n&quot;);
</del><ins>+            push(@$contentRef, &quot;\n    NakedPtr&lt;JSC::Exception&gt; returnedException;\n&quot;);
</ins><span class="cx"> 
</span><del>-            my $propertyToLookup = &quot;Identifier::fromString(state, \&quot;${functionName}\&quot;)&quot;;
-            my $invokeMethod = &quot;JSCallbackData::CallbackType::FunctionOrObject&quot;;
-            if ($codeGenerator-&gt;ExtendedAttributeContains($interface-&gt;extendedAttributes-&gt;{Callback}, &quot;FunctionOnly&quot;)) {
-                # For callback functions, do not look up callable property on the user object.
-                # https://heycam.github.io/webidl/#es-callback-function
-                $invokeMethod = &quot;JSCallbackData::CallbackType::Function&quot;;
-                $propertyToLookup = &quot;Identifier()&quot;;
-                push(@implContent, &quot;    UNUSED_PARAM(state);\n&quot;);
-            } elsif ($numFunctions &gt; 1) {
-                # The callback interface has more than one operation so we should not call the user object as a function.
-                # instead, we should look for a property with the same name as the operation on the user object.
-                # https://heycam.github.io/webidl/#es-user-objects
-                $invokeMethod = &quot;JSCallbackData::CallbackType::Object&quot;;
</del><ins>+            if (ref($interfaceOrCallback) eq &quot;IDLCallbackFunction&quot;) {
+                push(@$contentRef, &quot;    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);\n&quot;);
+            } else {
+                my $callbackType = $numFunctions &gt; 1 ? &quot;Object&quot; : &quot;FunctionOrObject&quot;;
+                push(@$contentRef, &quot;    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::${callbackType}, Identifier::fromString(state, \&quot;${functionName}\&quot;), returnedException);\n&quot;);
</ins><span class="cx">             }
</span><del>-            push(@implContent, &quot;    m_data-&gt;invokeCallback(args, $invokeMethod, $propertyToLookup, returnedException);\n&quot;);
</del><span class="cx"> 
</span><span class="cx">             # FIXME: We currently just report the exception. We should probably add an extended attribute to indicate when
</span><span class="cx">             # we want the exception to be rethrown instead.
</span><del>-            push(@implContent, &quot;    if (returnedException)\n&quot;);
-            push(@implContent, &quot;        reportException(state, returnedException);\n&quot;);
-            push(@implContent, &quot;    return !returnedException;\n&quot;);
-            push(@implContent, &quot;}\n&quot;);
</del><ins>+            push(@$contentRef, &quot;    if (returnedException)\n&quot;);
+            push(@$contentRef, &quot;        reportException(state, returnedException);\n&quot;);
+            push(@$contentRef, &quot;    return !returnedException;\n&quot;);
+            push(@$contentRef, &quot;}\n\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # toJS() implementation.
</span><del>-    push(@implContent, &quot;\nJSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName&amp; impl)\n&quot;);
-    push(@implContent, &quot;{\n&quot;);
-    push(@implContent, &quot;    if (!static_cast&lt;${className}&amp;&gt;(impl).callbackData())\n&quot;);
-    push(@implContent, &quot;        return jsNull();\n\n&quot;);
-    push(@implContent, &quot;    return static_cast&lt;${className}&amp;&gt;(impl).callbackData()-&gt;callback();\n\n&quot;);
-    push(@implContent, &quot;}\n&quot;);
-
-    push(@implContent, &quot;\n}\n&quot;);
-    my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($interface);
-    push(@implContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
-
-    push(@implContent, split(&quot;\r&quot;, $endAppleCopyright)) if $interface-&gt;extendedAttributes-&gt;{AppleCopyright};
</del><ins>+    push(@$contentRef, &quot;JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, ${name}&amp; impl)\n&quot;);
+    push(@$contentRef, &quot;{\n&quot;);
+    push(@$contentRef, &quot;    if (!static_cast&lt;${className}&amp;&gt;(impl).callbackData())\n&quot;);
+    push(@$contentRef, &quot;        return jsNull();\n\n&quot;);
+    push(@$contentRef, &quot;    return static_cast&lt;${className}&amp;&gt;(impl).callbackData()-&gt;callback();\n\n&quot;);
+    push(@$contentRef, &quot;}\n\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateImplementationFunctionCall()
</span><span class="lines">@@ -5282,7 +5353,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($parameter, $interface) = @_;
</span><span class="cx"> 
</span><del>-    return 0 if $codeGenerator-&gt;IsCallbackInterface($parameter-&gt;type);
</del><ins>+    return 0 if $codeGenerator-&gt;IsCallbackInterface($parameter-&gt;type) || $codeGenerator-&gt;IsCallbackFunction($parameter-&gt;type);
</ins><span class="cx"> 
</span><span class="cx">     my $nativeType = GetNativeType($interface, $parameter-&gt;type);
</span><span class="cx">     return $codeGenerator-&gt;ShouldPassWrapperByReference($parameter) &amp;&amp; (substr($nativeType, -1) eq '*' || $nativeType =~ /^RefPtr/);
</span><span class="lines">@@ -5300,7 +5371,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetNativeTypeForCallbacks
</span><span class="cx"> {
</span><del>-    my ($interface, $type) = @_;
</del><ins>+    my ($type, $interface) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return &quot;RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;&quot; if $type-&gt;name eq &quot;SerializedScriptValue&quot;;
</span><span class="cx">     return &quot;const String&amp;&quot; if $codeGenerator-&gt;IsStringType($type);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> CEReactions
</span><span class="cx"> CachedAttribute
</span><span class="cx"> CallbackNeedsOperatorEqual
</span><del>-Callback=FunctionOnly
</del><span class="cx"> CallWith=Document|ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow|CallerDocument|CallerWindow
</span><span class="cx"> CheckSecurity
</span><span class="cx"> CheckSecurityForNode
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">     interfaces =&gt; '@', # List of 'IDLInterface'
</span><span class="cx">     enumerations =&gt; '@', # List of 'IDLEnum'
</span><span class="cx">     dictionaries =&gt; '@', # List of 'IDLDictionary'
</span><ins>+    callbackFunctions =&gt; '@', # List of 'IDLCallbackFunction'
</ins><span class="cx">     fileName =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><span class="lines">@@ -135,7 +136,7 @@
</span><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-
</del><ins>+# https://heycam.github.io/webidl/#dfn-dictionary-member
</ins><span class="cx"> struct( IDLDictionaryMember =&gt; {
</span><span class="cx">     name =&gt; '$',
</span><span class="cx">     type =&gt; 'IDLType',
</span><span class="lines">@@ -144,7 +145,6 @@
</span><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> # https://heycam.github.io/webidl/#idl-dictionaries
</span><span class="cx"> struct( IDLDictionary =&gt; {
</span><span class="cx">     type =&gt; 'IDLType',
</span><span class="lines">@@ -153,7 +153,14 @@
</span><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-# https://heycam.github.io/webidl/#idl-enums
</del><ins>+# https://heycam.github.io/webidl/#idl-callback-functions
+struct( IDLCallbackFunction =&gt; {
+    type =&gt; '$',
+    operation =&gt; 'IDLOperation',
+    extendedAttributes =&gt; '$',
+});
+
+# https://heycam.github.io/webidl/#idl-typedefs
</ins><span class="cx"> struct( IDLTypedef =&gt; {
</span><span class="cx">     type =&gt; 'IDLType',
</span><span class="cx"> });
</span><span class="lines">@@ -276,6 +283,8 @@
</span><span class="cx">             push(@{$document-&gt;enumerations}, $definition);
</span><span class="cx">         } elsif (ref($definition) eq &quot;IDLDictionary&quot;) {
</span><span class="cx">             push(@{$document-&gt;dictionaries}, $definition);
</span><ins>+        } elsif (ref($definition) eq &quot;IDLCallbackFunction&quot;) {
+            push(@{$document-&gt;callbackFunctions}, $definition);
</ins><span class="cx">         } else {
</span><span class="cx">             die &quot;Unrecognized IDL definition kind: \&quot;&quot; . ref($definition) . &quot;\&quot;&quot;;
</span><span class="cx">         }
</span><span class="lines">@@ -467,23 +476,33 @@
</span><span class="cx">             foreach my $attribute (@{$definition-&gt;attributes}) {
</span><span class="cx">                 $attribute-&gt;type($self-&gt;typeByApplyingTypedefs($attribute-&gt;type));
</span><span class="cx">             }
</span><del>-            foreach my $function (@{$definition-&gt;functions}, @{$definition-&gt;anonymousFunctions}, @{$definition-&gt;constructors}, @{$definition-&gt;customConstructors}) {
-                if ($function-&gt;type) {
-                    $function-&gt;type($self-&gt;typeByApplyingTypedefs($function-&gt;type));
-                }
-
-                foreach my $argument (@{$function-&gt;arguments}) {
-                    $argument-&gt;type($self-&gt;typeByApplyingTypedefs($argument-&gt;type));
-                }
</del><ins>+            foreach my $operation (@{$definition-&gt;functions}, @{$definition-&gt;anonymousFunctions}, @{$definition-&gt;constructors}, @{$definition-&gt;customConstructors}) {
+                $self-&gt;applyTypedefsToOperation($operation);
</ins><span class="cx">             }
</span><span class="cx">         } elsif (ref($definition) eq &quot;IDLDictionary&quot;) {
</span><span class="cx">             foreach my $member (@{$definition-&gt;members}) {
</span><span class="cx">                 $member-&gt;type($self-&gt;typeByApplyingTypedefs($member-&gt;type));
</span><span class="cx">             }
</span><ins>+        } elsif (ref($definition) eq &quot;IDLCallbackFunction&quot;) {
+            $self-&gt;applyTypedefsToOperation($definition-&gt;operation);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub applyTypedefsToOperation
+{
+    my $self = shift;
+    my $operation = shift;
+
+    if ($operation-&gt;type) {
+        $operation-&gt;type($self-&gt;typeByApplyingTypedefs($operation-&gt;type));
+    }
+
+    foreach my $argument (@{$operation-&gt;arguments}) {
+        $argument-&gt;type($self-&gt;typeByApplyingTypedefs($argument-&gt;type));
+    }
+}
+
</ins><span class="cx"> sub typeByApplyingTypedefs
</span><span class="cx"> {
</span><span class="cx">     my $self = shift;
</span><span class="lines">@@ -950,14 +969,30 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken) {
</span><del>-        $self-&gt;assertTokenType($self-&gt;getToken(), IdentifierToken);
</del><ins>+        my $callback = IDLCallbackFunction-&gt;new();
+
+        my $nameToken = $self-&gt;getToken();
+        $self-&gt;assertTokenType($nameToken, IdentifierToken);
+
+        $callback-&gt;type(makeSimpleType($nameToken-&gt;value()));
+
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;=&quot;, __LINE__);
</span><del>-        $self-&gt;parseReturnType();
</del><ins>+
+        my $operation = IDLOperation-&gt;new();
+        $operation-&gt;type($self-&gt;parseReturnType());
+        $operation-&gt;extendedAttributes($extendedAttributeList);
+
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;(&quot;, __LINE__);
</span><del>-        $self-&gt;parseArgumentList();
</del><ins>+
+        push(@{$operation-&gt;arguments}, @{$self-&gt;parseArgumentList()});
+
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;)&quot;, __LINE__);
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;;&quot;, __LINE__);
</span><del>-        return;
</del><ins>+
+        $callback-&gt;operation($operation);
+        $callback-&gt;extendedAttributes($extendedAttributeList);
+
+        return $callback;
</ins><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,230 +0,0 @@
</span><del>-/*
-    This file is part of the WebKit open source project.
-    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include &quot;config.h&quot;
-
-#if ENABLE(SPEECH_SYNTHESIS)
-
-#include &quot;JSTestCallback.h&quot;
-
-#include &quot;JSDOMConstructor.h&quot;
-#include &quot;JSDOMConvert.h&quot;
-#include &quot;JSDOMStringList.h&quot;
-#include &quot;JSTestNode.h&quot;
-#include &quot;ScriptExecutionContext.h&quot;
-#include &quot;SerializedScriptValue.h&quot;
-#include &lt;runtime/JSLock.h&gt;
-#include &lt;runtime/ObjectPrototype.h&gt;
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSTestCallback::JSTestCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
-    : TestCallback()
-    , ActiveDOMCallback(globalObject-&gt;scriptExecutionContext())
-    , m_data(new JSCallbackDataStrong(callback, this))
-{
-}
-
-JSTestCallback::~JSTestCallback()
-{
-    ScriptExecutionContext* context = scriptExecutionContext();
-    // When the context is destroyed, all tasks with a reference to a callback
-    // should be deleted. So if the context is 0, we are on the context thread.
-    if (!context || context-&gt;isContextThread())
-        delete m_data;
-    else
-        context-&gt;postTask(DeleteCallbackDataTask(m_data));
-#ifndef NDEBUG
-    m_data = nullptr;
-#endif
-}
-
-using JSTestCallbackConstructor = JSDOMConstructorNotConstructable&lt;JSTestCallback&gt;;
-
-/* Hash table for constructor */
-
-static const HashTableValue JSTestCallbackConstructorTableValues[] =
-{
-    { &quot;CONSTANT1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
-    { &quot;CONSTANT2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
-};
-
-static_assert(TestCallback::CONSTANT1 == 1, &quot;CONSTANT1 in TestCallback does not match value from IDL&quot;);
-static_assert(TestCallback::CONSTANT2 == 2, &quot;CONSTANT2 in TestCallback does not match value from IDL&quot;);
-
-template&lt;&gt; JSValue JSTestCallbackConstructor::prototypeForStructure(JSC::VM&amp; vm, const JSDOMGlobalObject&amp; globalObject)
-{
-    UNUSED_PARAM(vm);
-    return globalObject.objectPrototype();
-}
-
-template&lt;&gt; void JSTestCallbackConstructor::initializeProperties(VM&amp; vm, JSDOMGlobalObject&amp; globalObject)
-{
-    UNUSED_PARAM(globalObject);
-    putDirect(vm, vm.propertyNames-&gt;name, jsNontrivialString(&amp;vm, String(ASCIILiteral(&quot;TestCallback&quot;))), ReadOnly | DontEnum);
-    putDirect(vm, vm.propertyNames-&gt;length, jsNumber(0), ReadOnly | DontEnum);
-    reifyStaticProperties(vm, JSTestCallbackConstructorTableValues, *this);
-}
-
-template&lt;&gt; const ClassInfo JSTestCallbackConstructor::s_info = { &quot;TestCallback&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCallbackConstructor) };
-
-JSValue JSTestCallback::getConstructor(VM&amp; vm, const JSGlobalObject* globalObject)
-{
-    return getDOMConstructor&lt;JSTestCallbackConstructor&gt;(vm, *jsCast&lt;const JSDOMGlobalObject*&gt;(globalObject));
-}
-
-
-// Functions
-
-bool JSTestCallback::callbackWithNoParam()
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallback&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithNoParam&quot;), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallback::callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallback&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
-    args.append(toJS&lt;IDLInterface&lt;Float32Array&gt;&gt;(*state, *m_data-&gt;globalObject(), arrayParam));
-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithArrayParam&quot;), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallback::callbackWithSerializedScriptValueParam(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strArg)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallback&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
-    args.append(srzParam ? srzParam-&gt;deserialize(*state, m_data-&gt;globalObject()) : jsNull());
-    args.append(toJS&lt;IDLDOMString&gt;(*state, strArg));
-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithSerializedScriptValueParam&quot;), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallback::callbackWithStringList(DOMStringList* listParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallback&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
-    args.append(toJS&lt;IDLInterface&lt;DOMStringList&gt;&gt;(*state, *m_data-&gt;globalObject(), listParam));
-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithStringList&quot;), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallback::callbackWithBoolean(bool boolParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallback&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
-    args.append(toJS&lt;IDLBoolean&gt;(boolParam));
-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithBoolean&quot;), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallback::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallback&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
-    args.append(toJS&lt;IDLLong&gt;(longParam));
-    args.append(toJS&lt;IDLInterface&lt;TestNode&gt;&gt;(*state, *m_data-&gt;globalObject(), testNodeParam));
-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackRequiresThisToPass&quot;), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallback&amp; impl)
-{
-    if (!static_cast&lt;JSTestCallback&amp;&gt;(impl).callbackData())
-        return jsNull();
-
-    return static_cast&lt;JSTestCallback&amp;&gt;(impl).callbackData()-&gt;callback();
-
-}
-
-}
-
-#endif // ENABLE(SPEECH_SYNTHESIS)
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
-    This file is part of the WebKit open source project.
-    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#pragma once
-
-#if ENABLE(SPEECH_SYNTHESIS)
-
-#include &quot;ActiveDOMCallback.h&quot;
-#include &quot;JSCallbackData.h&quot;
-#include &quot;TestCallback.h&quot;
-#include &lt;wtf/Forward.h&gt;
-
-namespace WebCore {
-
-class JSTestCallback : public TestCallback, public ActiveDOMCallback {
-public:
-    static Ref&lt;JSTestCallback&gt; create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
-    {
-        return adoptRef(*new JSTestCallback(callback, globalObject));
-    }
-
-    virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
-
-    virtual ~JSTestCallback();
-    JSCallbackDataStrong* callbackData() { return m_data; }
-    static JSC::JSValue getConstructor(JSC::VM&amp;, const JSC::JSGlobalObject*);
-
-    // Functions
-    virtual bool callbackWithNoParam();
-    virtual bool callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam);
-    virtual bool callbackWithSerializedScriptValueParam(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strArg);
-    virtual int32_t callbackWithNonBoolReturnType(const String&amp; strArg);
-    virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
-    virtual bool callbackWithStringList(DOMStringList* listParam);
-    virtual bool callbackWithBoolean(bool boolParam);
-    virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
-
-private:
-    JSTestCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
-
-    JSCallbackDataStrong* m_data;
-};
-
-JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallback&amp;);
-inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallback* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
-
-} // namespace WebCore
-
-#endif // ENABLE(SPEECH_SYNTHESIS)
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> #include &quot;JSTestCallbackFunction.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSDOMConvert.h&quot;
</span><del>-#include &quot;JSDOMStringList.h&quot;
</del><span class="cx"> #include &quot;JSTestNode.h&quot;
</span><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><span class="lines">@@ -56,10 +55,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-// Functions
-
-bool JSTestCallbackFunction::callbackWithNoParam()
</del><ins>+bool JSTestCallbackFunction::handleEvent(RefPtr&lt;Float32Array&gt; arrayParam, RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strArg, bool boolParam, int32_t longParam, TestNode* testNodeParam)
</ins><span class="cx"> {
</span><span class="cx">     if (!canInvokeCallback())
</span><span class="cx">         return true;
</span><span class="lines">@@ -70,116 +66,14 @@
</span><span class="cx"> 
</span><span class="cx">     ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
</span><span class="cx">     MarkedArgumentBuffer args;
</span><del>-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    UNUSED_PARAM(state);
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallbackFunction&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
</del><span class="cx">     args.append(toJS&lt;IDLInterface&lt;Float32Array&gt;&gt;(*state, *m_data-&gt;globalObject(), arrayParam));
</span><del>-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    UNUSED_PARAM(state);
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithSerializedScriptValueParam(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strArg)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallbackFunction&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
</del><span class="cx">     args.append(srzParam ? srzParam-&gt;deserialize(*state, m_data-&gt;globalObject()) : jsNull());
</span><span class="cx">     args.append(toJS&lt;IDLDOMString&gt;(*state, strArg));
</span><del>-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    UNUSED_PARAM(state);
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithStringList(DOMStringList* listParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallbackFunction&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
-    args.append(toJS&lt;IDLInterface&lt;DOMStringList&gt;&gt;(*state, *m_data-&gt;globalObject(), listParam));
-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    UNUSED_PARAM(state);
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackWithBoolean(bool boolParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallbackFunction&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
</del><span class="cx">     args.append(toJS&lt;IDLBoolean&gt;(boolParam));
</span><del>-
-    NakedPtr&lt;JSC::Exception&gt; returnedException;
-    UNUSED_PARAM(state);
-    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
-    if (returnedException)
-        reportException(state, returnedException);
-    return !returnedException;
-}
-
-bool JSTestCallbackFunction::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
-{
-    if (!canInvokeCallback())
-        return true;
-
-    Ref&lt;JSTestCallbackFunction&gt; protectedThis(*this);
-
-    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
-
-    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
-    MarkedArgumentBuffer args;
</del><span class="cx">     args.append(toJS&lt;IDLLong&gt;(longParam));
</span><span class="cx">     args.append(toJS&lt;IDLInterface&lt;TestNode&gt;&gt;(*state, *m_data-&gt;globalObject(), testNodeParam));
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;JSC::Exception&gt; returnedException;
</span><del>-    UNUSED_PARAM(state);
</del><span class="cx">     m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
</span><span class="cx">     if (returnedException)
</span><span class="cx">         reportException(state, returnedException);
</span><span class="lines">@@ -195,6 +89,6 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-}
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(SPEECH_SYNTHESIS)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -42,14 +42,7 @@
</span><span class="cx">     JSCallbackDataStrong* callbackData() { return m_data; }
</span><span class="cx"> 
</span><span class="cx">     // Functions
</span><del>-    virtual bool callbackWithNoParam();
-    virtual bool callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam);
-    virtual bool callbackWithSerializedScriptValueParam(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strArg);
-    virtual int32_t callbackWithNonBoolReturnType(const String&amp; strArg);
-    virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
-    virtual bool callbackWithStringList(DOMStringList* listParam);
-    virtual bool callbackWithBoolean(bool boolParam);
-    virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
</del><ins>+    virtual bool handleEvent(RefPtr&lt;Float32Array&gt; arrayParam, RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strArg, bool boolParam, int32_t longParam, TestNode* testNodeParam);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     JSTestCallbackFunction(JSC::JSObject* callback, JSDOMGlobalObject*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include &quot;config.h&quot;
+#include &quot;JSTestCallbackFunctionWithTypedefs.h&quot;
+
+#include &quot;JSDOMConvert.h&quot;
+#include &quot;JSLONG.h&quot;
+#include &quot;ScriptExecutionContext.h&quot;
+#include &lt;runtime/JSArray.h&gt;
+#include &lt;runtime/JSLock.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSTestCallbackFunctionWithTypedefs::JSTestCallbackFunctionWithTypedefs(JSObject* callback, JSDOMGlobalObject* globalObject)
+    : TestCallbackFunctionWithTypedefs()
+    , ActiveDOMCallback(globalObject-&gt;scriptExecutionContext())
+    , m_data(new JSCallbackDataStrong(callback, this))
+{
+}
+
+JSTestCallbackFunctionWithTypedefs::~JSTestCallbackFunctionWithTypedefs()
+{
+    ScriptExecutionContext* context = scriptExecutionContext();
+    // When the context is destroyed, all tasks with a reference to a callback
+    // should be deleted. So if the context is 0, we are on the context thread.
+    if (!context || context-&gt;isContextThread())
+        delete m_data;
+    else
+        context-&gt;postTask(DeleteCallbackDataTask(m_data));
+#ifndef NDEBUG
+    m_data = nullptr;
+#endif
+}
+
+bool JSTestCallbackFunctionWithTypedefs::handleEvent(Vector&lt;RefPtr&lt;LONG&gt;&gt; sequenceArg, int32_t longArg)
+{
+    if (!canInvokeCallback())
+        return true;
+
+    Ref&lt;JSTestCallbackFunctionWithTypedefs&gt; protectedThis(*this);
+
+    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
+
+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
+    MarkedArgumentBuffer args;
+    args.append(toJS&lt;IDLSequence&lt;IDLNullable&lt;IDLInterface&lt;LONG&gt;&gt;&gt;&gt;(*state, *m_data-&gt;globalObject(), sequenceArg));
+    args.append(toJS&lt;IDLLong&gt;(longArg));
+
+    NakedPtr&lt;JSC::Exception&gt; returnedException;
+    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    if (returnedException)
+        reportException(state, returnedException);
+    return !returnedException;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackFunctionWithTypedefs&amp; impl)
+{
+    if (!static_cast&lt;JSTestCallbackFunctionWithTypedefs&amp;&gt;(impl).callbackData())
+        return jsNull();
+
+    return static_cast&lt;JSTestCallbackFunctionWithTypedefs&amp;&gt;(impl).callbackData()-&gt;callback();
+
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionWithTypedefshfromrev208407trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h (from rev 208407, trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include &quot;ActiveDOMCallback.h&quot;
+#include &quot;JSCallbackData.h&quot;
+#include &quot;TestCallbackFunctionWithTypedefs.h&quot;
+#include &lt;wtf/Forward.h&gt;
+
+namespace WebCore {
+
+class JSTestCallbackFunctionWithTypedefs : public TestCallbackFunctionWithTypedefs, public ActiveDOMCallback {
+public:
+    static Ref&lt;JSTestCallbackFunctionWithTypedefs&gt; create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
+    {
+        return adoptRef(*new JSTestCallbackFunctionWithTypedefs(callback, globalObject));
+    }
+
+    virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
+
+    virtual ~JSTestCallbackFunctionWithTypedefs();
+    JSCallbackDataStrong* callbackData() { return m_data; }
+
+    // Functions
+    virtual bool handleEvent(Vector&lt;RefPtr&lt;LONG&gt;&gt; sequenceArg, int32_t longArg);
+
+private:
+    JSTestCallbackFunctionWithTypedefs(JSC::JSObject* callback, JSDOMGlobalObject*);
+
+    JSCallbackDataStrong* m_data;
+};
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackFunctionWithTypedefs&amp;);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallbackFunctionWithTypedefs* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfacecppfromrev208407trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp (from rev 208407, trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,227 @@
</span><ins>+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include &quot;config.h&quot;
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include &quot;JSTestCallbackInterface.h&quot;
+
+#include &quot;JSDOMConstructor.h&quot;
+#include &quot;JSDOMConvert.h&quot;
+#include &quot;JSDOMStringList.h&quot;
+#include &quot;JSTestNode.h&quot;
+#include &quot;ScriptExecutionContext.h&quot;
+#include &quot;SerializedScriptValue.h&quot;
+#include &lt;runtime/JSLock.h&gt;
+#include &lt;runtime/ObjectPrototype.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSTestCallbackInterface::JSTestCallbackInterface(JSObject* callback, JSDOMGlobalObject* globalObject)
+    : TestCallbackInterface()
+    , ActiveDOMCallback(globalObject-&gt;scriptExecutionContext())
+    , m_data(new JSCallbackDataStrong(callback, this))
+{
+}
+
+JSTestCallbackInterface::~JSTestCallbackInterface()
+{
+    ScriptExecutionContext* context = scriptExecutionContext();
+    // When the context is destroyed, all tasks with a reference to a callback
+    // should be deleted. So if the context is 0, we are on the context thread.
+    if (!context || context-&gt;isContextThread())
+        delete m_data;
+    else
+        context-&gt;postTask(DeleteCallbackDataTask(m_data));
+#ifndef NDEBUG
+    m_data = nullptr;
+#endif
+}
+
+using JSTestCallbackInterfaceConstructor = JSDOMConstructorNotConstructable&lt;JSTestCallbackInterface&gt;;
+
+/* Hash table for constructor */
+
+static const HashTableValue JSTestCallbackInterfaceConstructorTableValues[] =
+{
+    { &quot;CONSTANT1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
+    { &quot;CONSTANT2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
+};
+
+static_assert(TestCallbackInterface::CONSTANT1 == 1, &quot;CONSTANT1 in TestCallbackInterface does not match value from IDL&quot;);
+static_assert(TestCallbackInterface::CONSTANT2 == 2, &quot;CONSTANT2 in TestCallbackInterface does not match value from IDL&quot;);
+
+template&lt;&gt; JSValue JSTestCallbackInterfaceConstructor::prototypeForStructure(JSC::VM&amp; vm, const JSDOMGlobalObject&amp; globalObject)
+{
+    UNUSED_PARAM(vm);
+    return globalObject.objectPrototype();
+}
+
+template&lt;&gt; void JSTestCallbackInterfaceConstructor::initializeProperties(VM&amp; vm, JSDOMGlobalObject&amp; globalObject)
+{
+    UNUSED_PARAM(globalObject);
+    putDirect(vm, vm.propertyNames-&gt;name, jsNontrivialString(&amp;vm, String(ASCIILiteral(&quot;TestCallbackInterface&quot;))), ReadOnly | DontEnum);
+    putDirect(vm, vm.propertyNames-&gt;length, jsNumber(0), ReadOnly | DontEnum);
+    reifyStaticProperties(vm, JSTestCallbackInterfaceConstructorTableValues, *this);
+}
+
+template&lt;&gt; const ClassInfo JSTestCallbackInterfaceConstructor::s_info = { &quot;TestCallbackInterface&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCallbackInterfaceConstructor) };
+
+JSValue JSTestCallbackInterface::getConstructor(VM&amp; vm, const JSGlobalObject* globalObject)
+{
+    return getDOMConstructor&lt;JSTestCallbackInterfaceConstructor&gt;(vm, *jsCast&lt;const JSDOMGlobalObject*&gt;(globalObject));
+}
+
+bool JSTestCallbackInterface::callbackWithNoParam()
+{
+    if (!canInvokeCallback())
+        return true;
+
+    Ref&lt;JSTestCallbackInterface&gt; protectedThis(*this);
+
+    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
+
+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
+    MarkedArgumentBuffer args;
+
+    NakedPtr&lt;JSC::Exception&gt; returnedException;
+    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithNoParam&quot;), returnedException);
+    if (returnedException)
+        reportException(state, returnedException);
+    return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam)
+{
+    if (!canInvokeCallback())
+        return true;
+
+    Ref&lt;JSTestCallbackInterface&gt; protectedThis(*this);
+
+    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
+
+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
+    MarkedArgumentBuffer args;
+    args.append(toJS&lt;IDLInterface&lt;Float32Array&gt;&gt;(*state, *m_data-&gt;globalObject(), arrayParam));
+
+    NakedPtr&lt;JSC::Exception&gt; returnedException;
+    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithArrayParam&quot;), returnedException);
+    if (returnedException)
+        reportException(state, returnedException);
+    return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithSerializedScriptValueParam(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strParam)
+{
+    if (!canInvokeCallback())
+        return true;
+
+    Ref&lt;JSTestCallbackInterface&gt; protectedThis(*this);
+
+    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
+
+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
+    MarkedArgumentBuffer args;
+    args.append(srzParam ? srzParam-&gt;deserialize(*state, m_data-&gt;globalObject()) : jsNull());
+    args.append(toJS&lt;IDLDOMString&gt;(*state, strParam));
+
+    NakedPtr&lt;JSC::Exception&gt; returnedException;
+    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithSerializedScriptValueParam&quot;), returnedException);
+    if (returnedException)
+        reportException(state, returnedException);
+    return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithStringList(DOMStringList* listParam)
+{
+    if (!canInvokeCallback())
+        return true;
+
+    Ref&lt;JSTestCallbackInterface&gt; protectedThis(*this);
+
+    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
+
+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
+    MarkedArgumentBuffer args;
+    args.append(toJS&lt;IDLInterface&lt;DOMStringList&gt;&gt;(*state, *m_data-&gt;globalObject(), listParam));
+
+    NakedPtr&lt;JSC::Exception&gt; returnedException;
+    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithStringList&quot;), returnedException);
+    if (returnedException)
+        reportException(state, returnedException);
+    return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackWithBoolean(bool boolParam)
+{
+    if (!canInvokeCallback())
+        return true;
+
+    Ref&lt;JSTestCallbackInterface&gt; protectedThis(*this);
+
+    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
+
+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
+    MarkedArgumentBuffer args;
+    args.append(toJS&lt;IDLBoolean&gt;(boolParam));
+
+    NakedPtr&lt;JSC::Exception&gt; returnedException;
+    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackWithBoolean&quot;), returnedException);
+    if (returnedException)
+        reportException(state, returnedException);
+    return !returnedException;
+}
+
+bool JSTestCallbackInterface::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
+{
+    if (!canInvokeCallback())
+        return true;
+
+    Ref&lt;JSTestCallbackInterface&gt; protectedThis(*this);
+
+    JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
+
+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
+    MarkedArgumentBuffer args;
+    args.append(toJS&lt;IDLLong&gt;(longParam));
+    args.append(toJS&lt;IDLInterface&lt;TestNode&gt;&gt;(*state, *m_data-&gt;globalObject(), testNodeParam));
+
+    NakedPtr&lt;JSC::Exception&gt; returnedException;
+    m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(state, &quot;callbackRequiresThisToPass&quot;), returnedException);
+    if (returnedException)
+        reportException(state, returnedException);
+    return !returnedException;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackInterface&amp; impl)
+{
+    if (!static_cast&lt;JSTestCallbackInterface&amp;&gt;(impl).callbackData())
+        return jsNull();
+
+    return static_cast&lt;JSTestCallbackInterface&amp;&gt;(impl).callbackData()-&gt;callback();
+
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SPEECH_SYNTHESIS)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackInterfacehfromrev208407trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h (from rev 208407, trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include &quot;ActiveDOMCallback.h&quot;
+#include &quot;JSCallbackData.h&quot;
+#include &quot;TestCallbackInterface.h&quot;
+#include &lt;wtf/Forward.h&gt;
+
+namespace WebCore {
+
+class JSTestCallbackInterface : public TestCallbackInterface, public ActiveDOMCallback {
+public:
+    static Ref&lt;JSTestCallbackInterface&gt; create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
+    {
+        return adoptRef(*new JSTestCallbackInterface(callback, globalObject));
+    }
+
+    virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
+
+    virtual ~JSTestCallbackInterface();
+    JSCallbackDataStrong* callbackData() { return m_data; }
+    static JSC::JSValue getConstructor(JSC::VM&amp;, const JSC::JSGlobalObject*);
+
+    // Functions
+    virtual bool callbackWithNoParam();
+    virtual bool callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam);
+    virtual bool callbackWithSerializedScriptValueParam(RefPtr&lt;SerializedScriptValue&gt;&amp;&amp; srzParam, const String&amp; strParam);
+    virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
+    virtual bool callbackWithStringList(DOMStringList* listParam);
+    virtual bool callbackWithBoolean(bool boolParam);
+    virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
+
+private:
+    JSTestCallbackInterface(JSC::JSObject* callback, JSDOMGlobalObject*);
+
+    JSCallbackDataStrong* m_data;
+};
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCallbackInterface&amp;);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCallbackInterface* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
+
+} // namespace WebCore
+
+#endif // ENABLE(SPEECH_SYNTHESIS)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx"> #include &quot;JSPromise.h&quot;
</span><span class="cx"> #include &quot;JSSVGDocument.h&quot;
</span><span class="cx"> #include &quot;JSSVGPoint.h&quot;
</span><del>-#include &quot;JSTestCallback.h&quot;
</del><span class="cx"> #include &quot;JSTestCallbackFunction.h&quot;
</span><ins>+#include &quot;JSTestCallbackInterface.h&quot;
</ins><span class="cx"> #include &quot;JSTestInterface.h&quot;
</span><span class="cx"> #include &quot;JSTestNode.h&quot;
</span><span class="cx"> #include &quot;JSTestObj.h&quot;
</span><span class="lines">@@ -1407,7 +1407,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     if (UNLIKELY(!state-&gt;uncheckedArgument(0).isObject()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 0, &quot;testCallback&quot;, &quot;TestObject&quot;, nullptr);
</span><del>-    auto testCallback = JSTestCallback::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</del><ins>+    auto testCallback = JSTestCallbackInterface::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</ins><span class="cx">     if (UNLIKELY(!state-&gt;uncheckedArgument(1).isFunction()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 1, &quot;testCallbackFunction&quot;, &quot;TestObject&quot;, nullptr);
</span><span class="cx">     auto testCallbackFunction = JSTestCallbackFunction::create(asObject(state-&gt;uncheckedArgument(1)), castedThis-&gt;globalObject());
</span><span class="lines">@@ -6292,7 +6292,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     if (UNLIKELY(!state-&gt;uncheckedArgument(0).isObject()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 0, &quot;callback&quot;, &quot;TestObject&quot;, &quot;methodWithCallbackArg&quot;);
</span><del>-    auto callback = JSTestCallback::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</del><ins>+    auto callback = JSTestCallbackInterface::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</ins><span class="cx">     impl.methodWithCallbackArg(WTFMove(callback));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6315,7 +6315,7 @@
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx">     if (UNLIKELY(!state-&gt;uncheckedArgument(1).isObject()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 1, &quot;callback&quot;, &quot;TestObject&quot;, &quot;methodWithNonCallbackArgAndCallbackArg&quot;);
</span><del>-    auto callback = JSTestCallback::create(asObject(state-&gt;uncheckedArgument(1)), castedThis-&gt;globalObject());
</del><ins>+    auto callback = JSTestCallbackInterface::create(asObject(state-&gt;uncheckedArgument(1)), castedThis-&gt;globalObject());
</ins><span class="cx">     impl.methodWithNonCallbackArgAndCallbackArg(WTFMove(nonCallback), WTFMove(callback));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6332,11 +6332,11 @@
</span><span class="cx">     UNUSED_PARAM(state);
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    RefPtr&lt;TestCallback&gt; callback;
</del><ins>+    RefPtr&lt;TestCallbackInterface&gt; callback;
</ins><span class="cx">     if (!state-&gt;argument(0).isUndefinedOrNull()) {
</span><span class="cx">         if (!state-&gt;uncheckedArgument(0).isObject())
</span><span class="cx">             return throwArgumentMustBeFunctionError(*state, throwScope, 0, &quot;callback&quot;, &quot;TestObject&quot;, &quot;methodWithCallbackAndOptionalArg&quot;);
</span><del>-        callback = JSTestCallback::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</del><ins>+        callback = JSTestCallbackInterface::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</ins><span class="cx">     }
</span><span class="cx">     impl.methodWithCallbackAndOptionalArg(WTFMove(callback));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6413,11 +6413,11 @@
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><del>-    RefPtr&lt;TestCallback&gt; callback;
</del><ins>+    RefPtr&lt;TestCallbackInterface&gt; callback;
</ins><span class="cx">     if (!state-&gt;argument(0).isUndefinedOrNull()) {
</span><span class="cx">         if (!state-&gt;uncheckedArgument(0).isObject())
</span><span class="cx">             return throwArgumentMustBeFunctionError(*state, throwScope, 0, &quot;callback&quot;, &quot;TestObject&quot;, &quot;staticMethodWithCallbackAndOptionalArg&quot;);
</span><del>-        callback = createFunctionOnlyCallback&lt;JSTestCallback&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument(0));
</del><ins>+        callback = createFunctionOnlyCallback&lt;JSTestCallbackInterface&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument(0));
</ins><span class="cx">     }
</span><span class="cx">     TestObj::staticMethodWithCallbackAndOptionalArg(WTFMove(callback));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6432,7 +6432,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     if (UNLIKELY(!state-&gt;uncheckedArgument(0).isObject()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 0, &quot;callback&quot;, &quot;TestObject&quot;, &quot;staticMethodWithCallbackArg&quot;);
</span><del>-    auto callback = createFunctionOnlyCallback&lt;JSTestCallback&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument(0));
</del><ins>+    auto callback = createFunctionOnlyCallback&lt;JSTestCallbackInterface&gt;(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), state-&gt;uncheckedArgument(0));
</ins><span class="cx">     TestObj::staticMethodWithCallbackArg(WTFMove(callback));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6594,7 +6594,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     if (UNLIKELY(!state-&gt;uncheckedArgument(0).isObject()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 0, &quot;callback&quot;, &quot;TestObject&quot;, &quot;overloadedMethod&quot;);
</span><del>-    auto callback = JSTestCallback::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</del><ins>+    auto callback = JSTestCallbackInterface::create(asObject(state-&gt;uncheckedArgument(0)), castedThis-&gt;globalObject());
</ins><span class="cx">     impl.overloadedMethod(WTFMove(callback));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -6772,7 +6772,7 @@
</span><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod2(state);
</span><span class="cx">         if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestObj::info()))
</span><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod2(state);
</span><del>-        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestCallback::info()))
</del><ins>+        if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSTestCallbackInterface::info()))
</ins><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod5(state);
</span><span class="cx">         if (distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JSDOMStringList::info()))
</span><span class="cx">             return jsTestObjPrototypeFunctionOverloadedMethod6(state);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,7 +26,8 @@
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><span class="cx"> #include &quot;JSDOMConvert.h&quot;
</span><span class="cx"> #include &quot;JSSVGPoint.h&quot;
</span><del>-#include &quot;JSTestCallback.h&quot;
</del><ins>+#include &quot;JSTestCallbackFunction.h&quot;
+#include &quot;JSTestCallbackInterface.h&quot;
</ins><span class="cx"> #include &quot;JSTestEventTarget.h&quot;
</span><span class="cx"> #include &quot;JSTestSubObj.h&quot;
</span><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><span class="lines">@@ -130,14 +131,17 @@
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto* castedThis = jsCast&lt;JSTestTypedefsConstructor*&gt;(state-&gt;callee());
</span><span class="cx">     ASSERT(castedThis);
</span><del>-    if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</del><ins>+    if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</ins><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto hello = convert&lt;IDLDOMString&gt;(*state, state-&gt;uncheckedArgument(0), StringConversionConfiguration::Normal);
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-    if (UNLIKELY(!state-&gt;uncheckedArgument(1).isObject()))
-        return throwArgumentMustBeFunctionError(*state, throwScope, 1, &quot;testCallback&quot;, &quot;TestTypedefs&quot;, nullptr);
-    auto testCallback = JSTestCallback::create(asObject(state-&gt;uncheckedArgument(1)), castedThis-&gt;globalObject());
-    auto object = TestTypedefs::create(WTFMove(hello), WTFMove(testCallback));
</del><ins>+    if (UNLIKELY(!state-&gt;uncheckedArgument(1).isFunction()))
+        return throwArgumentMustBeFunctionError(*state, throwScope, 1, &quot;testCallbackFunction&quot;, &quot;TestTypedefs&quot;, nullptr);
+    auto testCallbackFunction = JSTestCallbackFunction::create(asObject(state-&gt;uncheckedArgument(1)), castedThis-&gt;globalObject());
+    if (UNLIKELY(!state-&gt;uncheckedArgument(2).isObject()))
+        return throwArgumentMustBeFunctionError(*state, throwScope, 2, &quot;testCallbackInterface&quot;, &quot;TestTypedefs&quot;, nullptr);
+    auto testCallbackInterface = JSTestCallbackInterface::create(asObject(state-&gt;uncheckedArgument(2)), castedThis-&gt;globalObject());
+    auto object = TestTypedefs::create(WTFMove(hello), WTFMove(testCallbackFunction), WTFMove(testCallbackInterface));
</ins><span class="cx">     return JSValue::encode(toJSNewlyCreated(state, castedThis-&gt;globalObject(), WTFMove(object)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -151,7 +155,7 @@
</span><span class="cx"> {
</span><span class="cx">     putDirect(vm, vm.propertyNames-&gt;prototype, JSTestTypedefs::prototype(vm, &amp;globalObject), DontDelete | ReadOnly | DontEnum);
</span><span class="cx">     putDirect(vm, vm.propertyNames-&gt;name, jsNontrivialString(&amp;vm, String(ASCIILiteral(&quot;TestTypedefs&quot;))), ReadOnly | DontEnum);
</span><del>-    putDirect(vm, vm.propertyNames-&gt;length, jsNumber(2), ReadOnly | DontEnum);
</del><ins>+    putDirect(vm, vm.propertyNames-&gt;length, jsNumber(3), ReadOnly | DontEnum);
</ins><span class="cx">     reifyStaticProperties(vm, JSTestTypedefsConstructorTableValues, *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary formstrArg, with or without
- * modification, are permitted provided that the following conditions
- * are 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 Apple Inc. (&quot;Apple&quot;) 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 APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR 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.
- */
-
-// This IDL file is for testing the bindings code generator with a callback
-// interface and for tracking changes in its ouput.
-[
-    Conditional=SPEECH_SYNTHESIS,
-] callback interface TestCallback {
-  // Constants
-  const unsigned short CONSTANT1 = 1;
-  const unsigned short CONSTANT2 = 2;
-
-  // Operations.
-  boolean callbackWithNoParam();
-  boolean callbackWithArrayParam(Float32Array arrayParam);
-  boolean callbackWithSerializedScriptValueParam(SerializedScriptValue srzParam, DOMString strArg);
-  long callbackWithNonBoolReturnType(DOMString strArg);
-  [Custom] long customCallback(Class5 class5Param, Class6 class6Param);
-  boolean callbackWithStringList(DOMStringList listParam);
-  boolean callbackWithBoolean(boolean boolParam);
-  boolean callbackRequiresThisToPass(long longParam, TestNode testNodeParam);
-};
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackFunctionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,18 +26,6 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-// This IDL file is for testing the bindings code generator with function only callback
-// interface and for tracking changes in its ouput.
</del><span class="cx"> [
</span><span class="cx">     Conditional=SPEECH_SYNTHESIS,
</span><del>-    Callback=FunctionOnly,
-] callback interface TestCallbackFunction {
-  boolean callbackWithNoParam();
-  boolean callbackWithArrayParam(Float32Array arrayParam);
-  boolean callbackWithSerializedScriptValueParam(SerializedScriptValue srzParam, DOMString strArg);
-  long callbackWithNonBoolReturnType(DOMString strArg);
-  [Custom] long customCallback(Class5 class5Param, Class6 class6Param);
-  boolean callbackWithStringList(DOMStringList listParam);
-  boolean callbackWithBoolean(boolean boolParam);
-  boolean callbackRequiresThisToPass(long longParam, TestNode testNodeParam);
-};
</del><ins>+] callback TestCallbackFunction = void (Float32Array arrayParam, SerializedScriptValue srzParam, DOMString strArg, boolean boolParam, long longParam, TestNode testNodeParam);
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackFunctionWithTypedefsidlfromrev208407trunkSourceWebCorepageIntersectionObserverCallbackidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl (from rev 208407, trunk/Source/WebCore/page/IntersectionObserverCallback.idl) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * 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 APPLE INC. OR 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.
+ */
+
+typedef long LONG;
+typedef sequence&lt;LONG?&gt; SEQUENCE_OF_NULLABLE_LONGS;
+typedef void VOID;
+
+callback TestCallbackFunctionWithTypedefs = VOID (SEQUENCE_OF_NULLABLE_LONGS sequenceArg, LONG longArg);
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestCallbackInterfaceidlfromrev208407trunkSourceWebCoreModuleswebdatabaseDatabaseCallbackidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl (from rev 208407, trunk/Source/WebCore/Modules/webdatabase/DatabaseCallback.idl) (0 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl                                (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are 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 Apple Inc. (&quot;Apple&quot;) 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 APPLE 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 APPLE OR 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.
+ */
+
+[
+    Conditional=SPEECH_SYNTHESIS,
+] callback interface TestCallbackInterface {
+    // Constants
+    const unsigned short CONSTANT1 = 1;
+    const unsigned short CONSTANT2 = 2;
+
+    // Operations.
+    void callbackWithNoParam();
+    void callbackWithArrayParam(Float32Array arrayParam);
+    void callbackWithSerializedScriptValueParam(SerializedScriptValue srzParam, DOMString strParam);
+    [Custom] long customCallback(Class5 class5Param, Class6 class6Param);
+    void callbackWithStringList(DOMStringList listParam);
+    void callbackWithBoolean(boolean boolParam);
+    void callbackRequiresThisToPass(long longParam, TestNode testNodeParam);
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     ConstructorCallWith=Document,
</span><del>-    Constructor(TestCallback testCallback, TestCallbackFunction testCallbackFunction),
</del><ins>+    Constructor(TestCallbackInterface testCallback, TestCallbackFunction testCallbackFunction),
</ins><span class="cx">     InterfaceName=TestObject
</span><span class="cx"> ] interface TestObj {
</span><span class="cx">     // Attributes
</span><span class="lines">@@ -242,9 +242,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if defined(TESTING_JS)
</span><span class="cx">     // Callback interface parameters.
</span><del>-    void    methodWithCallbackArg(TestCallback callback);
-    void    methodWithNonCallbackArgAndCallbackArg(long nonCallback, TestCallback callback);
-    void    methodWithCallbackAndOptionalArg(optional TestCallback? callback);
</del><ins>+    void    methodWithCallbackArg(TestCallbackInterface callback);
+    void    methodWithNonCallbackArgAndCallbackArg(long nonCallback, TestCallbackInterface callback);
+    void    methodWithCallbackAndOptionalArg(optional TestCallbackInterface? callback);
</ins><span class="cx"> 
</span><span class="cx">     // Callback function parameters.
</span><span class="cx">     void    methodWithCallbackFunctionArg(TestCallbackFunction callback);
</span><span class="lines">@@ -252,8 +252,8 @@
</span><span class="cx">     void    methodWithCallbackFunctionAndOptionalArg(optional TestCallbackFunction? callback);
</span><span class="cx"> 
</span><span class="cx">     // static methods with 'Callback' extended attribute
</span><del>-    static void    staticMethodWithCallbackAndOptionalArg(optional TestCallback? callback);
-    static void    staticMethodWithCallbackArg(TestCallback callback);
</del><ins>+    static void    staticMethodWithCallbackAndOptionalArg(optional TestCallbackInterface? callback);
+    static void    staticMethodWithCallbackArg(TestCallbackInterface callback);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // 'Conditional' extended attribute
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx">     void    overloadedMethod(TestObj? objArg, optional long longArg);
</span><span class="cx">     void    overloadedMethod(DOMString strArg);
</span><span class="cx">     void    overloadedMethod(long longArg);
</span><del>-    void    overloadedMethod(TestCallback callback);
</del><ins>+    void    overloadedMethod(TestCallbackInterface callback);
</ins><span class="cx">     void    overloadedMethod(DOMStringList? listArg);
</span><span class="cx">     void    overloadedMethod(sequence&lt;DOMString&gt;? arrayArg);
</span><span class="cx">     void    overloadedMethod(TestObj objArg);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestTypedefsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> // changes in its output.
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    Constructor(STRING hello, TEST_CALLBACK testCallback),
</del><ins>+    Constructor(STRING hello, TEST_CALLBACK_FUNCTION testCallbackFunction, TEST_CALLBACK_INTERFACE testCallbackInterface),
</ins><span class="cx"> ] interface TestTypedefs {
</span><span class="cx">     attribute ULONGLONG unsignedLongLongAttr;
</span><span class="cx"> 
</span><span class="lines">@@ -79,7 +79,8 @@
</span><span class="cx"> typedef DOMString                  STRING;
</span><span class="cx"> typedef sequence&lt;DOMString&gt;        SEQUENCE_OF_STRINGS;
</span><span class="cx"> typedef sequence&lt;DOMString?&gt;       SEQUENCE_OF_NULLABLE_STRINGS;
</span><del>-typedef TestCallback               TEST_CALLBACK;
</del><ins>+typedef TestCallbackFunction       TEST_CALLBACK_FUNCTION;
+typedef TestCallbackInterface      TEST_CALLBACK_INTERFACE;
</ins><span class="cx"> typedef TestSubObjConstructor      T;
</span><span class="cx"> typedef Int32Array                 ARRAY;
</span><span class="cx"> typedef DOMException               E;
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryListListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryListListener.h (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryListListener.h        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/css/MediaQueryListListener.h        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">         JSMediaQueryListListenerType
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    virtual bool queryChanged(MediaQueryList*) = 0;
</del><ins>+    virtual bool handleEvent(MediaQueryList*) = 0;
</ins><span class="cx">     virtual bool operator==(const MediaQueryListListener&amp;) const = 0;
</span><span class="cx">     virtual ~MediaQueryListListener() { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryListListeneridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryListListener.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryListListener.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/css/MediaQueryListListener.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -18,8 +18,6 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    CallbackNeedsOperatorEqual,
-    Callback=FunctionOnly,
-] callback interface MediaQueryListListener {
-    boolean queryChanged(optional MediaQueryList? list = null);
-};
</del><ins>+    CallbackNeedsOperatorEqual
+] callback MediaQueryListListener = void (optional MediaQueryList? list = null);
+
</ins></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryMatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryMatcher.cpp (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryMatcher.cpp        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/css/MediaQueryMatcher.cpp        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">         bool notify;
</span><span class="cx">         listener.query-&gt;evaluate(evaluator, notify);
</span><span class="cx">         if (notify)
</span><del>-            listener.listener-&gt;queryChanged(listener.query.ptr());
</del><ins>+            listener.listener-&gt;handleEvent(listener.query.ptr());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomRequestAnimationFrameCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -28,11 +28,9 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+// highResTime is passed as high resolution timestamp, see
+// http://www.w3.org/TR/hr-time/ for details.
+
</ins><span class="cx"> [
</span><span class="cx">     Conditional=REQUEST_ANIMATION_FRAME,
</span><del>-    Callback=FunctionOnly,
-] callback interface RequestAnimationFrameCallback {
-    // highResTime is passed as high resolution timestamp, see
-    // http://www.w3.org/TR/hr-time/ for details.
-    boolean handleEvent(unrestricted double highResTime);
-};
</del><ins>+] callback RequestAnimationFrameCallback = void (unrestricted double highResTime);
</ins></span></pre></div>
<a id="trunkSourceWebCoredomStringCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StringCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StringCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/dom/StringCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -28,8 +28,4 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-[
-    Callback=FunctionOnly,
-] callback interface StringCallback {
-    boolean handleEvent(DOMString data);
-};
</del><ins>+callback StringCallback = void (DOMString data);
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlVoidCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/VoidCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/VoidCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/html/VoidCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -22,8 +22,5 @@
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><del>-[
-    Callback=FunctionOnly,
-] callback interface VoidCallback {
-    boolean handleEvent();
-};
</del><ins>+
+callback VoidCallback = void ();
</ins></span></pre></div>
<a id="trunkSourceWebCorepageIntersectionObserverCallbackidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/IntersectionObserverCallback.idl (208407 => 208408)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/IntersectionObserverCallback.idl        2016-11-04 23:59:03 UTC (rev 208407)
+++ trunk/Source/WebCore/page/IntersectionObserverCallback.idl        2016-11-05 00:03:32 UTC (rev 208408)
</span><span class="lines">@@ -26,8 +26,5 @@
</span><span class="cx"> // https://wicg.github.io/IntersectionObserver/
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    Conditional=INTERSECTION_OBSERVER,
-    Callback=FunctionOnly,
-] callback interface IntersectionObserverCallback {
-    boolean handleEvent(sequence&lt;IntersectionObserverEntry&gt; entries, IntersectionObserver observer);
-};
</del><ins>+    Conditional=INTERSECTION_OBSERVER
+] callback IntersectionObserverCallback = void (sequence&lt;IntersectionObserverEntry&gt; entries, IntersectionObserver observer);
</ins></span></pre>
</div>
</div>

</body>
</html>