<!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>[208134] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208134">208134</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-10-30 15:35:00 -0700 (Sun, 30 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
https://bugs.webkit.org/show_bug.cgi?id=164208

Reviewed by Darin Adler.

Source/WebCore:

Restructure IDLParsers structs to match modern WebIDL conventions:
- Rename structs to have more WebCore like naming, consistently using
  the prefix IDL.
- Remove domSignature. Sinking it's properties into the structs that
  contained it.
- Add IDLArgument, replacing the use of domSignatures for arguments.
  IDLArgument is the subset of domSignatures needed for arguments.
- Rename domFunction to IDLOperation (matching WebILD nomenclature),
  replace signature with its own name, type (for returnType), specials,
  and extended attributes properties.
- Give IDLAttribute it's own name, type and extended attributes properties.
- Add IDLDictionaryMember, replacing the use of domSignature as the
  type of members in IDLDictionary. Give it name, type, isRequired,
  default and extendedAttributes properties.
- Renamed Typedef to be IDLTypedef. Remove the extended attributes 
  property as those are not allowed in typedefs per-PebIDL.

Also fix some parsing issues:
- Stop parsing 'in' directives in function arguments.
- Stop parsing extended attributes in typedefs.
- Support applying typedefs to types deep in aggregate types
  (e.g. (sequence&lt;(LONG or STRING)&gt; or DOMString)?).

* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/IDLParser.pm:
* bindings/scripts/generate-bindings.pl:
Update for new struct types.

* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/TestTypedefs.idl:
Remove test which tested extended attributes in typedefs,
and add a test which tests typedefs used in deep type structures.

* page/make_settings.pl:
Don't generate the 'in' prefix for arguments in IDL files.

Tools:

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
Update for new struct types.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsgeneratebindingspl">trunk/Source/WebCore/bindings/scripts/generate-bindings.pl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestTypedefsidl">trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl</a></li>
<li><a href="#trunkSourceWebCorepagemake_settingspl">trunk/Source/WebCore/page/make_settings.pl</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeBindingsCodeGeneratorDumpRenderTreepm">trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsCodeGeneratorTestRunnerpm">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/ChangeLog        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-10-30  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
+        https://bugs.webkit.org/show_bug.cgi?id=164208
+
+        Reviewed by Darin Adler.
+
+        Restructure IDLParsers structs to match modern WebIDL conventions:
+        - Rename structs to have more WebCore like naming, consistently using
+          the prefix IDL.
+        - Remove domSignature. Sinking it's properties into the structs that
+          contained it.
+        - Add IDLArgument, replacing the use of domSignatures for arguments.
+          IDLArgument is the subset of domSignatures needed for arguments.
+        - Rename domFunction to IDLOperation (matching WebILD nomenclature),
+          replace signature with its own name, type (for returnType), specials,
+          and extended attributes properties.
+        - Give IDLAttribute it's own name, type and extended attributes properties.
+        - Add IDLDictionaryMember, replacing the use of domSignature as the
+          type of members in IDLDictionary. Give it name, type, isRequired,
+          default and extendedAttributes properties.
+        - Renamed Typedef to be IDLTypedef. Remove the extended attributes 
+          property as those are not allowed in typedefs per-PebIDL.
+
+        Also fix some parsing issues:
+        - Stop parsing 'in' directives in function arguments.
+        - Stop parsing extended attributes in typedefs.
+        - Support applying typedefs to types deep in aggregate types
+          (e.g. (sequence&lt;(LONG or STRING)&gt; or DOMString)?).
+
+        * bindings/scripts/CodeGenerator.pm:
+        * bindings/scripts/IDLParser.pm:
+        * bindings/scripts/generate-bindings.pl:
+        Update for new struct types.
+
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        * bindings/scripts/test/TestTypedefs.idl:
+        Remove test which tested extended attributes in typedefs,
+        and add a test which tests typedefs used in deep type structures.
+
+        * page/make_settings.pl:
+        Don't generate the 'in' prefix for arguments in IDL files.
+
</ins><span class="cx"> 2016-10-30  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Fix nth-child serialization
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -91,8 +91,6 @@
</span><span class="cx">     &quot;Uint8ClampedArray&quot; =&gt; 1,
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-my %nonPointerTypeHash = ( &quot;DOMTimeStamp&quot; =&gt; 1 );
-
</del><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">@@ -288,22 +286,6 @@
</span><span class="cx">     &amp;$recurse($interface, $interface);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub FindSuperMethod
-{
-    my ($object, $interface, $functionName) = @_;
-    my $indexer;
-    $object-&gt;ForAllParents($interface, undef, sub {
-        my $currentInterface = shift;
-        foreach my $function (@{$currentInterface-&gt;functions}) {
-            if ($function-&gt;signature-&gt;name eq $functionName) {
-                $indexer = $function-&gt;signature;
-                return 'prune';
-            }
-        }
-    });
-    return $indexer;
-}
-
</del><span class="cx"> sub IDLFileForInterface
</span><span class="cx"> {
</span><span class="cx">     my $object = shift;
</span><span class="lines">@@ -332,7 +314,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $interface = $object-&gt;ParseInterface($outerInterface, $interfaceName);
</span><span class="cx">     for my $attribute (@{$interface-&gt;attributes}) {
</span><del>-        return $attribute if $attribute-&gt;signature-&gt;name eq $attributeName;
</del><ins>+        return $attribute if $attribute-&gt;name eq $attributeName;
</ins><span class="cx">     }
</span><span class="cx">     die(&quot;Could not find attribute '$attributeName' on interface '$interfaceName'.&quot;);
</span><span class="cx"> }
</span><span class="lines">@@ -395,7 +377,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $integerTypeHash{$type-&gt;name};
</span><span class="cx">     return 1 if $floatingPointTypeHash{$type-&gt;name};
</span><span class="lines">@@ -406,7 +388,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx">     
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $object-&gt;IsStringType($type);
</span><span class="cx">     return 1 if $object-&gt;IsEnumType($type);
</span><span class="lines">@@ -417,7 +399,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $integerTypeHash{$type-&gt;name};
</span><span class="cx">     return 0;
</span><span class="lines">@@ -427,7 +409,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $floatingPointTypeHash{$type-&gt;name};
</span><span class="cx">     return 0;
</span><span class="lines">@@ -437,7 +419,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $primitiveTypeHash{$type-&gt;name};
</span><span class="cx">     return 1 if $object-&gt;IsNumericType($type);
</span><span class="lines">@@ -449,7 +431,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $type-&gt;name eq &quot;DOMString&quot;;
</span><span class="cx">     return 1 if $type-&gt;name eq &quot;USVString&quot;;
</span><span class="lines">@@ -460,7 +442,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return defined($object-&gt;GetEnumByType($type));
</span><span class="cx"> }
</span><span class="lines">@@ -469,7 +451,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     my $name = $type-&gt;name;
</span><span class="cx"> 
</span><span class="lines">@@ -509,7 +491,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $object-&gt;IsEnumType($type) &amp;&amp; defined($cachedExternalEnumerations-&gt;{$type-&gt;name});
</span><span class="cx"> }
</span><span class="lines">@@ -518,7 +500,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if exists $enumTypeImplementationNameOverrides{$type-&gt;name};
</span><span class="cx">     return 0;
</span><span class="lines">@@ -528,7 +510,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $enumTypeImplementationNameOverrides{$type-&gt;name};
</span><span class="cx"> }
</span><span class="lines">@@ -537,7 +519,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     my $name = $type-&gt;name;
</span><span class="cx"> 
</span><span class="lines">@@ -576,7 +558,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $type-&gt;name =~ /^[A-Z]/ &amp;&amp; defined($object-&gt;GetDictionaryByType($type));
</span><span class="cx"> }
</span><span class="lines">@@ -586,7 +568,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $object-&gt;IsDictionaryType($type) &amp;&amp; defined($cachedExternalDictionaries-&gt;{$type-&gt;name});
</span><span class="cx"> }
</span><span class="lines">@@ -595,7 +577,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if exists $dictionaryTypeImplementationNameOverrides{$type-&gt;name};
</span><span class="cx">     return 0;
</span><span class="lines">@@ -605,7 +587,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $dictionaryTypeImplementationNameOverrides{$type-&gt;name};
</span><span class="cx"> }
</span><span class="lines">@@ -614,9 +596,8 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><del>-    return 1 if $nonPointerTypeHash{$type-&gt;name};
</del><span class="cx">     return 1 if $object-&gt;IsPrimitiveType($type);
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -625,7 +606,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if exists $svgTypeNeedingTearOff{$type-&gt;name};
</span><span class="cx">     return 0;
</span><span class="lines">@@ -635,7 +616,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $svgTypeWithWritablePropertiesNeedingTearOff{$type-&gt;name};
</span><span class="cx">     return 0;
</span><span class="lines">@@ -645,7 +626,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $typedArrayTypes{$type-&gt;name};
</span><span class="cx">     return 0;
</span><span class="lines">@@ -655,7 +636,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 0 if $object-&gt;IsPrimitiveType($type);
</span><span class="cx">     return 0 if $object-&gt;IsDictionaryType($type);
</span><span class="lines">@@ -671,7 +652,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $svgTypeNeedingTearOff{$type-&gt;name} if exists $svgTypeNeedingTearOff{$type-&gt;name};
</span><span class="cx">     return undef;
</span><span class="lines">@@ -681,7 +662,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     my $svgTypeNeedingTearOff = $object-&gt;GetSVGTypeNeedingTearOff($type);
</span><span class="cx">     return $svgTypeNeedingTearOff if not $svgTypeNeedingTearOff;
</span><span class="lines">@@ -711,7 +692,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $object-&gt;IsSVGAnimatedTypeName($type-&gt;name);
</span><span class="cx"> }
</span><span class="lines">@@ -720,7 +701,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $type-&gt;name =~ /Constructor$/;
</span><span class="cx"> }
</span><span class="lines">@@ -729,7 +710,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $type-&gt;name eq &quot;sequence&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -738,7 +719,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return @{$type-&gt;subtypes}[0];
</span><span class="cx"> }
</span><span class="lines">@@ -747,7 +728,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $type-&gt;name eq &quot;FrozenArray&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -756,7 +737,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return @{$type-&gt;subtypes}[0];
</span><span class="cx"> }
</span><span class="lines">@@ -765,7 +746,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $object-&gt;IsSequenceType($type) || $object-&gt;IsFrozenArrayType($type);
</span><span class="cx"> }
</span><span class="lines">@@ -774,7 +755,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return @{$type-&gt;subtypes}[0];
</span><span class="cx"> }
</span><span class="lines">@@ -853,7 +834,7 @@
</span><span class="cx"> 
</span><span class="cx">     my %nameToFunctionsMap = ();
</span><span class="cx">     foreach my $function (@{$interface-&gt;functions}) {
</span><del>-        my $name = $function-&gt;signature-&gt;name;
</del><ins>+        my $name = $function-&gt;name;
</ins><span class="cx">         $nameToFunctionsMap{$name} = [] if !exists $nameToFunctionsMap{$name};
</span><span class="cx">         push(@{$nameToFunctionsMap{$name}}, $function);
</span><span class="cx">         $function-&gt;{overloads} = $nameToFunctionsMap{$name};
</span><span class="lines">@@ -872,11 +853,11 @@
</span><span class="cx"> {
</span><span class="cx">     my ($generator, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    my $attributeName = $attribute-&gt;signature-&gt;name;
-    if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;}) {
-        $attributeName = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;};
</del><ins>+    my $attributeName = $attribute-&gt;name;
+    if ($attribute-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;}) {
+        $attributeName = $attribute-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;};
</ins><span class="cx">     }
</span><del>-    my $attributeType = $attribute-&gt;signature-&gt;type;
</del><ins>+    my $attributeType = $attribute-&gt;type;
</ins><span class="cx"> 
</span><span class="cx">     # SVG animated types need to use a special attribute name.
</span><span class="cx">     # The rest of the special casing for SVG animated types is handled in the language-specific code generators.
</span><span class="lines">@@ -889,7 +870,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($generator, $implIncludes, $interfaceName, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    my $contentAttributeName = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Reflect&quot;};
</del><ins>+    my $contentAttributeName = $attribute-&gt;extendedAttributes-&gt;{&quot;Reflect&quot;};
</ins><span class="cx">     return undef if !$contentAttributeName;
</span><span class="cx"> 
</span><span class="cx">     $contentAttributeName = lc $generator-&gt;AttributeNameForGetterAndSetter($attribute) if $contentAttributeName eq &quot;VALUE_IS_MISSING&quot;;
</span><span class="lines">@@ -910,10 +891,10 @@
</span><span class="cx">         return ($generator-&gt;WK_lcfirst($generator-&gt;AttributeNameForGetterAndSetter($attribute)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    my $attributeType = $attribute-&gt;signature-&gt;type;
</del><ins>+    my $attributeType = $attribute-&gt;type;
</ins><span class="cx"> 
</span><span class="cx">     my $functionName;
</span><del>-    if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;URL&quot;}) {
</del><ins>+    if ($attribute-&gt;extendedAttributes-&gt;{&quot;URL&quot;}) {
</ins><span class="cx">         $functionName = &quot;getURLAttribute&quot;;
</span><span class="cx">     } elsif ($attributeType-&gt;name eq &quot;boolean&quot;) {
</span><span class="cx">         $functionName = &quot;hasAttributeWithoutSynchronization&quot;;
</span><span class="lines">@@ -948,7 +929,7 @@
</span><span class="cx">         return (&quot;set&quot; . $generator-&gt;WK_ucfirst($generator-&gt;AttributeNameForGetterAndSetter($attribute)));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    my $attributeType = $attribute-&gt;signature-&gt;type;
</del><ins>+    my $attributeType = $attribute-&gt;type;
</ins><span class="cx"> 
</span><span class="cx">     my $functionName;
</span><span class="cx">     if ($attributeType-&gt;name eq &quot;boolean&quot;) {
</span><span class="lines">@@ -970,7 +951,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 0 if !$object-&gt;IsRefPtrType($type);
</span><span class="cx">     return 0 if $object-&gt;IsTypedArrayType($type);
</span><span class="lines">@@ -1017,7 +998,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 0 unless $object-&gt;IsWrapperType($type);
</span><span class="cx"> 
</span><span class="lines">@@ -1042,7 +1023,7 @@
</span><span class="cx"> 
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $isCallbackInterface{$type-&gt;name} if exists $isCallbackInterface{$type-&gt;name};
</span><span class="cx">     my $result = $object-&gt;ComputeIsCallbackInterface($type);
</span><span class="lines">@@ -1057,7 +1038,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 0 unless $object-&gt;IsCallbackInterface($type);
</span><span class="cx"> 
</span><span class="lines">@@ -1095,7 +1076,7 @@
</span><span class="cx"> 
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return $isFunctionOnlyCallbackInterface{$type-&gt;name} if exists $isFunctionOnlyCallbackInterface{$type-&gt;name};
</span><span class="cx">     my $result = $object-&gt;ComputeIsFunctionOnlyCallbackInterface($type);
</span><span class="lines">@@ -1220,12 +1201,11 @@
</span><span class="cx"> 
</span><span class="cx"> sub ShouldPassWrapperByReference
</span><span class="cx"> {
</span><del>-    my ($object, $parameter, $interface) = @_;
</del><ins>+    my ($object, $argument) = @_;
</ins><span class="cx"> 
</span><del>-    return 0 if $parameter-&gt;isVariadic;
-    return 0 if $parameter-&gt;type-&gt;isNullable;
-    return 0 if !$object-&gt;IsWrapperType($parameter-&gt;type) &amp;&amp; !$object-&gt;IsTypedArrayType($parameter-&gt;type);
-    return 0 if $object-&gt;IsSVGTypeNeedingTearOff($parameter-&gt;type);
</del><ins>+    return 0 if $argument-&gt;type-&gt;isNullable;
+    return 0 if !$object-&gt;IsWrapperType($argument-&gt;type) &amp;&amp; !$object-&gt;IsTypedArrayType($argument-&gt;type);
+    return 0 if $object-&gt;IsSVGTypeNeedingTearOff($argument-&gt;type);
</ins><span class="cx"> 
</span><span class="cx">     return 1;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -173,19 +173,19 @@
</span><span class="cx">     foreach my $attribute (@{$interface-&gt;attributes}) {
</span><span class="cx">         next unless $attribute-&gt;isStringifier;
</span><span class="cx"> 
</span><del>-        my $stringifier = domFunction-&gt;new();
-        $stringifier-&gt;signature(domSignature-&gt;new());
</del><ins>+        my $stringifier = IDLOperation-&gt;new();
+        $stringifier-&gt;name(&quot;toString&quot;);
+
</ins><span class="cx">         my $extendedAttributeList = {};
</span><del>-        $extendedAttributeList-&gt;{ImplementedAs} = $attribute-&gt;signature-&gt;name;
-        $stringifier-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-        $stringifier-&gt;signature-&gt;name(&quot;toString&quot;);
-        die &quot;stringifier can only be used on attributes of String types&quot; unless $codeGenerator-&gt;IsStringType($attribute-&gt;signature-&gt;type);
</del><ins>+        $extendedAttributeList-&gt;{ImplementedAs} = $attribute-&gt;name;
+        $stringifier-&gt;extendedAttributes($extendedAttributeList);
+        die &quot;stringifier can only be used on attributes of String types&quot; unless $codeGenerator-&gt;IsStringType($attribute-&gt;type);
</ins><span class="cx">         
</span><span class="cx">         # FIXME: This should use IDLParser's cloneType.
</span><del>-        my $type = domType-&gt;new();
-        $type-&gt;name($attribute-&gt;signature-&gt;type-&gt;name);
</del><ins>+        my $type = IDLType-&gt;new();
+        $type-&gt;name($attribute-&gt;type-&gt;name);
</ins><span class="cx"> 
</span><del>-        $stringifier-&gt;signature-&gt;type($type);
</del><ins>+        $stringifier-&gt;type($type);
</ins><span class="cx"> 
</span><span class="cx">         push(@{$interface-&gt;functions}, $stringifier);
</span><span class="cx">         last;
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> sub EventHandlerAttributeEventName
</span><span class="cx"> {
</span><span class="cx">     my $attribute = shift;
</span><del>-    my $eventType = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $attribute-&gt;signature-&gt;name;
</del><ins>+    my $eventType = $attribute-&gt;extendedAttributes-&gt;{ImplementedAs} || $attribute-&gt;name;
</ins><span class="cx"> 
</span><span class="cx">     # Remove the &quot;on&quot; prefix.
</span><span class="cx">     $eventType = substr($eventType, 2);
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx"> sub IsReadonly
</span><span class="cx"> {
</span><span class="cx">     my $attribute = shift;
</span><del>-    return $attribute-&gt;isReadOnly &amp;&amp; !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{Replaceable} &amp;&amp; !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{PutForwards};
</del><ins>+    return $attribute-&gt;isReadOnly &amp;&amp; !$attribute-&gt;extendedAttributes-&gt;{Replaceable} &amp;&amp; !$attribute-&gt;extendedAttributes-&gt;{PutForwards};
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub AddClassForwardIfNeeded
</span><span class="lines">@@ -382,7 +382,7 @@
</span><span class="cx">         # where the index is out of range.
</span><span class="cx">         
</span><span class="cx">         # FIXME: Should this work for all string types?
</span><del>-        if ($indexedGetterFunction-&gt;signature-&gt;type-&gt;name eq &quot;DOMString&quot;) {
</del><ins>+        if ($indexedGetterFunction-&gt;type-&gt;name eq &quot;DOMString&quot;) {
</ins><span class="cx">             push(@getOwnPropertySlotImpl, &quot;    if (optionalIndex) {\n&quot;);
</span><span class="cx">         } else {
</span><span class="cx">             push(@getOwnPropertySlotImpl, &quot;    if (optionalIndex &amp;&amp; optionalIndex.value() &lt; thisObject-&gt;wrapped().length()) {\n&quot;);
</span><span class="lines">@@ -537,9 +537,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $className, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    return $codeGenerator-&gt;WK_lcfirst($className) . &quot;Constructor&quot; . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) if $attribute-&gt;isStatic;
</del><ins>+    return $codeGenerator-&gt;WK_lcfirst($className) . &quot;Constructor&quot; . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name) if $attribute-&gt;isStatic;
</ins><span class="cx">     return GetJSBuiltinFunctionName($className, $attribute) if IsJSBuiltin($interface, $attribute);
</span><del>-    return &quot;js&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) . ($codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;type) ? &quot;Constructor&quot; : &quot;&quot;);
</del><ins>+    return &quot;js&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name) . ($codeGenerator-&gt;IsConstructorType($attribute-&gt;type) ? &quot;Constructor&quot; : &quot;&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetAttributeSetterName
</span><span class="lines">@@ -546,9 +546,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $className, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    return &quot;set&quot; . $codeGenerator-&gt;WK_ucfirst($className) . &quot;Constructor&quot; . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) if $attribute-&gt;isStatic;
</del><ins>+    return &quot;set&quot; . $codeGenerator-&gt;WK_ucfirst($className) . &quot;Constructor&quot; . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name) if $attribute-&gt;isStatic;
</ins><span class="cx">     return &quot;set&quot; . $codeGenerator-&gt;WK_ucfirst(GetJSBuiltinFunctionName($className, $attribute)) if IsJSBuiltin($interface, $attribute);
</span><del>-    return &quot;setJS&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) . ($codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;type) ? &quot;Constructor&quot; : &quot;&quot;);
</del><ins>+    return &quot;setJS&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name) . ($codeGenerator-&gt;IsConstructorType($attribute-&gt;type) ? &quot;Constructor&quot; : &quot;&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetFunctionName
</span><span class="lines">@@ -557,7 +557,7 @@
</span><span class="cx"> 
</span><span class="cx">     return GetJSBuiltinFunctionName($className, $function) if IsJSBuiltin($interface, $function);
</span><span class="cx"> 
</span><del>-    my $functionName = $function-&gt;signature-&gt;name;
</del><ins>+    my $functionName = $function-&gt;name;
</ins><span class="cx">     $functionName = &quot;SymbolIterator&quot; if $functionName eq &quot;[Symbol.Iterator]&quot;;
</span><span class="cx"> 
</span><span class="cx">     my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : (OperationShouldBeOnInstance($interface, $function) ? &quot;Instance&quot; : &quot;Prototype&quot;);
</span><span class="lines">@@ -572,10 +572,10 @@
</span><span class="cx">     my $numberOfParameters = shift;
</span><span class="cx"> 
</span><span class="cx">     foreach my $function (@{$interface-&gt;functions}, @{$interface-&gt;anonymousFunctions}) {
</span><del>-        my $specials = $function-&gt;signature-&gt;specials;
</del><ins>+        my $specials = $function-&gt;specials;
</ins><span class="cx">         my $specialExists = grep { $_ eq $special } @$specials;
</span><del>-        my $parameters = $function-&gt;parameters;
-        if ($specialExists and scalar(@$parameters) == $numberOfParameters and $parameters-&gt;[0]-&gt;type-&gt;name eq $firstParameterType) {
</del><ins>+        my $arguments = $function-&gt;arguments;
+        if ($specialExists and scalar(@$arguments) == $numberOfParameters and $arguments-&gt;[0]-&gt;type-&gt;name eq $firstParameterType) {
</ins><span class="cx">             return $function;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -615,10 +615,10 @@
</span><span class="cx">     my $attribute = shift;
</span><span class="cx"> 
</span><span class="cx">     # FIXME: The bindings generator does not support putting runtime-enabled attributes on the instance yet (except for global objects).
</span><del>-    return 0 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime} &amp;&amp; !IsDOMGlobalObject($interface);
</del><ins>+    return 0 if $attribute-&gt;extendedAttributes-&gt;{EnabledAtRuntime} &amp;&amp; !IsDOMGlobalObject($interface);
</ins><span class="cx"> 
</span><span class="cx">     return 1 if InterfaceRequiresAttributesOnInstance($interface);
</span><del>-    return 1 if $codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;type);
</del><ins>+    return 1 if $codeGenerator-&gt;IsConstructorType($attribute-&gt;type);
</ins><span class="cx"> 
</span><span class="cx">     # [Unforgeable] attributes should be on the instance.
</span><span class="cx">     # https://heycam.github.io/webidl/#Unforgeable
</span><span class="lines">@@ -625,8 +625,8 @@
</span><span class="cx">     return 1 if IsUnforgeable($interface, $attribute);
</span><span class="cx"> 
</span><span class="cx">     if ($interface-&gt;extendedAttributes-&gt;{CheckSecurity}) {
</span><del>-        return 0 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{DoNotCheckSecurity};
-        return 0 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{DoNotCheckSecurityOnGetter};
</del><ins>+        return 0 if $attribute-&gt;extendedAttributes-&gt;{DoNotCheckSecurity};
+        return 0 if $attribute-&gt;extendedAttributes-&gt;{DoNotCheckSecurityOnGetter};
</ins><span class="cx">         return 1;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -643,7 +643,7 @@
</span><span class="cx">     return 1 if IsDOMGlobalObject($interface) &amp;&amp; $interface-&gt;type-&gt;name ne &quot;WorkerGlobalScope&quot;;
</span><span class="cx"> 
</span><span class="cx">     # FIXME: The bindings generator does not support putting runtime-enabled operations on the instance yet (except for global objects).
</span><del>-    return 0 if $function-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime};
</del><ins>+    return 0 if $function-&gt;extendedAttributes-&gt;{EnabledAtRuntime};
</ins><span class="cx"> 
</span><span class="cx">     # [Unforgeable] operations should be on the instance. https://heycam.github.io/webidl/#Unforgeable
</span><span class="cx">     return 1 if IsUnforgeable($interface, $function);
</span><span class="lines">@@ -660,11 +660,11 @@
</span><span class="cx">     push(@specials, &quot;DontDelete&quot;) if IsUnforgeable($interface, $attribute);
</span><span class="cx"> 
</span><span class="cx">     # As per Web IDL specification, constructor properties on the ECMAScript global object should not be enumerable.
</span><del>-    my $isGlobalConstructor = $codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;type);
-    push(@specials, &quot;DontEnum&quot;) if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{NotEnumerable} || $isGlobalConstructor);
</del><ins>+    my $isGlobalConstructor = $codeGenerator-&gt;IsConstructorType($attribute-&gt;type);
+    push(@specials, &quot;DontEnum&quot;) if ($attribute-&gt;extendedAttributes-&gt;{NotEnumerable} || $isGlobalConstructor);
</ins><span class="cx">     push(@specials, &quot;ReadOnly&quot;) if IsReadonly($attribute);
</span><span class="cx">     push(@specials, &quot;CustomAccessor&quot;) unless $isGlobalConstructor or IsJSBuiltin($interface, $attribute);
</span><del>-    push(@specials, &quot;DOMJITAttribute&quot;) if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</del><ins>+    push(@specials, &quot;DOMJITAttribute&quot;) if $attribute-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</ins><span class="cx">     push(@specials, &quot;Accessor | Builtin&quot;) if  IsJSBuiltin($interface, $attribute);
</span><span class="cx">     return (@specials &gt; 0) ? join(&quot; | &quot;, @specials) : &quot;0&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -840,7 +840,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($type, $interface) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;HasEnumImplementationNameOverride($type)) {
</span><span class="cx">         return $codeGenerator-&gt;GetEnumImplementationNameOverride($type);
</span><span class="lines">@@ -1044,31 +1044,29 @@
</span><span class="cx"> 
</span><span class="cx"> sub GenerateDefaultValue
</span><span class="cx"> {
</span><del>-    my ($interface, $signature) = @_;
</del><ins>+    my ($interface, $type, $defaultValue) = @_;
</ins><span class="cx"> 
</span><del>-    my $defaultValue = $signature-&gt;default;
-
-    if ($codeGenerator-&gt;IsEnumType($signature-&gt;type)) {
</del><ins>+    if ($codeGenerator-&gt;IsEnumType($type)) {
</ins><span class="cx">         # FIXME: Would be nice to report an error if the value does not have quote marks around it.
</span><span class="cx">         # FIXME: Would be nice to report an error if the value is not one of the enumeration values.
</span><del>-        my $className = GetEnumerationClassName($signature-&gt;type, $interface);
</del><ins>+        my $className = GetEnumerationClassName($type, $interface);
</ins><span class="cx">         my $enumerationValueName = GetEnumerationValueName(substr($defaultValue, 1, -1));
</span><span class="cx">         return $className . &quot;::&quot; . $enumerationValueName;
</span><span class="cx">     }
</span><span class="cx">     if ($defaultValue eq &quot;null&quot;) {
</span><del>-        if ($signature-&gt;type-&gt;isUnion) {
-            return &quot;Nullopt&quot; if $signature-&gt;type-&gt;isNullable;
</del><ins>+        if ($type-&gt;isUnion) {
+            return &quot;Nullopt&quot; if $type-&gt;isNullable;
</ins><span class="cx"> 
</span><del>-            my $IDLType = GetIDLType($interface, $signature-&gt;type);
</del><ins>+            my $IDLType = GetIDLType($interface, $type);
</ins><span class="cx">             return &quot;convert&lt;${IDLType}&gt;(state, jsNull());&quot;;
</span><span class="cx">         }
</span><del>-        return &quot;jsNull()&quot; if $signature-&gt;type-&gt;name eq &quot;any&quot;;
-        return &quot;nullptr&quot; if $codeGenerator-&gt;IsWrapperType($signature-&gt;type) || $codeGenerator-&gt;IsTypedArrayType($signature-&gt;type);
-        return &quot;String()&quot; if $codeGenerator-&gt;IsStringType($signature-&gt;type);
</del><ins>+        return &quot;jsNull()&quot; if $type-&gt;name eq &quot;any&quot;;
+        return &quot;nullptr&quot; if $codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsTypedArrayType($type);
+        return &quot;String()&quot; if $codeGenerator-&gt;IsStringType($type);
</ins><span class="cx">         return &quot;Nullopt&quot;;
</span><span class="cx">     }
</span><span class="cx">     if ($defaultValue eq &quot;[]&quot;) {
</span><del>-        my $nativeType = GetNativeTypeFromSignature($interface, $signature);
</del><ins>+        my $nativeType = GetNativeType($interface, $type);
</ins><span class="cx">         return &quot;$nativeType()&quot;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1183,10 +1181,10 @@
</span><span class="cx"> 
</span><span class="cx">             # Value is undefined.
</span><span class="cx">             # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
</span><del>-            if ($member-&gt;isOptional &amp;&amp; defined $member-&gt;default) {
</del><ins>+            if (!$member-&gt;isRequired &amp;&amp; defined $member-&gt;default) {
</ins><span class="cx">                 $result .= &quot;    } else\n&quot;;
</span><del>-                $result .= &quot;        result.$key = &quot; . GenerateDefaultValue($interface, $member) . &quot;;\n&quot;;
-            } elsif (!$member-&gt;isOptional) {
</del><ins>+                $result .= &quot;        result.$key = &quot; . GenerateDefaultValue($interface, $member-&gt;type, $member-&gt;default) . &quot;;\n&quot;;
+            } elsif ($member-&gt;isRequired) {
</ins><span class="cx">                 # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
</span><span class="cx">                 $result .= &quot;    } else {\n&quot;;
</span><span class="cx">                 $result .= &quot;        throwRequiredMemberTypeError(state, throwScope, \&quot;&quot;. $member-&gt;name .&quot;\&quot;, \&quot;$name\&quot;, \&quot;&quot;. $type-&gt;name .&quot;\&quot;);\n&quot;;
</span><span class="lines">@@ -1514,19 +1512,19 @@
</span><span class="cx">     if ($numAttributes &gt; 0) {
</span><span class="cx">         foreach (@{$interface-&gt;attributes}) {
</span><span class="cx">             my $attribute = $_;
</span><del>-            $numCustomAttributes++ if HasCustomGetter($attribute-&gt;signature-&gt;extendedAttributes);
-            $numCustomAttributes++ if HasCustomSetter($attribute-&gt;signature-&gt;extendedAttributes);
-            if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CachedAttribute}) {
-                my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</del><ins>+            $numCustomAttributes++ if HasCustomGetter($attribute-&gt;extendedAttributes);
+            $numCustomAttributes++ if HasCustomSetter($attribute-&gt;extendedAttributes);
+            if ($attribute-&gt;extendedAttributes-&gt;{CachedAttribute}) {
+                my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
</ins><span class="cx">                 push(@headerContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><del>-                push(@headerContent, &quot;    mutable JSC::WriteBarrier&lt;JSC::Unknown&gt; m_&quot; . $attribute-&gt;signature-&gt;name . &quot;;\n&quot;);
</del><ins>+                push(@headerContent, &quot;    mutable JSC::WriteBarrier&lt;JSC::Unknown&gt; m_&quot; . $attribute-&gt;name . &quot;;\n&quot;);
</ins><span class="cx">                 $numCachedAttributes++;
</span><span class="cx">                 $needsVisitChildren = 1;
</span><span class="cx">                 push(@headerContent, &quot;#endif\n&quot;) if $conditionalString;
</span><span class="cx">             }
</span><del>-            $hasDOMJITAttributes = 1 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</del><ins>+            $hasDOMJITAttributes = 1 if $attribute-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</ins><span class="cx"> 
</span><del>-            $hasForwardDeclaringAttributes = 1 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</del><ins>+            $hasForwardDeclaringAttributes = 1 if $attribute-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1545,16 +1543,16 @@
</span><span class="cx">         push(@headerContent, &quot;\n    // Custom attributes\n&quot;);
</span><span class="cx"> 
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
-            if (HasCustomGetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
+            if (HasCustomGetter($attribute-&gt;extendedAttributes)) {
</ins><span class="cx">                 push(@headerContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><del>-                my $methodName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;name);
</del><ins>+                my $methodName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;name);
</ins><span class="cx">                 push(@headerContent, &quot;    JSC::JSValue &quot; . $methodName . &quot;(JSC::ExecState&amp;) const;\n&quot;);
</span><span class="cx">                 push(@headerContent, &quot;#endif\n&quot;) if $conditionalString;
</span><span class="cx">             }
</span><del>-            if (HasCustomSetter($attribute-&gt;signature-&gt;extendedAttributes) &amp;&amp; !IsReadonly($attribute)) {
</del><ins>+            if (HasCustomSetter($attribute-&gt;extendedAttributes) &amp;&amp; !IsReadonly($attribute)) {
</ins><span class="cx">                 push(@headerContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><del>-                push(@headerContent, &quot;    void set&quot; . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) . &quot;(JSC::ExecState&amp;, JSC::JSValue);\n&quot;);
</del><ins>+                push(@headerContent, &quot;    void set&quot; . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name) . &quot;(JSC::ExecState&amp;, JSC::JSValue);\n&quot;);
</ins><span class="cx">                 push(@headerContent, &quot;#endif\n&quot;) if $conditionalString;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -1561,8 +1559,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     foreach my $function (@{$interface-&gt;functions}) {
</span><del>-        $numCustomFunctions++ if HasCustomMethod($function-&gt;signature-&gt;extendedAttributes);
-        $hasForwardDeclaringFunctions = 1 if $function-&gt;signature-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</del><ins>+        $numCustomFunctions++ if HasCustomMethod($function-&gt;extendedAttributes);
+        $hasForwardDeclaringFunctions = 1 if $function-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($numCustomFunctions &gt; 0) {
</span><span class="lines">@@ -1569,7 +1567,7 @@
</span><span class="cx">         my $inAppleCopyright = 0;
</span><span class="cx">         push(@headerContent, &quot;\n    // Custom functions\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</ins><span class="cx">                 if (!$inAppleCopyright) {
</span><span class="cx">                     push(@headerContent, $beginAppleCopyrightForHeaderFiles);
</span><span class="cx">                     $inAppleCopyright = 1;
</span><span class="lines">@@ -1578,11 +1576,11 @@
</span><span class="cx">                 push(@headerContent, $endAppleCopyright);
</span><span class="cx">                 $inAppleCopyright = 0;
</span><span class="cx">             }
</span><del>-            next unless HasCustomMethod($function-&gt;signature-&gt;extendedAttributes);
</del><ins>+            next unless HasCustomMethod($function-&gt;extendedAttributes);
</ins><span class="cx">             next if $function-&gt;{overloads} &amp;&amp; $function-&gt;{overloadIndex} != 1;
</span><del>-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($function-&gt;signature);
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($function);
</ins><span class="cx">             push(@headerContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><del>-            my $functionImplementationName = $function-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $codeGenerator-&gt;WK_lcfirst($function-&gt;signature-&gt;name);
</del><ins>+            my $functionImplementationName = $function-&gt;extendedAttributes-&gt;{ImplementedAs} || $codeGenerator-&gt;WK_lcfirst($function-&gt;name);
</ins><span class="cx">             push(@headerContent, &quot;    &quot; . ($function-&gt;isStatic ? &quot;static &quot; : &quot;&quot;) . &quot;JSC::JSValue &quot; . $functionImplementationName . &quot;(JSC::ExecState&amp;);\n&quot;);
</span><span class="cx">             push(@headerContent, &quot;#endif\n&quot;) if $conditionalString;
</span><span class="cx">         }
</span><span class="lines">@@ -1691,9 +1689,9 @@
</span><span class="cx">         push(@headerContent,&quot;// Functions\n\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><del>-            next unless $function-&gt;signature-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</del><ins>+            next unless $function-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</ins><span class="cx"> 
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</ins><span class="cx">                 if (!$inAppleCopyright) {
</span><span class="cx">                     push(@headerContent, $beginAppleCopyrightForHeaderFiles);
</span><span class="cx">                     $inAppleCopyright = 1;
</span><span class="lines">@@ -1718,9 +1716,9 @@
</span><span class="cx">     if ($hasForwardDeclaringAttributes) {
</span><span class="cx">         push(@headerContent,&quot;// Attributes\n\n&quot;);
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            next unless $attribute-&gt;signature-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</del><ins>+            next unless $attribute-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</ins><span class="cx"> 
</span><del>-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
</ins><span class="cx">             push(@headerContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx">             my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx">             push(@headerContent, &quot;JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);\n&quot;);
</span><span class="lines">@@ -1736,10 +1734,10 @@
</span><span class="cx">         $headerIncludes{&quot;&lt;domjit/DOMJITGetterSetter.h&gt;&quot;} = 1;
</span><span class="cx">         push(@headerContent,&quot;// DOMJIT emitters for attributes\n\n&quot;);
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            next unless $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</del><ins>+            next unless $attribute-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</ins><span class="cx"> 
</span><span class="cx">             my $interfaceName = $interface-&gt;type-&gt;name;
</span><del>-            my $className = $interfaceName . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name);
</del><ins>+            my $className = $interfaceName . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name);
</ins><span class="cx">             my $domJITClassName = $className . &quot;DOMJIT&quot;;
</span><span class="cx"> 
</span><span class="cx">             push(@headerContent, &quot;JSC::DOMJIT::GetterSetter* domJITGetterSetterFor$className(void);\n&quot;);
</span><span class="lines">@@ -1829,19 +1827,19 @@
</span><span class="cx">         next if AttributeShouldBeOnInstance($interface, $attribute) != $isInstance;
</span><span class="cx"> 
</span><span class="cx">         # Global objects add RuntimeEnabled attributes after creation so do not add them to the static table.
</span><del>-        if (IsDOMGlobalObject($interface) &amp;&amp; $attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</del><ins>+        if (IsDOMGlobalObject($interface) &amp;&amp; $attribute-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</ins><span class="cx">             $propertyCount -= 1;
</span><span class="cx">             next;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        my $name = $attribute-&gt;signature-&gt;name;
</del><ins>+        my $name = $attribute-&gt;name;
</ins><span class="cx">         push(@$hashKeys, $name);
</span><span class="cx"> 
</span><span class="cx">         my $special = GetJSCAttributesForAttribute($interface, $attribute);
</span><span class="cx">         push(@$hashSpecials, $special);
</span><span class="cx"> 
</span><del>-        if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;}) {
-            push(@$hashValue1, &quot;domJITGetterSetterFor&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name));
</del><ins>+        if ($attribute-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;}) {
+            push(@$hashValue1, &quot;domJITGetterSetterFor&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name));
</ins><span class="cx">             push(@$hashValue2, &quot;0&quot;);
</span><span class="cx">         } else {
</span><span class="cx">             my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="lines">@@ -1855,10 +1853,10 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        my $conditional = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional};
</del><ins>+        my $conditional = $attribute-&gt;extendedAttributes-&gt;{Conditional};
</ins><span class="cx">         $conditionals-&gt;{$name} = $conditional if $conditional;
</span><span class="cx"> 
</span><del>-        if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</del><ins>+        if ($attribute-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</ins><span class="cx">             die &quot;We currently do not support [EnabledAtRuntime] attributes on the instance (except for global objects).&quot; if $isInstance;
</span><span class="cx">             push(@$runtimeEnabledAttributes, $attribute);
</span><span class="cx">         }
</span><span class="lines">@@ -1868,19 +1866,19 @@
</span><span class="cx">     push(@functions, @{$interface-&gt;iterable-&gt;functions}) if IsKeyValueIterableInterface($interface);
</span><span class="cx">     push(@functions, @{$interface-&gt;serializable-&gt;functions}) if $interface-&gt;serializable;
</span><span class="cx">     foreach my $function (@functions) {
</span><del>-        next if ($function-&gt;signature-&gt;extendedAttributes-&gt;{PrivateIdentifier} and not $function-&gt;signature-&gt;extendedAttributes-&gt;{PublicIdentifier});
</del><ins>+        next if ($function-&gt;extendedAttributes-&gt;{PrivateIdentifier} and not $function-&gt;extendedAttributes-&gt;{PublicIdentifier});
</ins><span class="cx">         next if ($function-&gt;isStatic);
</span><span class="cx">         next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><span class="cx">         next if OperationShouldBeOnInstance($interface, $function) != $isInstance;
</span><del>-        next if $function-&gt;signature-&gt;name eq &quot;[Symbol.Iterator]&quot;;
</del><ins>+        next if $function-&gt;name eq &quot;[Symbol.Iterator]&quot;;
</ins><span class="cx"> 
</span><span class="cx">         # Global objects add RuntimeEnabled operations after creation so do not add them to the static table.
</span><del>-        if (IsDOMGlobalObject($interface) &amp;&amp; $function-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</del><ins>+        if (IsDOMGlobalObject($interface) &amp;&amp; $function-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</ins><span class="cx">             $propertyCount -= 1;
</span><span class="cx">             next;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        my $name = $function-&gt;signature-&gt;name;
</del><ins>+        my $name = $function-&gt;name;
</ins><span class="cx">         push(@$hashKeys, $name);
</span><span class="cx"> 
</span><span class="cx">         my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="lines">@@ -1889,7 +1887,7 @@
</span><span class="cx">         my $functionLength = GetFunctionLength($function);
</span><span class="cx"> 
</span><span class="cx">         # FIXME: Remove this once we can get rid of the quirk introduced in https://bugs.webkit.org/show_bug.cgi?id=163967.
</span><del>-        $functionLength = 3 if $interfaceName eq &quot;Event&quot; and $function-&gt;signature-&gt;name eq &quot;initEvent&quot;;
</del><ins>+        $functionLength = 3 if $interfaceName eq &quot;Event&quot; and $function-&gt;name eq &quot;initEvent&quot;;
</ins><span class="cx"> 
</span><span class="cx">         push(@$hashValue2, $functionLength);
</span><span class="cx"> 
</span><span class="lines">@@ -1898,7 +1896,7 @@
</span><span class="cx">         my $conditional = getConditionalForFunctionConsideringOverloads($function);
</span><span class="cx">         $conditionals-&gt;{$name} = $conditional if $conditional;
</span><span class="cx"> 
</span><del>-        if ($function-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</del><ins>+        if ($function-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) {
</ins><span class="cx">             die &quot;We currently do not support [EnabledAtRuntime] operations on the instance (except for global objects).&quot; if $isInstance;
</span><span class="cx">             push(@$runtimeEnabledFunctions, $function);
</span><span class="cx">         }
</span><span class="lines">@@ -1930,15 +1928,15 @@
</span><span class="cx"> 
</span><span class="cx">     my $m = LengthOfLongestFunctionParameterList($overloads);
</span><span class="cx">     foreach my $overload (@{$overloads}) {
</span><del>-        my $n = @{$overload-&gt;parameters};
</del><ins>+        my $n = @{$overload-&gt;arguments};
</ins><span class="cx">         my @t;
</span><span class="cx">         my @o;
</span><span class="cx">         my $isVariadic = 0;
</span><del>-        foreach my $parameter (@{$overload-&gt;parameters}) {
-            push(@t, $parameter-&gt;type);
-            if ($parameter-&gt;isOptional) {
</del><ins>+        foreach my $argument (@{$overload-&gt;arguments}) {
+            push(@t, $argument-&gt;type);
+            if ($argument-&gt;isOptional) {
</ins><span class="cx">                 push(@o, &quot;optional&quot;);
</span><del>-            } elsif ($parameter-&gt;isVariadic) {
</del><ins>+            } elsif ($argument-&gt;isVariadic) {
</ins><span class="cx">                 push(@o, &quot;variadic&quot;);
</span><span class="cx">                 $isVariadic = 1;
</span><span class="cx">             } else {
</span><span class="lines">@@ -1956,8 +1954,8 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         for (my $i = $n - 1; $i &gt;= 0; $i--) {
</span><del>-            my $parameter = @{$overload-&gt;parameters}[$i];
-            last unless ($parameter-&gt;isOptional || $parameter-&gt;isVariadic);
</del><ins>+            my $argument = @{$overload-&gt;arguments}[$i];
+            last unless ($argument-&gt;isOptional || $argument-&gt;isVariadic);
</ins><span class="cx">             pop(@t);
</span><span class="cx">             pop(@o);
</span><span class="cx">             &amp;$addTuple([$overload, [@t], [@o]]);
</span><span class="lines">@@ -2038,7 +2036,7 @@
</span><span class="cx">     for (my $index = 0; $index &lt; scalar(@$firstTupleTypes); $index++) {
</span><span class="cx">         return $index if AreTypesDistinguishableForOverloadResolution(@{$firstTupleTypes}[$index], @{$secondTupleTypes}[$index]);
</span><span class="cx">     }
</span><del>-    die &quot;Undistinguishable overloads for operation &quot; . $function-&gt;signature-&gt;name . &quot; with length: &quot; . scalar(@$firstTupleTypes);
</del><ins>+    die &quot;Undistinguishable overloads for operation &quot; . $function-&gt;name . &quot; with length: &quot; . scalar(@$firstTupleTypes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetOverloadThatMatches
</span><span class="lines">@@ -2073,11 +2071,11 @@
</span><span class="cx"> {
</span><span class="cx">     my $function = shift;
</span><span class="cx"> 
</span><del>-    return $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional} unless $function-&gt;{overloads};
</del><ins>+    return $function-&gt;extendedAttributes-&gt;{Conditional} unless $function-&gt;{overloads};
</ins><span class="cx"> 
</span><span class="cx">     my %conditions;
</span><span class="cx">     foreach my $overload (@{$function-&gt;{overloads}}) {
</span><del>-        my $conditional = $overload-&gt;signature-&gt;extendedAttributes-&gt;{Conditional};
</del><ins>+        my $conditional = $overload-&gt;extendedAttributes-&gt;{Conditional};
</ins><span class="cx">         return unless $conditional;
</span><span class="cx">         $conditions{$conditional} = 1;
</span><span class="cx">     }
</span><span class="lines">@@ -2098,13 +2096,13 @@
</span><span class="cx">         $functionName = &quot;construct${className}&quot;;
</span><span class="cx">     } else {
</span><span class="cx">         my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : (OperationShouldBeOnInstance($interface, $function) ? &quot;Instance&quot; : &quot;Prototype&quot;);
</span><del>-        $functionName = &quot;js${interfaceName}${kind}Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name);
</del><ins>+        $functionName = &quot;js${interfaceName}${kind}Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;name);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     my $generateOverloadCallIfNecessary = sub {
</span><span class="cx">         my ($overload, $condition) = @_;
</span><span class="cx">         return unless $overload;
</span><del>-        my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($overload-&gt;signature);
</del><ins>+        my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($overload);
</ins><span class="cx">         push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx">         push(@implContent, &quot;        if ($condition)\n    &quot;) if $condition;
</span><span class="cx">         push(@implContent, &quot;        return ${functionName}$overload-&gt;{overloadIndex}(state);\n&quot;);
</span><span class="lines">@@ -2291,8 +2289,8 @@
</span><span class="cx">         my $function = shift;
</span><span class="cx"> 
</span><span class="cx">         my $length = 0;
</span><del>-        foreach my $parameter (@{$function-&gt;parameters}) {
-            last if $parameter-&gt;isOptional || $parameter-&gt;isVariadic;
</del><ins>+        foreach my $argument (@{$function-&gt;arguments}) {
+            last if $argument-&gt;isOptional || $argument-&gt;isVariadic;
</ins><span class="cx">             $length++;
</span><span class="cx">         }
</span><span class="cx">         return $length;
</span><span class="lines">@@ -2311,8 +2309,8 @@
</span><span class="cx">     my ($overloads) = @_;
</span><span class="cx">     my $result = 0;
</span><span class="cx">     foreach my $overload (@{$overloads}) {
</span><del>-        my @parameters = @{$overload-&gt;parameters};
-        $result = @parameters if $result &lt; @parameters;
</del><ins>+        my @arguments = @{$overload-&gt;arguments};
+        $result = @arguments if $result &lt; @arguments;
</ins><span class="cx">     }
</span><span class="cx">     return $result;
</span><span class="cx"> }
</span><span class="lines">@@ -2459,15 +2457,17 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # Returns the RuntimeEnabledFeatures function name that is hooked up to check if a method/attribute is enabled.
</span><ins>+# NOTE: Parameter passed in must have both an 'extendedAttributes' property.
+#  (e.g. DOMInterface, DOMAttribute, DOMOperation, DOMIterable, etc.)
</ins><span class="cx"> sub GetRuntimeEnableFunctionName
</span><span class="cx"> {
</span><del>-    my $signature = shift;
</del><ins>+    my $context = shift;
</ins><span class="cx"> 
</span><span class="cx">     # If a parameter is given (e.g. &quot;EnabledAtRuntime=FeatureName&quot;) return the RuntimeEnabledFeatures::sharedFeatures().{FeatureName}Enabled() method.
</span><del>-    return &quot;RuntimeEnabledFeatures::sharedFeatures().&quot; . ToMethodName($signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) . &quot;Enabled&quot; if ($signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime} &amp;&amp; $signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime} ne &quot;VALUE_IS_MISSING&quot;);
</del><ins>+    return &quot;RuntimeEnabledFeatures::sharedFeatures().&quot; . ToMethodName($context-&gt;extendedAttributes-&gt;{EnabledAtRuntime}) . &quot;Enabled&quot; if ($context-&gt;extendedAttributes-&gt;{EnabledAtRuntime} &amp;&amp; $context-&gt;extendedAttributes-&gt;{EnabledAtRuntime} ne &quot;VALUE_IS_MISSING&quot;);
</ins><span class="cx"> 
</span><span class="cx">     # Otherwise return a function named RuntimeEnabledFeatures::sharedFeatures().{methodName}Enabled().
</span><del>-    return &quot;RuntimeEnabledFeatures::sharedFeatures().&quot; . ToMethodName($signature-&gt;name) . &quot;Enabled&quot;;
</del><ins>+    return &quot;RuntimeEnabledFeatures::sharedFeatures().&quot; . ToMethodName($context-&gt;name) . &quot;Enabled&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetCastingHelperForThisObject
</span><span class="lines">@@ -2482,7 +2482,7 @@
</span><span class="cx">     my $indexedGetterFunction = shift;
</span><span class="cx">     
</span><span class="cx">     # FIXME: Should this work for all string types?
</span><del>-    return &quot;jsStringOrUndefined(state, thisObject-&gt;wrapped().item(index))&quot; if $indexedGetterFunction-&gt;signature-&gt;type-&gt;name eq &quot;DOMString&quot;;
</del><ins>+    return &quot;jsStringOrUndefined(state, thisObject-&gt;wrapped().item(index))&quot; if $indexedGetterFunction-&gt;type-&gt;name eq &quot;DOMString&quot;;
</ins><span class="cx">     return &quot;toJS(state, thisObject-&gt;globalObject(), thisObject-&gt;wrapped().item(index))&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2493,7 +2493,7 @@
</span><span class="cx"> 
</span><span class="cx">     my @unscopables;
</span><span class="cx">     foreach my $functionOrAttribute (@{$interface-&gt;functions}, @{$interface-&gt;attributes}) {
</span><del>-        push(@unscopables, $functionOrAttribute-&gt;signature-&gt;name) if $functionOrAttribute-&gt;signature-&gt;extendedAttributes-&gt;{Unscopable};
</del><ins>+        push(@unscopables, $functionOrAttribute-&gt;name) if $functionOrAttribute-&gt;extendedAttributes-&gt;{Unscopable};
</ins><span class="cx">     }
</span><span class="cx">     return if scalar(@unscopables) == 0;
</span><span class="cx"> 
</span><span class="lines">@@ -2507,10 +2507,8 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetResultTypeFilter
</span><span class="cx"> {
</span><del>-    my ($signature) = @_;
</del><ins>+    my ($type) = @_;
</ins><span class="cx"> 
</span><del>-    my $type = $signature-&gt;type;
-
</del><span class="cx">     my %TypeFilters = (
</span><span class="cx">         &quot;any&quot; =&gt; &quot;SpecHeapTop&quot;,
</span><span class="cx">         &quot;boolean&quot; =&gt; &quot;SpecBoolean&quot;,
</span><span class="lines">@@ -2592,10 +2590,10 @@
</span><span class="cx">         push(@implContent,&quot;// Functions\n\n&quot;);
</span><span class="cx">         foreach my $function (@functions) {
</span><span class="cx">             next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><del>-            next if $function-&gt;signature-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</del><ins>+            next if $function-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</ins><span class="cx">             next if IsJSBuiltin($interface, $function);
</span><span class="cx"> 
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</ins><span class="cx">                 if (!$inAppleCopyright) {
</span><span class="cx">                     push(@implContent, $beginAppleCopyrightForHeaderFiles);
</span><span class="cx">                     $inAppleCopyright = 1;
</span><span class="lines">@@ -2621,10 +2619,10 @@
</span><span class="cx">         push(@implContent, &quot;// Attributes\n\n&quot;);
</span><span class="cx"> 
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            next if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</del><ins>+            next if $attribute-&gt;extendedAttributes-&gt;{ForwardDeclareInHeader};
</ins><span class="cx">             next if IsJSBuiltin($interface, $attribute);
</span><span class="cx"> 
</span><del>-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
</ins><span class="cx">             push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx">             my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx">             push(@implContent, &quot;JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);\n&quot;);
</span><span class="lines">@@ -2701,18 +2699,18 @@
</span><span class="cx"> 
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><span class="cx">             next unless ($attribute-&gt;isStatic);
</span><del>-            my $name = $attribute-&gt;signature-&gt;name;
</del><ins>+            my $name = $attribute-&gt;name;
</ins><span class="cx">             push(@hashKeys, $name);
</span><span class="cx"> 
</span><span class="cx">             my @specials = ();
</span><span class="cx">             push(@specials, &quot;DontDelete&quot;) if IsUnforgeable($interface, $attribute);
</span><span class="cx">             push(@specials, &quot;ReadOnly&quot;) if IsReadonly($attribute);
</span><del>-            push(@specials, &quot;DOMJITAttribute&quot;) if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</del><ins>+            push(@specials, &quot;DOMJITAttribute&quot;) if $attribute-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;};
</ins><span class="cx">             my $special = (@specials &gt; 0) ? join(&quot; | &quot;, @specials) : &quot;0&quot;;
</span><span class="cx">             push(@hashSpecials, $special);
</span><span class="cx"> 
</span><del>-            if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;}) {
-                push(@hashValue1, &quot;domJITGetterSetterFor&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name));
</del><ins>+            if ($attribute-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;}) {
+                push(@hashValue1, &quot;domJITGetterSetterFor&quot; . $interface-&gt;type-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name));
</ins><span class="cx">                 push(@hashValue2, &quot;0&quot;);
</span><span class="cx">             } else {
</span><span class="cx">                 my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="lines">@@ -2726,7 +2724,7 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            my $conditional = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional};
</del><ins>+            my $conditional = $attribute-&gt;extendedAttributes-&gt;{Conditional};
</ins><span class="cx">             $conditionals{$name} = $conditional if $conditional;
</span><span class="cx"> 
</span><span class="cx">             $hashSize++;
</span><span class="lines">@@ -2735,7 +2733,7 @@
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             next unless ($function-&gt;isStatic);
</span><span class="cx">             next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><del>-            my $name = $function-&gt;signature-&gt;name;
</del><ins>+            my $name = $function-&gt;name;
</ins><span class="cx">             push(@hashKeys, $name);
</span><span class="cx"> 
</span><span class="cx">             my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="lines">@@ -2746,7 +2744,7 @@
</span><span class="cx"> 
</span><span class="cx">             push(@hashSpecials, ComputeFunctionSpecial($interface, $function));
</span><span class="cx"> 
</span><del>-            my $conditional = $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional};
</del><ins>+            my $conditional = $function-&gt;extendedAttributes-&gt;{Conditional};
</ins><span class="cx">             $conditionals{$name} = $conditional if $conditional;
</span><span class="cx"> 
</span><span class="cx">             $hashSize++;
</span><span class="lines">@@ -2821,12 +2819,11 @@
</span><span class="cx">         my @runtimeEnabledProperties = @runtimeEnabledFunctions;
</span><span class="cx">         push(@runtimeEnabledProperties, @runtimeEnabledAttributes);
</span><span class="cx">         foreach my $functionOrAttribute (@runtimeEnabledProperties) {
</span><del>-            my $signature = $functionOrAttribute-&gt;signature;
-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($signature);
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($functionOrAttribute);
</ins><span class="cx">             push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx">             AddToImplIncludes(&quot;RuntimeEnabledFeatures.h&quot;);
</span><del>-            my $enable_function = GetRuntimeEnableFunctionName($signature);
-            my $name = $signature-&gt;name;
</del><ins>+            my $enable_function = GetRuntimeEnableFunctionName($functionOrAttribute);
+            my $name = $functionOrAttribute-&gt;name;
</ins><span class="cx">             push(@implContent, &quot;    if (!${enable_function}()) {\n&quot;);
</span><span class="cx">             push(@implContent, &quot;        Identifier propertyName = Identifier::fromString(&amp;vm, reinterpret_cast&lt;const LChar*&gt;(\&quot;$name\&quot;), strlen(\&quot;$name\&quot;));\n&quot;);
</span><span class="cx">             push(@implContent, &quot;        VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);\n&quot;);
</span><span class="lines">@@ -2837,11 +2834,11 @@
</span><span class="cx"> 
</span><span class="cx">         my $firstPrivateFunction = 1;
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><del>-            next unless ($function-&gt;signature-&gt;extendedAttributes-&gt;{PrivateIdentifier});
</del><ins>+            next unless ($function-&gt;extendedAttributes-&gt;{PrivateIdentifier});
</ins><span class="cx">             AddToImplIncludes(&quot;WebCoreJSClientData.h&quot;);
</span><span class="cx">             push(@implContent, &quot;    JSVMClientData&amp; clientData = *static_cast&lt;JSVMClientData*&gt;(vm.clientData);\n&quot;) if $firstPrivateFunction;
</span><span class="cx">             $firstPrivateFunction = 0;
</span><del>-            push(@implContent, &quot;    putDirect(vm, clientData.builtinNames().&quot; . $function-&gt;signature-&gt;name . &quot;PrivateName(), JSFunction::create(vm, globalObject(), 0, String(), &quot; . GetFunctionName($interface, $className, $function) . &quot;), ReadOnly | DontEnum);\n&quot;);
</del><ins>+            push(@implContent, &quot;    putDirect(vm, clientData.builtinNames().&quot; . $function-&gt;name . &quot;PrivateName(), JSFunction::create(vm, globalObject(), 0, String(), &quot; . GetFunctionName($interface, $className, $function) . &quot;), ReadOnly | DontEnum);\n&quot;);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ($interface-&gt;iterable) {
</span><span class="lines">@@ -2914,13 +2911,13 @@
</span><span class="cx">         }
</span><span class="cx">         # Support for RuntimeEnabled attributes on global objects.
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            next unless $attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime};
</del><ins>+            next unless $attribute-&gt;extendedAttributes-&gt;{EnabledAtRuntime};
</ins><span class="cx"> 
</span><span class="cx">             AddToImplIncludes(&quot;RuntimeEnabledFeatures.h&quot;);
</span><del>-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
</ins><span class="cx">             push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><del>-            my $enable_function = GetRuntimeEnableFunctionName($attribute-&gt;signature);
-            my $attributeName = $attribute-&gt;signature-&gt;name;
</del><ins>+            my $enable_function = GetRuntimeEnableFunctionName($attribute);
+            my $attributeName = $attribute-&gt;name;
</ins><span class="cx">             push(@implContent, &quot;    if (${enable_function}()) {\n&quot;);
</span><span class="cx">             my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx">             my $setter = IsReadonly($attribute) ? &quot;nullptr&quot; : GetAttributeSetterName($interface, $className, $attribute);
</span><span class="lines">@@ -2933,11 +2930,11 @@
</span><span class="cx"> 
</span><span class="cx">         # Support PrivateIdentifier attributes on global objects
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            next unless $attribute-&gt;signature-&gt;extendedAttributes-&gt;{PrivateIdentifier};
</del><ins>+            next unless $attribute-&gt;extendedAttributes-&gt;{PrivateIdentifier};
</ins><span class="cx"> 
</span><span class="cx">             AddToImplIncludes(&quot;WebCoreJSClientData.h&quot;);
</span><del>-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
-            my $attributeName = $attribute-&gt;signature-&gt;name;
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
+            my $attributeName = $attribute-&gt;name;
</ins><span class="cx">             my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx"> 
</span><span class="cx">             push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="lines">@@ -2947,14 +2944,14 @@
</span><span class="cx"> 
</span><span class="cx">         # Support for RuntimeEnabled operations on global objects.
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><del>-            next unless $function-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime};
</del><ins>+            next unless $function-&gt;extendedAttributes-&gt;{EnabledAtRuntime};
</ins><span class="cx">             next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><span class="cx"> 
</span><span class="cx">             AddToImplIncludes(&quot;RuntimeEnabledFeatures.h&quot;);
</span><del>-            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($function-&gt;signature);
</del><ins>+            my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($function);
</ins><span class="cx">             push(@implContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><del>-            my $enable_function = GetRuntimeEnableFunctionName($function-&gt;signature);
-            my $functionName = $function-&gt;signature-&gt;name;
</del><ins>+            my $enable_function = GetRuntimeEnableFunctionName($function);
+            my $functionName = $function-&gt;name;
</ins><span class="cx">             my $implementationFunction = GetFunctionName($interface, $className, $function);
</span><span class="cx">             my $functionLength = GetFunctionLength($function);
</span><span class="cx">             my $jsAttributes = ComputeFunctionSpecial($interface, $function);
</span><span class="lines">@@ -2961,7 +2958,7 @@
</span><span class="cx">             push(@implContent, &quot;    if (${enable_function}())\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             my $propertyName = &quot;vm.propertyNames-&gt;$functionName&quot;;
</span><del>-            $propertyName = &quot;static_cast&lt;JSVMClientData*&gt;(vm.clientData)-&gt;builtinNames().&quot; . $functionName . &quot;PrivateName()&quot; if $function-&gt;signature-&gt;extendedAttributes-&gt;{PrivateIdentifier};
</del><ins>+            $propertyName = &quot;static_cast&lt;JSVMClientData*&gt;(vm.clientData)-&gt;builtinNames().&quot; . $functionName . &quot;PrivateName()&quot; if $function-&gt;extendedAttributes-&gt;{PrivateIdentifier};
</ins><span class="cx">             if (IsJSBuiltin($interface, $function)) {
</span><span class="cx">                 push(@implContent, &quot;        putDirectBuiltinFunction(vm, this, $propertyName, $implementationFunction(vm), attributesForStructure($jsAttributes));\n&quot;);
</span><span class="cx">             } else {
</span><span class="lines">@@ -3032,7 +3029,7 @@
</span><span class="cx"> 
</span><span class="cx">             if ($indexedGetterFunction) {
</span><span class="cx">                 # FIXME: Should this work for all string types?
</span><del>-                if ($indexedGetterFunction-&gt;signature-&gt;type-&gt;name eq &quot;DOMString&quot;) {
</del><ins>+                if ($indexedGetterFunction-&gt;type-&gt;name eq &quot;DOMString&quot;) {
</ins><span class="cx">                     push(@implContent, &quot;    if (LIKELY(index &lt;= MAX_ARRAY_INDEX)) {\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@implContent, &quot;    if (LIKELY(index &lt; thisObject-&gt;wrapped().length())) {\n&quot;);
</span><span class="lines">@@ -3110,20 +3107,20 @@
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><span class="cx">             next if IsJSBuiltin($interface, $attribute);
</span><span class="cx"> 
</span><del>-            my $name = $attribute-&gt;signature-&gt;name;
-            my $type = $attribute-&gt;signature-&gt;type;
</del><ins>+            my $name = $attribute-&gt;name;
+            my $type = $attribute-&gt;type;
</ins><span class="cx">             my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
</span><del>-            my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $name);
-            my $getterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException};
</del><ins>+            my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;extendedAttributes-&gt;{ImplementedAs} || $name);
+            my $getterMayThrowLegacyException = $attribute-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException};
</ins><span class="cx"> 
</span><span class="cx">             $implIncludes{&quot;ExceptionCode.h&quot;} = 1 if $getterMayThrowLegacyException;
</span><span class="cx"> 
</span><del>-            my $attributeConditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</del><ins>+            my $attributeConditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
</ins><span class="cx">             push(@implContent, &quot;#if ${attributeConditionalString}\n&quot;) if $attributeConditionalString;
</span><span class="cx"> 
</span><span class="cx">             if (!$attribute-&gt;isStatic || $codeGenerator-&gt;IsConstructorType($type)) {
</span><span class="cx">                 my $templateParameters = &quot;${getFunctionName}Getter&quot;;
</span><del>-                if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{LenientThis}) {
</del><ins>+                if ($attribute-&gt;extendedAttributes-&gt;{LenientThis}) {
</ins><span class="cx">                     $templateParameters .= &quot;, CastedThisErrorBehavior::ReturnEarly&quot;;
</span><span class="cx">                 } elsif (IsReturningPromise($attribute)) {
</span><span class="cx">                     $templateParameters .= &quot;, CastedThisErrorBehavior::RejectPromise&quot;;
</span><span class="lines">@@ -3154,7 +3151,7 @@
</span><span class="cx">             push(@implContent, &quot;    UNUSED_PARAM(state);\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             my @arguments = ();
</span><del>-            if ($getterMayThrowLegacyException &amp;&amp; !HasCustomGetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</del><ins>+            if ($getterMayThrowLegacyException &amp;&amp; !HasCustomGetter($attribute-&gt;extendedAttributes)) {
</ins><span class="cx">                 push(@arguments, &quot;ec&quot;);
</span><span class="cx">                 push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;);
</span><span class="cx">             }
</span><span class="lines">@@ -3161,10 +3158,10 @@
</span><span class="cx"> 
</span><span class="cx">             # Global constructors can be disabled at runtime.
</span><span class="cx">             if ($codeGenerator-&gt;IsConstructorType($type)) {
</span><del>-                if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledBySetting}) {
</del><ins>+                if ($attribute-&gt;extendedAttributes-&gt;{EnabledBySetting}) {
</ins><span class="cx">                     AddToImplIncludes(&quot;Frame.h&quot;);
</span><span class="cx">                     AddToImplIncludes(&quot;Settings.h&quot;);
</span><del>-                    my $enable_function = ToMethodName($attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledBySetting}) . &quot;Enabled&quot;;
</del><ins>+                    my $enable_function = ToMethodName($attribute-&gt;extendedAttributes-&gt;{EnabledBySetting}) . &quot;Enabled&quot;;
</ins><span class="cx">                     push(@implContent, &quot;    if (UNLIKELY(!thisObject.wrapped().frame()))\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;        return jsUndefined();\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    Settings&amp; settings = thisObject.wrapped().frame()-&gt;settings();\n&quot;);
</span><span class="lines">@@ -3173,11 +3170,11 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            $needsVisitChildren = 1 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{CachedAttribute};
</del><ins>+            $needsVisitChildren = 1 if $attribute-&gt;extendedAttributes-&gt;{CachedAttribute};
</ins><span class="cx"> 
</span><span class="cx">             if ($interface-&gt;extendedAttributes-&gt;{CheckSecurity} &amp;&amp;
</span><del>-                !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{DoNotCheckSecurity} &amp;&amp;
-                !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{DoNotCheckSecurityOnGetter}) {
</del><ins>+                !$attribute-&gt;extendedAttributes-&gt;{DoNotCheckSecurity} &amp;&amp;
+                !$attribute-&gt;extendedAttributes-&gt;{DoNotCheckSecurityOnGetter}) {
</ins><span class="cx">                 if ($interfaceName eq &quot;DOMWindow&quot;) {
</span><span class="cx">                     push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(&amp;state, thisObject.wrapped(), ThrowSecurityError))\n&quot;);
</span><span class="cx">                 } else {
</span><span class="lines">@@ -3186,7 +3183,7 @@
</span><span class="cx">                 push(@implContent, &quot;        return jsUndefined();\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{Nondeterministic}) {
</del><ins>+            if ($attribute-&gt;extendedAttributes-&gt;{Nondeterministic}) {
</ins><span class="cx">                 AddToImplIncludes(&quot;MemoizedDOMResult.h&quot;, &quot;WEB_REPLAY&quot;);
</span><span class="cx">                 AddToImplIncludes(&quot;&lt;replay/InputCursor.h&gt;&quot;, &quot;WEB_REPLAY&quot;);
</span><span class="cx">                 AddToImplIncludes(&quot;&lt;wtf/NeverDestroyed.h&gt;&quot;, &quot;WEB_REPLAY&quot;);
</span><span class="lines">@@ -3202,7 +3199,7 @@
</span><span class="cx">                 push(@implContent, &quot;    if (cursor.isCapturing()) {\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;        $memoizedType memoizedResult = thisObject.wrapped().$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;);\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;        cursor.appendInput&lt;MemoizedDOMResult&lt;$memoizedType&gt;&gt;(bindingName.get().string(), memoizedResult, $exceptionCode);\n&quot;);
</span><del>-                push(@implContent, &quot;        JSValue result = &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;memoizedResult&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</del><ins>+                push(@implContent, &quot;        JSValue result = &quot; . NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;memoizedResult&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                 push(@implContent, &quot;        setDOMException(&amp;state, throwScope, ec);\n&quot;) if $getterMayThrowLegacyException;
</span><span class="cx">                 push(@implContent, &quot;        return result;\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    }\n&quot;);
</span><span class="lines">@@ -3212,7 +3209,7 @@
</span><span class="cx">                 push(@implContent, &quot;        MemoizedDOMResultBase* input = cursor.fetchInput&lt;MemoizedDOMResultBase&gt;();\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;        if (input &amp;&amp; input-&gt;convertTo&lt;$memoizedType&gt;(memoizedResult)) {\n&quot;);
</span><span class="cx">                 # FIXME: the generated code should report an error if an input cannot be fetched or converted.
</span><del>-                push(@implContent, &quot;            JSValue result = &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;memoizedResult&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</del><ins>+                push(@implContent, &quot;            JSValue result = &quot; . NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;memoizedResult&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                 push(@implContent, &quot;            setDOMException(&amp;state, throwScope, input-&gt;exceptionCode());\n&quot;) if $getterMayThrowLegacyException;
</span><span class="cx">                 push(@implContent, &quot;            return result;\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;        }\n&quot;);
</span><span class="lines">@@ -3220,17 +3217,17 @@
</span><span class="cx">                 push(@implContent, &quot;#endif\n&quot;);
</span><span class="cx">             } # attribute Nondeterministic
</span><span class="cx"> 
</span><del>-            if (HasCustomGetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</del><ins>+            if (HasCustomGetter($attribute-&gt;extendedAttributes)) {
</ins><span class="cx">                 push(@implContent, &quot;    return thisObject.$implGetterFunctionName(state);\n&quot;);
</span><span class="cx">             } elsif ($type-&gt;name eq &quot;EventHandler&quot;) {
</span><span class="cx">                 $implIncludes{&quot;EventNames.h&quot;} = 1;
</span><del>-                my $getter = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{WindowEventHandler} ? &quot;windowEventHandlerAttribute&quot;
-                    : $attribute-&gt;signature-&gt;extendedAttributes-&gt;{DocumentEventHandler} ? &quot;documentEventHandlerAttribute&quot;
</del><ins>+                my $getter = $attribute-&gt;extendedAttributes-&gt;{WindowEventHandler} ? &quot;windowEventHandlerAttribute&quot;
+                    : $attribute-&gt;extendedAttributes-&gt;{DocumentEventHandler} ? &quot;documentEventHandlerAttribute&quot;
</ins><span class="cx">                     : &quot;eventHandlerAttribute&quot;;
</span><span class="cx">                 my $eventName = EventHandlerAttributeEventName($attribute);
</span><span class="cx">                 push(@implContent, &quot;    return $getter(thisObject.wrapped(), $eventName);\n&quot;);
</span><del>-            } elsif ($codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;type)) {
-                my $constructorType = $attribute-&gt;signature-&gt;type-&gt;name;
</del><ins>+            } elsif ($codeGenerator-&gt;IsConstructorType($attribute-&gt;type)) {
+                my $constructorType = $attribute-&gt;type-&gt;name;
</ins><span class="cx">                 $constructorType =~ s/Constructor$//;
</span><span class="cx">                 # When Constructor attribute is used by DOMWindow.idl, it's correct to pass thisObject as the global object
</span><span class="cx">                 # When JSDOMWrappers have a back-pointer to the globalObject we can pass thisObject-&gt;globalObject()
</span><span class="lines">@@ -3239,33 +3236,33 @@
</span><span class="cx">                     $constructorType =~ s/Named$//;
</span><span class="cx">                     push(@implContent, &quot;    return JS&quot; . $constructorType . &quot;::get${named}Constructor(state.vm(), &amp;thisObject);\n&quot;);
</span><span class="cx">                 } else {
</span><del>-                    AddToImplIncludes(&quot;JS&quot; . $constructorType . &quot;.h&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</del><ins>+                    AddToImplIncludes(&quot;JS&quot; . $constructorType . &quot;.h&quot;, $attribute-&gt;extendedAttributes-&gt;{Conditional});
</ins><span class="cx">                     push(@implContent, &quot;    return JS&quot; . $constructorType . &quot;::getConstructor(state.vm(), thisObject.globalObject());\n&quot;);
</span><span class="cx">                 }
</span><del>-            } elsif (!$attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException}) {
</del><ins>+            } elsif (!$attribute-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException}) {
</ins><span class="cx">                 my $cacheIndex = 0;
</span><del>-                if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CachedAttribute}) {
</del><ins>+                if ($attribute-&gt;extendedAttributes-&gt;{CachedAttribute}) {
</ins><span class="cx">                     $cacheIndex = $currentCachedAttribute;
</span><span class="cx">                     $currentCachedAttribute++;
</span><del>-                    push(@implContent, &quot;    if (JSValue cachedValue = thisObject.m_&quot; . $attribute-&gt;signature-&gt;name . &quot;.get())\n&quot;);
</del><ins>+                    push(@implContent, &quot;    if (JSValue cachedValue = thisObject.m_&quot; . $attribute-&gt;name . &quot;.get())\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;        return cachedValue;\n&quot;);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                my @callWithArgs = GenerateCallWithUsingReferences($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CallWith}, \@implContent, &quot;jsUndefined()&quot;);
</del><ins>+                my @callWithArgs = GenerateCallWithUsingReferences($attribute-&gt;extendedAttributes-&gt;{CallWith}, \@implContent, &quot;jsUndefined()&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 if ($svgListPropertyType) {
</span><del>-                    push(@implContent, &quot;    JSValue result =  &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;thisObject.wrapped().$implGetterFunctionName(&quot; . (join &quot;, &quot;, @callWithArgs) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</del><ins>+                    push(@implContent, &quot;    JSValue result =  &quot; . NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;thisObject.wrapped().$implGetterFunctionName(&quot; . (join &quot;, &quot;, @callWithArgs) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                 } elsif ($svgPropertyOrListPropertyType) {
</span><span class="cx">                     push(@implContent, &quot;    $svgPropertyOrListPropertyType&amp; impl = thisObject.wrapped().propertyReference();\n&quot;);
</span><span class="cx">                     if ($svgPropertyOrListPropertyType eq &quot;float&quot;) { # Special case for JSSVGNumber
</span><del>-                        push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;impl&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</del><ins>+                        push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;impl&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                     } else {
</span><del>-                        push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;impl.$implGetterFunctionName(&quot; . (join &quot;, &quot;, @callWithArgs) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</del><ins>+                        push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;impl.$implGetterFunctionName(&quot; . (join &quot;, &quot;, @callWithArgs) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">                     }
</span><span class="cx">                 } else {
</span><span class="cx">                     my ($functionName, @arguments) = $codeGenerator-&gt;GetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><del>-                    my $implementedBy = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedBy};
</del><ins>+                    my $implementedBy = $attribute-&gt;extendedAttributes-&gt;{ImplementedBy};
</ins><span class="cx">                     if ($implementedBy) {
</span><span class="cx">                         $implIncludes{&quot;${implementedBy}.h&quot;} = 1;
</span><span class="cx">                         $functionName = &quot;WebCore::${implementedBy}::${functionName}&quot;;
</span><span class="lines">@@ -3277,7 +3274,7 @@
</span><span class="cx">                     }
</span><span class="cx"> 
</span><span class="cx">                     unshift(@arguments, @callWithArgs);
</span><del>-                    my $jsType = NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;${functionName}(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;thisObject&quot;);
</del><ins>+                    my $jsType = NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;${functionName}(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;thisObject&quot;);
</ins><span class="cx">                     push(@implContent, &quot;    auto&amp; impl = thisObject.wrapped();\n&quot;) if !$attribute-&gt;isStatic;
</span><span class="cx">                     if ($codeGenerator-&gt;IsSVGAnimatedType($type)) {
</span><span class="cx">                         push(@implContent, &quot;    auto obj = $jsType;\n&quot;);
</span><span class="lines">@@ -3287,18 +3284,18 @@
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                push(@implContent, &quot;    thisObject.m_&quot; . $attribute-&gt;signature-&gt;name . &quot;.set(state.vm(), &amp;thisObject, result);\n&quot;) if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{CachedAttribute};
</del><ins>+                push(@implContent, &quot;    thisObject.m_&quot; . $attribute-&gt;name . &quot;.set(state.vm(), &amp;thisObject, result);\n&quot;) if $attribute-&gt;extendedAttributes-&gt;{CachedAttribute};
</ins><span class="cx">                 push(@implContent, &quot;    return result;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             } else {
</span><del>-                unshift(@arguments, GenerateCallWithUsingReferences($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CallWith}, \@implContent, &quot;jsUndefined()&quot;, 0));
</del><ins>+                unshift(@arguments, GenerateCallWithUsingReferences($attribute-&gt;extendedAttributes-&gt;{CallWith}, \@implContent, &quot;jsUndefined()&quot;, 0));
</ins><span class="cx"> 
</span><span class="cx">                 if ($svgPropertyOrListPropertyType) {
</span><span class="cx">                     push(@implContent, &quot;    $svgPropertyOrListPropertyType impl(*thisObject.wrapped());\n&quot;);
</span><del>-                    push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</del><ins>+                    push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                 } else {
</span><span class="cx">                     push(@implContent, &quot;    auto&amp; impl = thisObject.wrapped();\n&quot;);
</span><del>-                    push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</del><ins>+                    push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValueUsingReferences($attribute, 0, $interface, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;thisObject&quot;) . &quot;;\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 push(@implContent, &quot;    setDOMException(&amp;state, throwScope, ec);\n&quot;);
</span><span class="lines">@@ -3308,15 +3305,15 @@
</span><span class="cx"> 
</span><span class="cx">             push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx"> 
</span><del>-            if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;}) {
</del><ins>+            if ($attribute-&gt;extendedAttributes-&gt;{&quot;DOMJIT&quot;}) {
</ins><span class="cx">                 $implIncludes{&quot;&lt;wtf/NeverDestroyed.h&gt;&quot;} = 1;
</span><span class="cx">                 my $interfaceName = $interface-&gt;type-&gt;name;
</span><del>-                my $attributeName = $attribute-&gt;signature-&gt;name;
-                my $generatorName = $interfaceName . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name);
</del><ins>+                my $attributeName = $attribute-&gt;name;
+                my $generatorName = $interfaceName . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;name);
</ins><span class="cx">                 my $domJITClassName = $generatorName . &quot;DOMJIT&quot;;
</span><span class="cx">                 my $getter = GetAttributeGetterName($interface, $generatorName, $attribute);
</span><span class="cx">                 my $setter = IsReadonly($attribute) ? &quot;nullptr&quot; : GetAttributeSetterName($interface, $generatorName, $attribute);
</span><del>-                my $resultType = GetResultTypeFilter($attribute-&gt;signature);
</del><ins>+                my $resultType = GetResultTypeFilter($attribute-&gt;type);
</ins><span class="cx">                 push(@implContent, &quot;$domJITClassName::$domJITClassName()\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    : JSC::DOMJIT::GetterSetter($getter, $setter, ${className}::info(), $resultType)\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;{\n&quot;);
</span><span class="lines">@@ -3426,21 +3423,21 @@
</span><span class="cx">         if (!IsReadonly($attribute)) {
</span><span class="cx">             next if IsJSBuiltin($interface, $attribute);
</span><span class="cx"> 
</span><del>-            my $name = $attribute-&gt;signature-&gt;name;
-            my $type = $attribute-&gt;signature-&gt;type;
</del><ins>+            my $name = $attribute-&gt;name;
+            my $type = $attribute-&gt;type;
</ins><span class="cx">             my $putFunctionName = GetAttributeSetterName($interface, $className, $attribute);
</span><span class="cx">             my $implSetterFunctionName = $codeGenerator-&gt;WK_ucfirst($name);
</span><del>-            my $setterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterMayThrowLegacyException};
</del><ins>+            my $setterMayThrowLegacyException = $attribute-&gt;extendedAttributes-&gt;{SetterMayThrowLegacyException};
</ins><span class="cx"> 
</span><span class="cx">             $implIncludes{&quot;ExceptionCode.h&quot;} = 1 if $setterMayThrowLegacyException;
</span><span class="cx"> 
</span><del>-            my $attributeConditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</del><ins>+            my $attributeConditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute);
</ins><span class="cx">             push(@implContent, &quot;#if ${attributeConditionalString}\n&quot;) if $attributeConditionalString;
</span><span class="cx"> 
</span><span class="cx">             if (!$attribute-&gt;isStatic) {
</span><span class="cx">                 my $setterFunction = &quot;${putFunctionName}Function&quot;;
</span><span class="cx">                 my $templateParameters = $setterFunction;
</span><del>-                $templateParameters .= &quot;, CastedThisErrorBehavior::ReturnEarly&quot; if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{LenientThis};
</del><ins>+                $templateParameters .= &quot;, CastedThisErrorBehavior::ReturnEarly&quot; if $attribute-&gt;extendedAttributes-&gt;{LenientThis};
</ins><span class="cx"> 
</span><span class="cx">                 push(@implContent, &quot;static inline bool ${setterFunction}(ExecState&amp;, ${className}&amp;, JSValue, ThrowScope&amp;);\n\n&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -3462,7 +3459,7 @@
</span><span class="cx">                 push(@implContent, &quot;    auto value = JSValue::decode(encodedValue);\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CEReactions}) {
</del><ins>+            if ($attribute-&gt;extendedAttributes-&gt;{CEReactions}) {
</ins><span class="cx">                 push(@implContent, &quot;#if ENABLE(CUSTOM_ELEMENTS)\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    CustomElementReactionStack customElementReactionStack;\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;#endif\n&quot;);
</span><span class="lines">@@ -3469,7 +3466,7 @@
</span><span class="cx">                 $implIncludes{&quot;CustomElementReactionQueue.h&quot;} = 1;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if ($interface-&gt;extendedAttributes-&gt;{CheckSecurity} &amp;&amp; !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{DoNotCheckSecurity} &amp;&amp; !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{DoNotCheckSecurityOnSetter}) {
</del><ins>+            if ($interface-&gt;extendedAttributes-&gt;{CheckSecurity} &amp;&amp; !$attribute-&gt;extendedAttributes-&gt;{DoNotCheckSecurity} &amp;&amp; !$attribute-&gt;extendedAttributes-&gt;{DoNotCheckSecurityOnSetter}) {
</ins><span class="cx">                 if ($interfaceName eq &quot;DOMWindow&quot;) {
</span><span class="cx">                     push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(&amp;state, thisObject.wrapped(), ThrowSecurityError))\n&quot;);
</span><span class="cx">                 } else {
</span><span class="lines">@@ -3478,7 +3475,7 @@
</span><span class="cx">                 push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if (HasCustomSetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</del><ins>+            if (HasCustomSetter($attribute-&gt;extendedAttributes)) {
</ins><span class="cx">                 push(@implContent, &quot;    thisObject.set$implSetterFunctionName(state, value);\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    return true;\n&quot;);
</span><span class="cx">             } elsif ($type-&gt;name eq &quot;EventHandler&quot;) {
</span><span class="lines">@@ -3490,8 +3487,8 @@
</span><span class="cx">                     push(@implContent, &quot;    thisObject.wrapped().setAttributeEventListener($eventName, createJSErrorHandler(&amp;state, value, &amp;thisObject));\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     $implIncludes{&quot;JSEventListener.h&quot;} = 1;
</span><del>-                    my $setter = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{WindowEventHandler} ? &quot;setWindowEventHandlerAttribute&quot;
-                        : $attribute-&gt;signature-&gt;extendedAttributes-&gt;{DocumentEventHandler} ? &quot;setDocumentEventHandlerAttribute&quot;
</del><ins>+                    my $setter = $attribute-&gt;extendedAttributes-&gt;{WindowEventHandler} ? &quot;setWindowEventHandlerAttribute&quot;
+                        : $attribute-&gt;extendedAttributes-&gt;{DocumentEventHandler} ? &quot;setDocumentEventHandlerAttribute&quot;
</ins><span class="cx">                         : &quot;setEventHandlerAttribute&quot;;
</span><span class="cx">                     push(@implContent, &quot;    $setter(state, thisObject, thisObject.wrapped(), $eventName, value);\n&quot;);
</span><span class="cx">                 }
</span><span class="lines">@@ -3503,11 +3500,11 @@
</span><span class="cx">                 # We do not generate the header file for NamedConstructor of class XXXX,
</span><span class="cx">                 # since we generate the NamedConstructor declaration into the header file of class XXXX.
</span><span class="cx">                 if ($constructorType ne &quot;any&quot; and $constructorType !~ /Named$/) {
</span><del>-                    AddToImplIncludes(&quot;JS&quot; . $constructorType . &quot;.h&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</del><ins>+                    AddToImplIncludes(&quot;JS&quot; . $constructorType . &quot;.h&quot;, $attribute-&gt;extendedAttributes-&gt;{Conditional});
</ins><span class="cx">                 }
</span><span class="cx">                 push(@implContent, &quot;    // Shadowing a built-in constructor.\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    return thisObject.putDirect(state.vm(), Identifier::fromString(&amp;state, \&quot;$name\&quot;), value);\n&quot;);
</span><del>-            } elsif ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{Replaceable}) {
</del><ins>+            } elsif ($attribute-&gt;extendedAttributes-&gt;{Replaceable}) {
</ins><span class="cx">                 push(@implContent, &quot;    // Shadowing a built-in property.\n&quot;);
</span><span class="cx">                 if (AttributeShouldBeOnInstance($interface, $attribute)) {
</span><span class="cx">                     push(@implContent, &quot;    return replaceStaticPropertySlot(state.vm(), &amp;thisObject, Identifier::fromString(&amp;state, \&quot;$name\&quot;), value);\n&quot;);
</span><span class="lines">@@ -3516,12 +3513,12 @@
</span><span class="cx">                 }
</span><span class="cx">             } else {
</span><span class="cx">                 if (!$attribute-&gt;isStatic) {
</span><del>-                    my $putForwards = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{PutForwards};
</del><ins>+                    my $putForwards = $attribute-&gt;extendedAttributes-&gt;{PutForwards};
</ins><span class="cx">                     if ($putForwards) {
</span><del>-                        my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $name);
</del><ins>+                        my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;extendedAttributes-&gt;{ImplementedAs} || $name);
</ins><span class="cx">                         my $forwardedAttribute = $codeGenerator-&gt;GetAttributeFromInterface($interface, $type-&gt;name, $putForwards);
</span><span class="cx"> 
</span><del>-                        if ($forwardedAttribute-&gt;signature-&gt;extendedAttributes-&gt;{CEReactions}) {
</del><ins>+                        if ($forwardedAttribute-&gt;extendedAttributes-&gt;{CEReactions}) {
</ins><span class="cx">                             push(@implContent, &quot;#if ENABLE(CUSTOM_ELEMENTS)\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;    CustomElementReactionStack customElementReactionStack;\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;#endif\n&quot;);
</span><span class="lines">@@ -3539,7 +3536,7 @@
</span><span class="cx">                             push(@implContent, &quot;    auto&amp; impl = forwardedImpl.get();\n&quot;);
</span><span class="cx">                         }
</span><span class="cx">                         $attribute = $forwardedAttribute;
</span><del>-                        $type = $attribute-&gt;signature-&gt;type;
</del><ins>+                        $type = $attribute-&gt;type;
</ins><span class="cx">                     } else {
</span><span class="cx">                         push(@implContent, &quot;    auto&amp; impl = thisObject.wrapped();\n&quot;);
</span><span class="cx">                     }
</span><span class="lines">@@ -3547,12 +3544,12 @@
</span><span class="cx"> 
</span><span class="cx">                 push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;) if $setterMayThrowLegacyException;
</span><span class="cx"> 
</span><del>-                my $shouldPassByReference = ShouldPassWrapperByReference($attribute-&gt;signature, $interface);
</del><ins>+                my $shouldPassByReference = ShouldPassWrapperByReference($attribute, $interface);
</ins><span class="cx"> 
</span><del>-                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute-&gt;signature, &quot;value&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional}, &quot;&amp;state&quot;, &quot;state&quot;, &quot;thisObject&quot;);
</del><ins>+                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute, &quot;value&quot;, $attribute-&gt;extendedAttributes-&gt;{Conditional}, &quot;&amp;state&quot;, &quot;state&quot;, &quot;thisObject&quot;);
</ins><span class="cx">                 if (!$shouldPassByReference &amp;&amp; ($codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsTypedArrayType($type))) {
</span><span class="cx">                     $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><del>-                    push(@implContent, &quot;    &quot; . GetNativeTypeFromSignature($interface, $attribute-&gt;signature) . &quot; nativeValue = nullptr;\n&quot;);
</del><ins>+                    push(@implContent, &quot;    &quot; . GetNativeType($interface, $attribute-&gt;type) . &quot; nativeValue = nullptr;\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;    if (!value.isUndefinedOrNull()) {\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;        nativeValue = $nativeValue;\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;        RETURN_IF_EXCEPTION(throwScope, false);\n&quot;) if $mayThrowException;
</span><span class="lines">@@ -3593,7 +3590,7 @@
</span><span class="cx">                         my $functionString = &quot;podImpl.set$implSetterFunctionName(nativeValue&quot;;
</span><span class="cx">                         $functionString .= &quot;, ec&quot; if $setterMayThrowLegacyException;
</span><span class="cx">                         $functionString .= &quot;)&quot;;
</span><del>-                        $functionString = &quot;propagateException(state, throwScope, $functionString)&quot; if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterMayThrowException};
</del><ins>+                        $functionString = &quot;propagateException(state, throwScope, $functionString)&quot; if $attribute-&gt;extendedAttributes-&gt;{SetterMayThrowException};
</ins><span class="cx">                         push(@implContent, &quot;    $functionString;\n&quot;);
</span><span class="cx">                         push(@implContent, &quot;    setDOMException(&amp;state, throwScope, ec);\n&quot;) if $setterMayThrowLegacyException;
</span><span class="cx">                     }
</span><span class="lines">@@ -3616,9 +3613,9 @@
</span><span class="cx">                     } else {
</span><span class="cx">                         push(@arguments, $shouldPassByReference ? &quot;*nativeValue&quot; : &quot;WTFMove(nativeValue)&quot;);
</span><span class="cx">                     }
</span><del>-                    my $implementedBy = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedBy};
</del><ins>+                    my $implementedBy = $attribute-&gt;extendedAttributes-&gt;{ImplementedBy};
</ins><span class="cx">                     if ($implementedBy) {
</span><del>-                        AddToImplIncludes(&quot;${implementedBy}.h&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</del><ins>+                        AddToImplIncludes(&quot;${implementedBy}.h&quot;, $attribute-&gt;extendedAttributes-&gt;{Conditional});
</ins><span class="cx">                         unshift(@arguments, &quot;impl&quot;) if !$attribute-&gt;isStatic;
</span><span class="cx">                         $functionName = &quot;WebCore::${implementedBy}::${functionName}&quot;;
</span><span class="cx">                     } elsif ($attribute-&gt;isStatic) {
</span><span class="lines">@@ -3627,13 +3624,13 @@
</span><span class="cx">                         $functionName = &quot;impl.${functionName}&quot;;
</span><span class="cx">                     }
</span><span class="cx"> 
</span><del>-                    unshift(@arguments, GenerateCallWithUsingReferences($attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterCallWith}, \@implContent, &quot;false&quot;));
-                    unshift(@arguments, GenerateCallWithUsingReferences($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CallWith}, \@implContent, &quot;false&quot;));
</del><ins>+                    unshift(@arguments, GenerateCallWithUsingReferences($attribute-&gt;extendedAttributes-&gt;{SetterCallWith}, \@implContent, &quot;false&quot;));
+                    unshift(@arguments, GenerateCallWithUsingReferences($attribute-&gt;extendedAttributes-&gt;{CallWith}, \@implContent, &quot;false&quot;));
</ins><span class="cx"> 
</span><span class="cx">                     push(@arguments, &quot;ec&quot;) if $setterMayThrowLegacyException;
</span><span class="cx"> 
</span><span class="cx">                     my $functionString = &quot;$functionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;;
</span><del>-                    $functionString = &quot;propagateException(state, throwScope, $functionString)&quot; if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterMayThrowException};
</del><ins>+                    $functionString = &quot;propagateException(state, throwScope, $functionString)&quot; if $attribute-&gt;extendedAttributes-&gt;{SetterMayThrowException};
</ins><span class="cx"> 
</span><span class="cx">                     push(@implContent, &quot;    $functionString;\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    setDOMException(&amp;state, throwScope, ec);\n&quot;) if $setterMayThrowLegacyException;
</span><span class="lines">@@ -3683,7 +3680,7 @@
</span><span class="cx">         my $inAppleCopyright = 0;
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             next if IsJSBuiltin($interface, $function);
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{AppleCopyright}) {
</ins><span class="cx">                 if (!$inAppleCopyright) {
</span><span class="cx">                     push(@implContent, $beginAppleCopyrightForSourceFiles);
</span><span class="cx">                     $inAppleCopyright = 1;
</span><span class="lines">@@ -3693,18 +3690,18 @@
</span><span class="cx">                 $inAppleCopyright = 0;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            my $isCustom = HasCustomMethod($function-&gt;signature-&gt;extendedAttributes);
</del><ins>+            my $isCustom = HasCustomMethod($function-&gt;extendedAttributes);
</ins><span class="cx">             my $isOverloaded = $function-&gt;{overloads} &amp;&amp; @{$function-&gt;{overloads}} &gt; 1;
</span><span class="cx"> 
</span><del>-            my $mayThrowLegacyException = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</del><ins>+            my $mayThrowLegacyException = $function-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</ins><span class="cx"> 
</span><span class="cx">             next if $isCustom &amp;&amp; $isOverloaded &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><span class="cx"> 
</span><del>-            AddToImplIncludesForIDLType($function-&gt;signature-&gt;type) unless $isCustom or IsReturningPromise($function);
</del><ins>+            AddToImplIncludesForIDLType($function-&gt;type) unless $isCustom or IsReturningPromise($function);
</ins><span class="cx"> 
</span><span class="cx">             my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="cx"> 
</span><del>-            my $conditional = $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional};
</del><ins>+            my $conditional = $function-&gt;extendedAttributes-&gt;{Conditional};
</ins><span class="cx">             if ($conditional) {
</span><span class="cx">                 my $conditionalString = $codeGenerator-&gt;GenerateConditionalStringFromAttributeValue($conditional);
</span><span class="cx">                 push(@implContent, &quot;#if ${conditionalString}\n&quot;);
</span><span class="lines">@@ -3718,7 +3715,7 @@
</span><span class="cx">                 $functionReturn = &quot;static inline EncodedJSValue&quot;;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            my $functionImplementationName = $function-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $codeGenerator-&gt;WK_lcfirst($function-&gt;signature-&gt;name);
</del><ins>+            my $functionImplementationName = $function-&gt;extendedAttributes-&gt;{ImplementedAs} || $codeGenerator-&gt;WK_lcfirst($function-&gt;name);
</ins><span class="cx"> 
</span><span class="cx">             AddToImplIncludes(&quot;JSDOMPromise.h&quot;) if IsReturningPromise($function);
</span><span class="cx"> 
</span><span class="lines">@@ -3750,7 +3747,7 @@
</span><span class="cx"> 
</span><span class="cx">             $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx"> 
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{CEReactions}) {
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{CEReactions}) {
</ins><span class="cx">                 push(@implContent, &quot;#if ENABLE(CUSTOM_ELEMENTS)\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    CustomElementReactionStack customElementReactionStack;\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;#endif\n&quot;);
</span><span class="lines">@@ -3774,10 +3771,10 @@
</span><span class="cx">                     GenerateImplementationFunctionCall($function, $functionString, &quot;    &quot;, $svgPropertyType, $interface);
</span><span class="cx">                 }
</span><span class="cx">             } else {
</span><del>-                my $methodName = $function-&gt;signature-&gt;name;
</del><ins>+                my $methodName = $function-&gt;name;
</ins><span class="cx">                 if (IsReturningPromise($function) &amp;&amp; !$isCustom) {
</span><span class="cx">                     my $templateParameters = &quot;${functionName}Caller&quot;;
</span><del>-                    $templateParameters .= &quot;, CastedThisErrorBehavior::Assert&quot; if ($function-&gt;signature-&gt;extendedAttributes-&gt;{PrivateIdentifier} and not $function-&gt;signature-&gt;extendedAttributes-&gt;{PublicIdentifier});
</del><ins>+                    $templateParameters .= &quot;, CastedThisErrorBehavior::Assert&quot; if ($function-&gt;extendedAttributes-&gt;{PrivateIdentifier} and not $function-&gt;extendedAttributes-&gt;{PublicIdentifier});
</ins><span class="cx">                     push(@implContent, &quot;    return BindingCaller&lt;$className&gt;::callPromiseOperation&lt;${templateParameters}&gt;(state, WTFMove(promise), \&quot;${methodName}\&quot;);\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;}\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;\n&quot;);
</span><span class="lines">@@ -3785,7 +3782,7 @@
</span><span class="cx">                 } else {
</span><span class="cx">                     my $classParameterType = $className eq &quot;JSEventTarget&quot; ? &quot;JSEventTargetWrapper*&quot; : &quot;${className}*&quot;;
</span><span class="cx">                     my $templateParameters = &quot;${functionName}Caller&quot;;
</span><del>-                    if ($function-&gt;signature-&gt;extendedAttributes-&gt;{PrivateIdentifier} and not $function-&gt;signature-&gt;extendedAttributes-&gt;{PublicIdentifier}) {
</del><ins>+                    if ($function-&gt;extendedAttributes-&gt;{PrivateIdentifier} and not $function-&gt;extendedAttributes-&gt;{PublicIdentifier}) {
</ins><span class="cx">                         $templateParameters .= &quot;, CastedThisErrorBehavior::Assert&quot;;
</span><span class="cx">                     } elsif (IsReturningPromise($function)) {
</span><span class="cx">                         # FIXME: We need this specific handling for custom promise-returning functions.
</span><span class="lines">@@ -3803,7 +3800,7 @@
</span><span class="cx">                 push(@implContent, &quot;    UNUSED_PARAM(state);\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    UNUSED_PARAM(throwScope);\n&quot;);
</span><span class="cx"> 
</span><del>-                if ($interface-&gt;extendedAttributes-&gt;{CheckSecurity} and !$function-&gt;signature-&gt;extendedAttributes-&gt;{DoNotCheckSecurity}) {
</del><ins>+                if ($interface-&gt;extendedAttributes-&gt;{CheckSecurity} and !$function-&gt;extendedAttributes-&gt;{DoNotCheckSecurity}) {
</ins><span class="cx">                     if ($interfaceName eq &quot;DOMWindow&quot;) {
</span><span class="cx">                         push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis-&gt;wrapped(), ThrowSecurityError))\n&quot;);
</span><span class="cx">                     } else {
</span><span class="lines">@@ -3870,8 +3867,8 @@
</span><span class="cx">         if ($numCachedAttributes &gt; 0) {
</span><span class="cx">             foreach (@{$interface-&gt;attributes}) {
</span><span class="cx">                 my $attribute = $_;
</span><del>-                if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{CachedAttribute}) {
-                    push(@implContent, &quot;    visitor.append(&amp;thisObject-&gt;m_&quot; . $attribute-&gt;signature-&gt;name . &quot;);\n&quot;);
</del><ins>+                if ($attribute-&gt;extendedAttributes-&gt;{CachedAttribute}) {
+                    push(@implContent, &quot;    visitor.append(&amp;thisObject-&gt;m_&quot; . $attribute-&gt;name . &quot;);\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -3893,7 +3890,7 @@
</span><span class="cx"> 
</span><span class="cx">     if ($indexedGetterFunction) {
</span><span class="cx">         # FIXME: Should this work for all string types.
</span><del>-        $implIncludes{&quot;URL.h&quot;} = 1 if $indexedGetterFunction-&gt;signature-&gt;type-&gt;name eq &quot;DOMString&quot;;
</del><ins>+        $implIncludes{&quot;URL.h&quot;} = 1 if $indexedGetterFunction-&gt;type-&gt;name eq &quot;DOMString&quot;;
</ins><span class="cx">         if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq &quot;RadioNodeList&quot;) {
</span><span class="cx">             $implIncludes{&quot;JSNode.h&quot;} = 1;
</span><span class="cx">             $implIncludes{&quot;Node.h&quot;} = 1;
</span><span class="lines">@@ -4086,21 +4083,21 @@
</span><span class="cx">     push(@implContent, &quot;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">     my @serializedAttributes = ();
</span><del>-    foreach my $attribute_name (@{$interface-&gt;serializable-&gt;attributes}) {
-        my $found_attribute = 0;
</del><ins>+    foreach my $attributeName (@{$interface-&gt;serializable-&gt;attributes}) {
+        my $foundAttribute = 0;
</ins><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            if ($attribute_name eq $attribute-&gt;signature-&gt;name) {
</del><ins>+            if ($attributeName eq $attribute-&gt;name) {
</ins><span class="cx">                 push @serializedAttributes, $attribute;
</span><del>-                $found_attribute = 1;
</del><ins>+                $foundAttribute = 1;
</ins><span class="cx">                 last;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        die &quot;Failed to find \&quot;serializer\&quot; attribute \&quot;$attribute_name\&quot; in $interfaceName&quot; if !$found_attribute;
</del><ins>+        die &quot;Failed to find \&quot;serializer\&quot; attribute \&quot;$attributeName\&quot; in $interfaceName&quot; if !$foundAttribute;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     foreach my $attribute (@serializedAttributes) {
</span><del>-        my $name = $attribute-&gt;signature-&gt;name;
</del><ins>+        my $name = $attribute-&gt;name;
</ins><span class="cx"> 
</span><span class="cx">         my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx">         push(@implContent, &quot;    auto ${name}Value = ${getFunctionName}Getter(*state, *thisObject, throwScope);\n&quot;);
</span><span class="lines">@@ -4178,7 +4175,7 @@
</span><span class="cx">         push(@callWithArgs, &quot;*document&quot;);
</span><span class="cx">     }
</span><span class="cx">     if ($function and $codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;ScriptArguments&quot;)) {
</span><del>-        push(@$outputArray, &quot;    RefPtr&lt;Inspector::ScriptArguments&gt; scriptArguments(Inspector::createScriptArguments($statePointer, &quot; . @{$function-&gt;parameters} . &quot;));\n&quot;);
</del><ins>+        push(@$outputArray, &quot;    RefPtr&lt;Inspector::ScriptArguments&gt; scriptArguments(Inspector::createScriptArguments($statePointer, &quot; . @{$function-&gt;arguments} . &quot;));\n&quot;);
</ins><span class="cx">         $implIncludes{&quot;&lt;inspector/ScriptArguments.h&gt;&quot;} = 1;
</span><span class="cx">         $implIncludes{&quot;&lt;inspector/ScriptCallStackFactory.h&gt;&quot;} = 1;
</span><span class="cx">         push(@callWithArgs, &quot;WTFMove(scriptArguments)&quot;);
</span><span class="lines">@@ -4196,17 +4193,16 @@
</span><span class="cx">     my $function = shift;
</span><span class="cx">     my $interface = shift;
</span><span class="cx"> 
</span><del>-    my $numMandatoryParams = @{$function-&gt;parameters};
-    foreach my $param (reverse(@{$function-&gt;parameters})) {
-        if ($param-&gt;isOptional or $param-&gt;isVariadic) {
-            $numMandatoryParams--;
</del><ins>+    my $numMandatoryArguments = @{$function-&gt;arguments};
+    foreach my $argument (reverse(@{$function-&gt;arguments})) {
+        if ($argument-&gt;isOptional or $argument-&gt;isVariadic) {
+            $numMandatoryArguments--;
</ins><span class="cx">         } else {
</span><span class="cx">             last;
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if ($numMandatoryParams &gt;= 1)
-    {
-        push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;argumentCount() &lt; $numMandatoryParams))\n&quot;);
</del><ins>+    if ($numMandatoryArguments &gt;= 1) {
+        push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;argumentCount() &lt; $numMandatoryArguments))\n&quot;);
</ins><span class="cx">         push(@$outputArray, &quot;        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -4259,9 +4255,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($function) = @_;
</span><span class="cx"> 
</span><del>-    return 0 unless $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowException};
</del><ins>+    return 0 unless $function-&gt;extendedAttributes-&gt;{MayThrowException};
</ins><span class="cx"> 
</span><del>-    return 1 if $function-&gt;signature-&gt;type &amp;&amp; $function-&gt;signature-&gt;type-&gt;name eq &quot;void&quot;;
</del><ins>+    return 1 if $function-&gt;type &amp;&amp; $function-&gt;type-&gt;name eq &quot;void&quot;;
</ins><span class="cx">     return 1 if IsReturningPromise($function);
</span><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="lines">@@ -4275,11 +4271,11 @@
</span><span class="cx">     my $visibleInterfaceName = $codeGenerator-&gt;GetVisibleInterfaceName($interface);
</span><span class="cx">     my @arguments;
</span><span class="cx">     my $functionName;
</span><del>-    my $implementedBy = $function-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedBy};
-    my $numParameters = @{$function-&gt;parameters};
</del><ins>+    my $implementedBy = $function-&gt;extendedAttributes-&gt;{ImplementedBy};
+    my $numArguments = @{$function-&gt;arguments};
</ins><span class="cx"> 
</span><span class="cx">     if ($implementedBy) {
</span><del>-        AddToImplIncludes(&quot;${implementedBy}.h&quot;, $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</del><ins>+        AddToImplIncludes(&quot;${implementedBy}.h&quot;, $function-&gt;extendedAttributes-&gt;{Conditional});
</ins><span class="cx">         unshift(@arguments, &quot;impl&quot;) if !$function-&gt;isStatic;
</span><span class="cx">         $functionName = &quot;WebCore::${implementedBy}::${functionImplementationName}&quot;;
</span><span class="cx">     } elsif ($function-&gt;isStatic) {
</span><span class="lines">@@ -4291,10 +4287,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     my $quotedFunctionName;
</span><del>-    if (!$function-&gt;signature-&gt;extendedAttributes-&gt;{Constructor}) {
-        my $name = $function-&gt;signature-&gt;name;
</del><ins>+    if (!$function-&gt;extendedAttributes-&gt;{Constructor}) {
+        my $name = $function-&gt;name;
</ins><span class="cx">         $quotedFunctionName = &quot;\&quot;$name\&quot;&quot;;
</span><del>-        push(@arguments, GenerateCallWithUsingPointers($function-&gt;signature-&gt;extendedAttributes-&gt;{CallWith}, \@$outputArray, &quot;JSValue::encode(jsUndefined())&quot;, $function));
</del><ins>+        push(@arguments, GenerateCallWithUsingPointers($function-&gt;extendedAttributes-&gt;{CallWith}, \@$outputArray, &quot;JSValue::encode(jsUndefined())&quot;, $function));
</ins><span class="cx">     } else {
</span><span class="cx">         $quotedFunctionName = &quot;nullptr&quot;;
</span><span class="cx">     }
</span><span class="lines">@@ -4303,31 +4299,31 @@
</span><span class="cx">     $implIncludes{&quot;JSDOMBinding.h&quot;} = 1;
</span><span class="cx"> 
</span><span class="cx">     my $argumentIndex = 0;
</span><del>-    foreach my $parameter (@{$function-&gt;parameters}) {
-        my $type = $parameter-&gt;type;
</del><ins>+    foreach my $argument (@{$function-&gt;arguments}) {
+        my $type = $argument-&gt;type;
</ins><span class="cx"> 
</span><del>-        die &quot;Optional parameters of non-nullable wrapper types are not supported&quot; if $parameter-&gt;isOptional &amp;&amp; !$type-&gt;isNullable &amp;&amp; $codeGenerator-&gt;IsWrapperType($type);
-        die &quot;Optional parameters preceding variadic parameters are not supported&quot; if ($parameter-&gt;isOptional &amp;&amp;  @{$function-&gt;parameters}[$numParameters - 1]-&gt;isVariadic);
</del><ins>+        die &quot;Optional arguments of non-nullable wrapper types are not supported&quot; if $argument-&gt;isOptional &amp;&amp; !$type-&gt;isNullable &amp;&amp; $codeGenerator-&gt;IsWrapperType($type);
+        die &quot;Optional arguments preceding variadic arguments are not supported&quot; if ($argument-&gt;isOptional &amp;&amp;  @{$function-&gt;arguments}[$numArguments - 1]-&gt;isVariadic);
</ins><span class="cx"> 
</span><del>-        if ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
-            # As per Web IDL, optional dictionary parameters are always considered to have a default value of an empty dictionary, unless otherwise specified.
-            $parameter-&gt;default(&quot;[]&quot;) if $type-&gt;name eq &quot;Dictionary&quot; or $codeGenerator-&gt;IsDictionaryType($type);
</del><ins>+        if ($argument-&gt;isOptional &amp;&amp; !defined($argument-&gt;default)) {
+            # As per Web IDL, optional dictionary arguments are always considered to have a default value of an empty dictionary, unless otherwise specified.
+            $argument-&gt;default(&quot;[]&quot;) if $type-&gt;name eq &quot;Dictionary&quot; or $codeGenerator-&gt;IsDictionaryType($type);
</ins><span class="cx"> 
</span><del>-            # We use undefined as default value for optional parameters of type 'any' unless specified otherwise.
-            $parameter-&gt;default(&quot;undefined&quot;) if $type-&gt;name eq &quot;any&quot;;
</del><ins>+            # We use undefined as default value for optional arguments of type 'any' unless specified otherwise.
+            $argument-&gt;default(&quot;undefined&quot;) if $type-&gt;name eq &quot;any&quot;;
</ins><span class="cx"> 
</span><del>-            # We use the null string as default value for parameters of type DOMString unless specified otherwise.
-            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsStringType($type);
</del><ins>+            # We use the null string as default value for arguments of type DOMString unless specified otherwise.
+            $argument-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsStringType($type);
</ins><span class="cx"> 
</span><del>-            # As per Web IDL, passing undefined for a nullable parameter is treated as null. Therefore, use null as
-            # default value for nullable parameters unless otherwise specified.
-            $parameter-&gt;default(&quot;null&quot;) if $type-&gt;isNullable;
</del><ins>+            # As per Web IDL, passing undefined for a nullable argument is treated as null. Therefore, use null as
+            # default value for nullable arguments unless otherwise specified.
+            $argument-&gt;default(&quot;null&quot;) if $type-&gt;isNullable;
</ins><span class="cx"> 
</span><del>-            # For callback parameters, the generated bindings treat undefined as null, so use null as implicit default value.
-            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($type);
</del><ins>+            # For callback arguments, the generated bindings treat undefined as null, so use null as implicit default value.
+            $argument-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($type);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        my $name = $parameter-&gt;name;
</del><ins>+        my $name = $argument-&gt;name;
</ins><span class="cx">         my $value = $name;
</span><span class="cx"> 
</span><span class="cx">         if ($codeGenerator-&gt;IsCallbackInterface($type)) {
</span><span class="lines">@@ -4334,7 +4330,7 @@
</span><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><del>-            if ($parameter-&gt;isOptional) {
</del><ins>+            if ($argument-&gt;isOptional) {
</ins><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><span class="cx">                 if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
</span><span class="lines">@@ -4351,7 +4347,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;);
</span><span class="cx">             } else {
</span><del>-                die &quot;CallbackInterface does not support Variadic parameter&quot; if $parameter-&gt;isVariadic;
</del><ins>+                die &quot;CallbackInterface does not support Variadic arguments&quot; if $argument-&gt;isVariadic;
</ins><span class="cx">                 if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
</span><span class="cx">                     push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;uncheckedArgument($argumentIndex).isFunction()))\n&quot;);
</span><span class="cx">                 } else {
</span><span class="lines">@@ -4366,9 +4362,9 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             $value = &quot;WTFMove($name)&quot;;
</span><del>-        } elsif ($parameter-&gt;isVariadic) {
</del><ins>+        } elsif ($argument-&gt;isVariadic) {
</ins><span class="cx">             $implIncludes{&quot;JSDOMConvert.h&quot;} = 1;
</span><del>-            AddToImplIncludesForIDLType($type, $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</del><ins>+            AddToImplIncludesForIDLType($type, $function-&gt;extendedAttributes-&gt;{Conditional});
</ins><span class="cx">         
</span><span class="cx">             my $metaType = GetIDLType($interface, $type);
</span><span class="cx">             push(@$outputArray, &quot;    auto $name = convertVariadicArguments&lt;$metaType&gt;(*state, $argumentIndex);\n&quot;);
</span><span class="lines">@@ -4386,10 +4382,10 @@
</span><span class="cx">             my $defineOptionalValue = &quot;auto optionalValue&quot;;
</span><span class="cx">             my $indent = &quot;&quot;;
</span><span class="cx"> 
</span><del>-            die &quot;Variadic parameter is already handled here&quot; if $parameter-&gt;isVariadic;
-            my $argumentLookupMethod = $parameter-&gt;isOptional ? &quot;argument&quot; : &quot;uncheckedArgument&quot;;
</del><ins>+            die &quot;Variadic argument is already handled here&quot; if $argument-&gt;isVariadic;
+            my $argumentLookupMethod = $argument-&gt;isOptional ? &quot;argument&quot; : &quot;uncheckedArgument&quot;;
</ins><span class="cx"> 
</span><del>-            if ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
</del><ins>+            if ($argument-&gt;isOptional &amp;&amp; !defined($argument-&gt;default)) {
</ins><span class="cx">                 $nativeType = &quot;Optional&lt;$className&gt;&quot;;
</span><span class="cx">                 $optionalValue = $name;
</span><span class="cx">                 $defineOptionalValue = $name;
</span><span class="lines">@@ -4398,12 +4394,12 @@
</span><span class="cx">             push(@$outputArray, &quot;    auto ${name}Value = state-&gt;$argumentLookupMethod($argumentIndex);\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;    $nativeType $name;\n&quot;);
</span><span class="cx"> 
</span><del>-            if ($parameter-&gt;isOptional) {
-                if (!defined $parameter-&gt;default) {
</del><ins>+            if ($argument-&gt;isOptional) {
+                if (!defined $argument-&gt;default) {
</ins><span class="cx">                     push(@$outputArray, &quot;    if (!${name}Value.isUndefined()) {\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@$outputArray, &quot;    if (${name}Value.isUndefined())\n&quot;);
</span><del>-                    push(@$outputArray, &quot;        $name = &quot; . GenerateDefaultValue($interface, $parameter) . &quot;;\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;        $name = &quot; . GenerateDefaultValue($interface, $argument-&gt;type, $argument-&gt;default) . &quot;;\n&quot;);
</ins><span class="cx">                     push(@$outputArray, &quot;    else {\n&quot;);
</span><span class="cx">                 }
</span><span class="cx">                 $indent = &quot;    &quot;;
</span><span class="lines">@@ -4420,18 +4416,18 @@
</span><span class="cx">         } else {
</span><span class="cx">             my $outer;
</span><span class="cx">             my $inner;
</span><del>-            my $nativeType = GetNativeTypeFromSignature($interface, $parameter);
</del><ins>+            my $nativeType = GetNativeType($interface, $argument-&gt;type);
</ins><span class="cx">             my $isTearOff = $codeGenerator-&gt;IsSVGTypeNeedingTearOff($type) &amp;&amp; $interfaceName !~ /List$/;
</span><del>-            my $shouldPassByReference = $isTearOff || ShouldPassWrapperByReference($parameter, $interface);
</del><ins>+            my $shouldPassByReference = $isTearOff || ShouldPassWrapperByReference($argument, $interface);
</ins><span class="cx"> 
</span><del>-            die &quot;Variadic parameter is already handled here&quot; if $parameter-&gt;isVariadic;
-            my $argumentLookupMethod = $parameter-&gt;isOptional ? &quot;argument&quot; : &quot;uncheckedArgument&quot;;
</del><ins>+            die &quot;Variadic argument is already handled here&quot; if $argument-&gt;isVariadic;
+            my $argumentLookupMethod = $argument-&gt;isOptional ? &quot;argument&quot; : &quot;uncheckedArgument&quot;;
</ins><span class="cx"> 
</span><span class="cx">             if (!$shouldPassByReference &amp;&amp; ($codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsTypedArrayType($type))) {
</span><span class="cx">                 $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx">                 my $checkedArgument = &quot;state-&gt;$argumentLookupMethod($argumentIndex)&quot;;
</span><span class="cx">                 my $uncheckedArgument = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
</span><del>-                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $uncheckedArgument, $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</del><ins>+                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, $uncheckedArgument, $function-&gt;extendedAttributes-&gt;{Conditional});
</ins><span class="cx">                 push(@$outputArray, &quot;    $nativeType $name = nullptr;\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;    if (!$checkedArgument.isUndefinedOrNull()) {\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        $name = $nativeValue;\n&quot;);
</span><span class="lines">@@ -4441,12 +4437,12 @@
</span><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;);
</span><span class="cx">                 $value = &quot;WTFMove($name)&quot;;
</span><span class="cx">             } else {
</span><del>-                if ($parameter-&gt;isOptional &amp;&amp; defined($parameter-&gt;default) &amp;&amp; !WillConvertUndefinedToDefaultParameterValue($type, $parameter-&gt;default)) {
-                    my $defaultValue = $parameter-&gt;default;
</del><ins>+                if ($argument-&gt;isOptional &amp;&amp; defined($argument-&gt;default) &amp;&amp; !WillConvertUndefinedToDefaultParameterValue($type, $argument-&gt;default)) {
+                    my $defaultValue = $argument-&gt;default;
</ins><span class="cx"> 
</span><span class="cx">                     # String-related optimizations.
</span><span class="cx">                     if ($codeGenerator-&gt;IsStringType($type)) {
</span><del>-                        my $useAtomicString = $parameter-&gt;extendedAttributes-&gt;{AtomicString};
</del><ins>+                        my $useAtomicString = $argument-&gt;extendedAttributes-&gt;{AtomicString};
</ins><span class="cx">                         if ($defaultValue eq &quot;null&quot;) {
</span><span class="cx">                             $defaultValue = $useAtomicString ? &quot;nullAtom&quot; : &quot;String()&quot;;
</span><span class="cx">                         } elsif ($defaultValue eq &quot;\&quot;\&quot;&quot;) {
</span><span class="lines">@@ -4455,13 +4451,13 @@
</span><span class="cx">                             $defaultValue = $useAtomicString ? &quot;AtomicString($defaultValue, AtomicString::ConstructFromLiteral)&quot; : &quot;ASCIILiteral($defaultValue)&quot;;
</span><span class="cx">                         }
</span><span class="cx">                     } else {
</span><del>-                        $defaultValue = GenerateDefaultValue($interface, $parameter);
</del><ins>+                        $defaultValue = GenerateDefaultValue($interface, $argument-&gt;type, $argument-&gt;default);
</ins><span class="cx">                     }
</span><span class="cx"> 
</span><span class="cx">                     $outer = &quot;state-&gt;$argumentLookupMethod($argumentIndex).isUndefined() ? $defaultValue : &quot;;
</span><span class="cx">                     $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
</span><del>-                } elsif ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
-                    # Use WTF::Optional&lt;&gt;() for optional parameters that are missing or undefined and that do not have a default value in the IDL.
</del><ins>+                } elsif ($argument-&gt;isOptional &amp;&amp; !defined($argument-&gt;default)) {
+                    # Use WTF::Optional&lt;&gt;() for optional arguments that are missing or undefined and that do not have a default value in the IDL.
</ins><span class="cx">                     $outer = &quot;state-&gt;$argumentLookupMethod($argumentIndex).isUndefined() ? Optional&lt;$nativeType&gt;() : &quot;;
</span><span class="cx">                     $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
</span><span class="cx">                 } else {
</span><span class="lines">@@ -4469,7 +4465,7 @@
</span><span class="cx">                     $inner = &quot;state-&gt;$argumentLookupMethod($argumentIndex)&quot;;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $inner, $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional});
</del><ins>+                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, $inner, $function-&gt;extendedAttributes-&gt;{Conditional});
</ins><span class="cx">                 push(@$outputArray, &quot;    auto $name = ${outer}${nativeValue};\n&quot;);
</span><span class="cx">                 $value = &quot;WTFMove($name)&quot;;
</span><span class="cx">                 push(@$outputArray, &quot;    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n&quot;) if $mayThrowException;
</span><span class="lines">@@ -4493,7 +4489,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     push(@arguments, &quot;WTFMove(promise)&quot;) if IsReturningPromise($function);
</span><del>-    push(@arguments, &quot;ec&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</del><ins>+    push(@arguments, &quot;ec&quot;) if $function-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</ins><span class="cx"> 
</span><span class="cx">     my $functionString = &quot;$functionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;;
</span><span class="cx">     $functionString = &quot;propagateException(*state, throwScope, $functionString)&quot; if NeedsExplicitPropagateExceptionCall($function);
</span><span class="lines">@@ -4592,10 +4588,10 @@
</span><span class="cx">         push(@headerContent, &quot;\n    // Functions\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             my @arguments = ();
</span><del>-            foreach my $parameter (@{$function-&gt;parameters}) {
-                push(@arguments, GetNativeTypeForCallbacks($interface, $parameter-&gt;type) . &quot; &quot; . $parameter-&gt;name);
</del><ins>+            foreach my $argument (@{$function-&gt;arguments}) {
+                push(@arguments, GetNativeTypeForCallbacks($interface, $argument-&gt;type) . &quot; &quot; . $argument-&gt;name);
</ins><span class="cx">             }
</span><del>-            push(@headerContent, &quot;    virtual &quot; . GetNativeTypeForCallbacks($interface, $function-&gt;signature-&gt;type) . &quot; &quot; . $function-&gt;signature-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @arguments) . &quot;);\n&quot;);
</del><ins>+            push(@headerContent, &quot;    virtual &quot; . GetNativeTypeForCallbacks($interface, $function-&gt;type) . &quot; &quot; . $function-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @arguments) . &quot;);\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -4724,14 +4720,14 @@
</span><span class="cx">     if ($numFunctions &gt; 0) {
</span><span class="cx">         push(@implContent, &quot;\n// Functions\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><del>-            my @params = @{$function-&gt;parameters};
-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{Custom} || GetNativeType($interface, $function-&gt;signature-&gt;type) ne &quot;bool&quot;) {
</del><ins>+            my @params = @{$function-&gt;arguments};
+            if ($function-&gt;extendedAttributes-&gt;{Custom} || GetNativeType($interface, $function-&gt;type) ne &quot;bool&quot;) {
</ins><span class="cx">                 next;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            AddToImplIncludesForIDLType($function-&gt;signature-&gt;type);
-            my $functionName = $function-&gt;signature-&gt;name;
-            push(@implContent, &quot;\n&quot; . GetNativeTypeForCallbacks($interface, $function-&gt;signature-&gt;type) . &quot; ${className}::${functionName}(&quot;);
</del><ins>+            AddToImplIncludesForIDLType($function-&gt;type);
+            my $functionName = $function-&gt;name;
+            push(@implContent, &quot;\n&quot; . GetNativeTypeForCallbacks($interface, $function-&gt;type) . &quot; ${className}::${functionName}(&quot;);
</ins><span class="cx"> 
</span><span class="cx">             my @args = ();
</span><span class="cx">             my @argsCheck = ();
</span><span class="lines">@@ -4803,10 +4799,10 @@
</span><span class="cx"> {
</span><span class="cx">     my ($function, $functionString, $indent, $svgPropertyType, $interface) = @_;
</span><span class="cx"> 
</span><del>-    my $nondeterministic = $function-&gt;signature-&gt;extendedAttributes-&gt;{Nondeterministic};
-    my $mayThrowLegacyException = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</del><ins>+    my $nondeterministic = $function-&gt;extendedAttributes-&gt;{Nondeterministic};
+    my $mayThrowLegacyException = $function-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</ins><span class="cx"> 
</span><del>-    if ($function-&gt;signature-&gt;type-&gt;name eq &quot;void&quot; || IsReturningPromise($function)) {
</del><ins>+    if ($function-&gt;type-&gt;name eq &quot;void&quot; || IsReturningPromise($function)) {
</ins><span class="cx">         if ($nondeterministic) {
</span><span class="cx">             AddToImplIncludes(&quot;&lt;replay/InputCursor.h&gt;&quot;, &quot;WEB_REPLAY&quot;);
</span><span class="cx">             push(@implContent, &quot;#if ENABLE(WEB_REPLAY)\n&quot;);
</span><span class="lines">@@ -4841,9 +4837,9 @@
</span><span class="cx">             AddToImplIncludes(&quot;&lt;replay/InputCursor.h&gt;&quot;, &quot;WEB_REPLAY&quot;);
</span><span class="cx">             AddToImplIncludes(&quot;&lt;wtf/NeverDestroyed.h&gt;&quot;, &quot;WEB_REPLAY&quot;);
</span><span class="cx"> 
</span><del>-            my $nativeType = GetNativeTypeFromSignature($interface, $function-&gt;signature);
-            my $memoizedType = GetNativeTypeForMemoization($interface, $function-&gt;signature-&gt;type);
-            my $bindingName = $interface-&gt;type-&gt;name . &quot;.&quot; . $function-&gt;signature-&gt;name;
</del><ins>+            my $nativeType = GetNativeType($interface, $function-&gt;type);
+            my $memoizedType = GetNativeTypeForMemoization($interface, $function-&gt;type);
+            my $bindingName = $interface-&gt;type-&gt;name . &quot;.&quot; . $function-&gt;name;
</ins><span class="cx">             push(@implContent, $indent . &quot;JSValue result;\n&quot;);
</span><span class="cx">             push(@implContent, &quot;#if ENABLE(WEB_REPLAY)\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;InputCursor&amp; cursor = state-&gt;lexicalGlobalObject()-&gt;inputCursor();\n&quot;);
</span><span class="lines">@@ -4852,28 +4848,28 @@
</span><span class="cx">             push(@implContent, $indent . &quot;    $nativeType memoizedResult = $functionString;\n&quot;);
</span><span class="cx">             my $exceptionCode = $mayThrowLegacyException ? &quot;ec&quot; : &quot;0&quot;;
</span><span class="cx">             push(@implContent, $indent . &quot;    cursor.appendInput&lt;MemoizedDOMResult&lt;$memoizedType&gt;&gt;(bindingName.get().string(), memoizedResult, $exceptionCode);\n&quot;);
</span><del>-            push(@implContent, $indent . &quot;    result = &quot; . NativeToJSValueUsingPointers($function-&gt;signature, 1, $interface, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
</del><ins>+            push(@implContent, $indent . &quot;    result = &quot; . NativeToJSValueUsingPointers($function, 1, $interface, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
</ins><span class="cx">             push(@implContent, $indent . &quot;} else if (cursor.isReplaying()) {\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;    MemoizedDOMResultBase* input = cursor.fetchInput&lt;MemoizedDOMResultBase&gt;();\n&quot;);
</span><span class="cx">             push(@implContent, $indent . &quot;    $memoizedType memoizedResult;\n&quot;);
</span><span class="cx">             # FIXME: the generated code should report an error if an input cannot be fetched or converted.
</span><span class="cx">             push(@implContent, $indent . &quot;    if (input &amp;&amp; input-&gt;convertTo&lt;$memoizedType&gt;(memoizedResult)) {\n&quot;);
</span><del>-            push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValueUsingPointers($function-&gt;signature, 1, $interface, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
</del><ins>+            push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValueUsingPointers($function, 1, $interface, &quot;memoizedResult&quot;, $thisObject) . &quot;;\n&quot;);
</ins><span class="cx">             push(@implContent, $indent . &quot;        ec = input-&gt;exceptionCode();\n&quot;) if $mayThrowLegacyException;
</span><span class="cx">             push(@implContent, $indent . &quot;    } else\n&quot;);
</span><del>-            push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValueUsingPointers($function-&gt;signature, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</del><ins>+            push(@implContent, $indent . &quot;        result = &quot; . NativeToJSValueUsingPointers($function, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</ins><span class="cx">             push(@implContent, $indent . &quot;} else\n&quot;);
</span><del>-            push(@implContent, $indent . &quot;    result = &quot; . NativeToJSValueUsingPointers($function-&gt;signature, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</del><ins>+            push(@implContent, $indent . &quot;    result = &quot; . NativeToJSValueUsingPointers($function, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;#else\n&quot;);
</span><del>-            push(@implContent, $indent . &quot;result = &quot; . NativeToJSValueUsingPointers($function-&gt;signature, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</del><ins>+            push(@implContent, $indent . &quot;result = &quot; . NativeToJSValueUsingPointers($function, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;#endif\n&quot;);
</span><span class="cx">         } else {
</span><del>-            push(@implContent, $indent . &quot;JSValue result = &quot; . NativeToJSValueUsingPointers($function-&gt;signature, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</del><ins>+            push(@implContent, $indent . &quot;JSValue result = &quot; . NativeToJSValueUsingPointers($function, 1, $interface, $functionString, $thisObject) . &quot;;\n&quot;);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         push(@implContent, &quot;\n&quot; . $indent . &quot;setDOMException(state, throwScope, ec);\n&quot;) if $mayThrowLegacyException;
</span><span class="cx"> 
</span><del>-        if ($codeGenerator-&gt;ExtendedAttributeContains($function-&gt;signature-&gt;extendedAttributes-&gt;{CallWith}, &quot;ScriptState&quot;)) {
</del><ins>+        if ($codeGenerator-&gt;ExtendedAttributeContains($function-&gt;extendedAttributes-&gt;{CallWith}, &quot;ScriptState&quot;)) {
</ins><span class="cx">             push(@implContent, $indent . &quot;RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n&quot;);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -4938,7 +4934,7 @@
</span><span class="cx"> END
</span><span class="cx"> 
</span><span class="cx">     foreach my $function (@{$interface-&gt;iterable-&gt;functions}) {
</span><del>-        my $propertyName = $function-&gt;signature-&gt;name;
</del><ins>+        my $propertyName = $function-&gt;name;
</ins><span class="cx">         my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="cx"> 
</span><span class="cx">         if ($propertyName eq &quot;forEach&quot;) {
</span><span class="lines">@@ -4993,13 +4989,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GetNativeTypeFromSignature
-{
-    my ($interface, $signature) = @_;
-
-    return GetNativeType($interface, $signature-&gt;type);
-}
-
</del><span class="cx"> my %nativeType = (
</span><span class="cx">     &quot;DOMString&quot; =&gt; &quot;String&quot;,
</span><span class="cx">     &quot;USVString&quot; =&gt; &quot;String&quot;,
</span><span class="lines">@@ -5135,7 +5124,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;IDLType&quot;;
</ins><span class="cx"> 
</span><span class="cx">     my $typeName = $type-&gt;name;
</span><span class="cx"> 
</span><span class="lines">@@ -5157,7 +5146,7 @@
</span><span class="cx">     my ($parameter, $interface) = @_;
</span><span class="cx"> 
</span><span class="cx">     my $nativeType = GetNativeType($interface, $parameter-&gt;type);
</span><del>-    return $codeGenerator-&gt;ShouldPassWrapperByReference($parameter, $interface) &amp;&amp; (substr($nativeType, -1) eq '*' || $nativeType =~ /^RefPtr/);
</del><ins>+    return $codeGenerator-&gt;ShouldPassWrapperByReference($parameter) &amp;&amp; (substr($nativeType, -1) eq '*' || $nativeType =~ /^RefPtr/);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetNativeVectorInnerType
</span><span class="lines">@@ -5234,26 +5223,26 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetIntegerConversionConfiguration
</span><span class="cx"> {
</span><del>-    my $signature = shift;
</del><ins>+    my $context = shift;
</ins><span class="cx"> 
</span><del>-    return &quot;IntegerConversionConfiguration::EnforceRange&quot; if $signature-&gt;extendedAttributes-&gt;{EnforceRange};
-    return &quot;IntegerConversionConfiguration::Clamp&quot; if $signature-&gt;extendedAttributes-&gt;{Clamp};
</del><ins>+    return &quot;IntegerConversionConfiguration::EnforceRange&quot; if $context-&gt;extendedAttributes-&gt;{EnforceRange};
+    return &quot;IntegerConversionConfiguration::Clamp&quot; if $context-&gt;extendedAttributes-&gt;{Clamp};
</ins><span class="cx">     return &quot;IntegerConversionConfiguration::Normal&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetStringConversionConfiguration
</span><span class="cx"> {
</span><del>-    my $signature = shift;
</del><ins>+    my $context = shift;
</ins><span class="cx"> 
</span><del>-    return &quot;StringConversionConfiguration::TreatNullAsEmptyString&quot; if $signature-&gt;extendedAttributes-&gt;{TreatNullAs} &amp;&amp; $signature-&gt;extendedAttributes-&gt;{TreatNullAs} eq &quot;EmptyString&quot;;
</del><ins>+    return &quot;StringConversionConfiguration::TreatNullAsEmptyString&quot; if $context-&gt;extendedAttributes-&gt;{TreatNullAs} &amp;&amp; $context-&gt;extendedAttributes-&gt;{TreatNullAs} eq &quot;EmptyString&quot;;
</ins><span class="cx">     return &quot;StringConversionConfiguration::Normal&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub JSValueToNativeIsHandledByDOMConvert
</span><span class="cx"> {
</span><del>-    my ($type, $signature) = @_;
</del><ins>+    my ($type, $context) = @_;
</ins><span class="cx"> 
</span><del>-    return 0 if $type-&gt;name eq &quot;DOMString&quot; &amp;&amp; ($signature-&gt;extendedAttributes-&gt;{RequiresExistingAtomicString} || $signature-&gt;extendedAttributes-&gt;{AtomicString});
</del><ins>+    return 0 if $type-&gt;name eq &quot;DOMString&quot; &amp;&amp; ($context-&gt;extendedAttributes-&gt;{RequiresExistingAtomicString} || $context-&gt;extendedAttributes-&gt;{AtomicString});
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $type-&gt;isUnion;
</span><span class="cx">     return 1 if $type-&gt;name eq &quot;any&quot;;
</span><span class="lines">@@ -5268,20 +5257,29 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsValidContextForJSValueToNative
+{
+    my $context = shift;
+    
+    return ref($context) eq &quot;IDLAttribute&quot; || ref($context) eq &quot;IDLOperation&quot; || ref($context) eq &quot;IDLArgument&quot;;
+}
+
</ins><span class="cx"> # Returns (convertString, mayThrowException).
</span><span class="cx"> 
</span><span class="cx"> sub JSValueToNative
</span><span class="cx"> {
</span><del>-    my ($interface, $signature, $value, $conditional, $statePointer, $stateReference, $thisObjectReference) = @_;
</del><ins>+    my ($interface, $context, $value, $conditional, $statePointer, $stateReference, $thisObjectReference) = @_;
</ins><span class="cx"> 
</span><del>-    my $type = $signature-&gt;type;
</del><ins>+    assert(&quot;Invalid context type&quot;) if !IsValidContextForJSValueToNative($context);
</ins><span class="cx"> 
</span><ins>+    my $type = $context-&gt;type;
+
</ins><span class="cx">     # FIXME: Remove these 3 variables when all JSValueToNative use references.
</span><span class="cx">     $statePointer = &quot;state&quot; unless $statePointer;
</span><span class="cx">     $stateReference = &quot;*state&quot; unless $stateReference;
</span><span class="cx">     $thisObjectReference = &quot;*castedThis&quot; unless $thisObjectReference;
</span><span class="cx"> 
</span><del>-    if (JSValueToNativeIsHandledByDOMConvert($type, $signature)) {
</del><ins>+    if (JSValueToNativeIsHandledByDOMConvert($type, $context)) {
</ins><span class="cx">         AddToImplIncludes(&quot;JSDOMConvert.h&quot;);
</span><span class="cx">         AddToImplIncludesForIDLType($type, $conditional);
</span><span class="cx"> 
</span><span class="lines">@@ -5290,15 +5288,15 @@
</span><span class="cx">         my @conversionArguments = ();
</span><span class="cx">         push(@conversionArguments, &quot;$stateReference&quot;);
</span><span class="cx">         push(@conversionArguments, &quot;$value&quot;);
</span><del>-        push(@conversionArguments, GetIntegerConversionConfiguration($signature)) if $codeGenerator-&gt;IsIntegerType($type);
-        push(@conversionArguments, GetStringConversionConfiguration($signature)) if $codeGenerator-&gt;IsStringType($type);
</del><ins>+        push(@conversionArguments, GetIntegerConversionConfiguration($context)) if $codeGenerator-&gt;IsIntegerType($type);
+        push(@conversionArguments, GetStringConversionConfiguration($context)) if $codeGenerator-&gt;IsStringType($type);
</ins><span class="cx"> 
</span><span class="cx">         return (&quot;convert&lt;$IDLType&gt;(&quot; . join(&quot;, &quot;, @conversionArguments) . &quot;)&quot;, 1);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($type-&gt;name eq &quot;DOMString&quot;) {
</span><del>-        return (&quot;AtomicString($value.toString($statePointer)-&gt;toExistingAtomicString($statePointer))&quot;, 1) if $signature-&gt;extendedAttributes-&gt;{RequiresExistingAtomicString};
-        return (&quot;$value.toString($statePointer)-&gt;toAtomicString($statePointer)&quot;, 1) if $signature-&gt;extendedAttributes-&gt;{AtomicString};
</del><ins>+        return (&quot;AtomicString($value.toString($statePointer)-&gt;toExistingAtomicString($statePointer))&quot;, 1) if $context-&gt;extendedAttributes-&gt;{RequiresExistingAtomicString};
+        return (&quot;$value.toString($statePointer)-&gt;toAtomicString($statePointer)&quot;, 1) if $context-&gt;extendedAttributes-&gt;{AtomicString};
</ins><span class="cx">         assert(&quot;Unhandled string conversion.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -5369,44 +5367,53 @@
</span><span class="cx"> 
</span><span class="cx"> sub NativeToJSValueUsingReferences
</span><span class="cx"> {
</span><del>-    my ($signature, $inFunctionCall, $interface, $value, $thisValue) = @_;
</del><ins>+    my ($context, $inFunctionCall, $interface, $value, $thisValue) = @_;
</ins><span class="cx">     my $statePointer = &quot;&amp;state&quot;;
</span><span class="cx">     my $stateReference = &quot;state&quot;;
</span><span class="cx">     my $wrapped = &quot;$thisValue.wrapped()&quot;;
</span><span class="cx">     my $globalObject = $thisValue ? &quot;$thisValue.globalObject()&quot; : &quot;jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject())&quot;;
</span><span class="cx"> 
</span><del>-    return NativeToJSValue($signature, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject);
</del><ins>+    return NativeToJSValue($context, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # FIXME: We should remove NativeToJSValueUsingPointers and combine NativeToJSValueUsingReferences and NativeToJSValue
</span><span class="cx"> sub NativeToJSValueUsingPointers
</span><span class="cx"> {
</span><del>-    my ($signature, $inFunctionCall, $interface, $value, $thisValue) = @_;
</del><ins>+    my ($context, $inFunctionCall, $interface, $value, $thisValue) = @_;
</ins><span class="cx">     my $statePointer = &quot;state&quot;;
</span><span class="cx">     my $stateReference = &quot;*state&quot;;
</span><span class="cx">     my $wrapped = &quot;$thisValue-&gt;wrapped()&quot;;
</span><span class="cx">     my $globalObject = $thisValue ? &quot;$thisValue-&gt;globalObject()&quot; : &quot;jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())&quot;;
</span><span class="cx"> 
</span><del>-    return NativeToJSValue($signature, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject);
</del><ins>+    return NativeToJSValue($context, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsValidContextForNativeToJSValue
+{
+    my $context = shift;
+    
+    return ref($context) eq &quot;IDLAttribute&quot; || ref($context) eq &quot;IDLOperation&quot; || ref($context) eq &quot;IDLArgument&quot;;
+}
+
</ins><span class="cx"> sub NativeToJSValue
</span><span class="cx"> {
</span><del>-    my ($signature, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject) = @_;
</del><ins>+    my ($context, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject) = @_;
</ins><span class="cx"> 
</span><del>-    my $conditional = $signature-&gt;extendedAttributes-&gt;{Conditional};
-    my $type = $signature-&gt;type;
-    my $mayThrowException = $signature-&gt;extendedAttributes-&gt;{GetterMayThrowException} || $signature-&gt;extendedAttributes-&gt;{MayThrowException};
</del><ins>+    assert(&quot;Invalid context type&quot;) if !IsValidContextForNativeToJSValue($context);
</ins><span class="cx"> 
</span><ins>+    my $conditional = $context-&gt;extendedAttributes-&gt;{Conditional};
+    my $type = $context-&gt;type;
+    my $mayThrowException = $context-&gt;extendedAttributes-&gt;{GetterMayThrowException} || $context-&gt;extendedAttributes-&gt;{MayThrowException};
+
</ins><span class="cx">     # We could instead overload a function to work with optional as well as non-optional numbers, but this
</span><span class="cx">     # is slightly better because it guarantees we will fail to compile if the IDL file doesn't match the C++.
</span><del>-    if ($signature-&gt;extendedAttributes-&gt;{Reflect} and ($type-&gt;name eq &quot;unsigned long&quot; or $type-&gt;name eq &quot;unsigned short&quot;)) {
</del><ins>+    if ($context-&gt;extendedAttributes-&gt;{Reflect} and ($type-&gt;name eq &quot;unsigned long&quot; or $type-&gt;name eq &quot;unsigned short&quot;)) {
</ins><span class="cx">         $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
</span><span class="cx">         $value = &quot;std::max(0, $value)&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($type-&gt;name eq &quot;any&quot;) {
</span><del>-        my $returnType = $signature-&gt;extendedAttributes-&gt;{ImplementationReturnType};
</del><ins>+        my $returnType = $context-&gt;extendedAttributes-&gt;{ImplementationReturnType};
</ins><span class="cx">         if (defined $returnType and ($returnType eq &quot;IDBKeyPath&quot; or $returnType eq &quot;IDBKey&quot;)) {
</span><span class="cx">             AddToImplIncludes(&quot;IDBBindingUtilities.h&quot;, $conditional);
</span><span class="cx">             return &quot;toJS($stateReference, *$globalObject, $value)&quot;;
</span><span class="lines">@@ -5445,7 +5452,7 @@
</span><span class="cx">         $value = &quot;static_cast&lt;&quot; . GetNativeType($interface, $type) . &quot;&gt;($value)&quot;;
</span><span class="cx">     } elsif ($codeGenerator-&gt;IsSVGTypeNeedingTearOff($type) and not $interface-&gt;type-&gt;name =~ /List$/) {
</span><span class="cx">         my $tearOffType = $codeGenerator-&gt;GetSVGTypeNeedingTearOff($type);
</span><del>-        if ($codeGenerator-&gt;IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and !$inFunctionCall and not defined $signature-&gt;extendedAttributes-&gt;{Immutable}) {
</del><ins>+        if ($codeGenerator-&gt;IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and !$inFunctionCall and not defined $context-&gt;extendedAttributes-&gt;{Immutable}) {
</ins><span class="cx">             my $getter = $value;
</span><span class="cx">             $getter =~ s/impl\.//;
</span><span class="cx">             $getter =~ s/impl-&gt;//;
</span><span class="lines">@@ -5470,10 +5477,10 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    $value = &quot;BindingSecurity::checkSecurityForNode($stateReference, $value)&quot; if $signature-&gt;extendedAttributes-&gt;{CheckSecurityForNode};
</del><ins>+    $value = &quot;BindingSecurity::checkSecurityForNode($stateReference, $value)&quot; if $context-&gt;extendedAttributes-&gt;{CheckSecurityForNode};
</ins><span class="cx"> 
</span><span class="cx">     my $functionName = &quot;toJS&quot;;
</span><del>-    $functionName = &quot;toJSNewlyCreated&quot; if $signature-&gt;extendedAttributes-&gt;{NewObject};
</del><ins>+    $functionName = &quot;toJSNewlyCreated&quot; if $context-&gt;extendedAttributes-&gt;{NewObject};
</ins><span class="cx"> 
</span><span class="cx">     my $arguments = &quot;$statePointer, $globalObject, $value&quot;;
</span><span class="cx">     $arguments = &quot;$stateReference, *$globalObject, throwScope, $value&quot; if $mayThrowException;
</span><span class="lines">@@ -5887,7 +5894,7 @@
</span><span class="cx"> 
</span><span class="cx">             GenerateArgumentsCountCheck($outputArray, $function, $interface);
</span><span class="cx"> 
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException} || $interface-&gt;extendedAttributes-&gt;{ConstructorMayThrowLegacyException}) {
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{MayThrowLegacyException} || $interface-&gt;extendedAttributes-&gt;{ConstructorMayThrowLegacyException}) {
</ins><span class="cx">                 $implIncludes{&quot;ExceptionCode.h&quot;} = 1;
</span><span class="cx">                 push(@$outputArray, &quot;    ExceptionCode ec = 0;\n&quot;);
</span><span class="cx">             }
</span><span class="lines">@@ -5918,12 +5925,12 @@
</span><span class="cx">             push(@constructorArgList, &quot;*castedThis-&gt;document()&quot;) if $generatingNamedConstructor;
</span><span class="cx"> 
</span><span class="cx">             my $index = 0;
</span><del>-            foreach my $parameter (@{$function-&gt;parameters}) {
</del><ins>+            foreach my $argument (@{$function-&gt;arguments}) {
</ins><span class="cx">                 last if $index eq $paramIndex;
</span><del>-                if (ShouldPassWrapperByReference($parameter, $interface)) {
-                    push(@constructorArgList, &quot;*&quot; . $parameter-&gt;name);
</del><ins>+                if (ShouldPassWrapperByReference($argument, $interface)) {
+                    push(@constructorArgList, &quot;*&quot; . $argument-&gt;name);
</ins><span class="cx">                 } else {
</span><del>-                    push(@constructorArgList, &quot;WTFMove(&quot; . $parameter-&gt;name . &quot;)&quot;);
</del><ins>+                    push(@constructorArgList, &quot;WTFMove(&quot; . $argument-&gt;name . &quot;)&quot;);
</ins><span class="cx">                 }
</span><span class="cx">                 $index++;
</span><span class="cx">             }
</span><span class="lines">@@ -6081,7 +6088,7 @@
</span><span class="cx"> sub IsReturningPromise
</span><span class="cx"> {
</span><span class="cx">     my $function = shift;
</span><del>-    return $function-&gt;signature-&gt;type &amp;&amp; $function-&gt;signature-&gt;type-&gt;name eq &quot;Promise&quot;;
</del><ins>+    return $function-&gt;type &amp;&amp; $function-&gt;type-&gt;name eq &quot;Promise&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsConstructable
</span><span class="lines">@@ -6103,7 +6110,7 @@
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><span class="cx">     my $property = shift;
</span><del>-    return $property-&gt;signature-&gt;extendedAttributes-&gt;{Unforgeable} || $interface-&gt;extendedAttributes-&gt;{Unforgeable};
</del><ins>+    return $property-&gt;extendedAttributes-&gt;{Unforgeable} || $interface-&gt;extendedAttributes-&gt;{Unforgeable};
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub ComputeFunctionSpecial
</span><span class="lines">@@ -6113,7 +6120,7 @@
</span><span class="cx"> 
</span><span class="cx">     my @specials = ();
</span><span class="cx">     push(@specials, (&quot;DontDelete&quot;, &quot;ReadOnly&quot;)) if IsUnforgeable($interface, $function);
</span><del>-    push(@specials, &quot;DontEnum&quot;) if $function-&gt;signature-&gt;extendedAttributes-&gt;{NotEnumerable};
</del><ins>+    push(@specials, &quot;DontEnum&quot;) if $function-&gt;extendedAttributes-&gt;{NotEnumerable};
</ins><span class="cx">     if (IsJSBuiltin($interface, $function)) {
</span><span class="cx">         push(@specials, &quot;JSC::Builtin&quot;);
</span><span class="cx">     }
</span><span class="lines">@@ -6127,11 +6134,11 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $object) = @_;
</span><span class="cx"> 
</span><del>-    return 0 if $object-&gt;signature-&gt;extendedAttributes-&gt;{Custom};
-    return 0 if $object-&gt;signature-&gt;extendedAttributes-&gt;{CustomGetter};
-    return 0 if $object-&gt;signature-&gt;extendedAttributes-&gt;{CustomSetter};
</del><ins>+    return 0 if $object-&gt;extendedAttributes-&gt;{Custom};
+    return 0 if $object-&gt;extendedAttributes-&gt;{CustomGetter};
+    return 0 if $object-&gt;extendedAttributes-&gt;{CustomSetter};
</ins><span class="cx"> 
</span><del>-    return 1 if $object-&gt;signature-&gt;extendedAttributes-&gt;{JSBuiltin};
</del><ins>+    return 1 if $object-&gt;extendedAttributes-&gt;{JSBuiltin};
</ins><span class="cx">     return 1 if $interface-&gt;extendedAttributes-&gt;{JSBuiltin};
</span><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="lines">@@ -6150,9 +6157,9 @@
</span><span class="cx"> sub GetJSBuiltinFunctionName
</span><span class="cx"> {
</span><span class="cx">     my ($className, $function) = @_;
</span><del>-    my $scopeName = $function-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedBy};
</del><ins>+    my $scopeName = $function-&gt;extendedAttributes-&gt;{ImplementedBy};
</ins><span class="cx">     $scopeName = substr $className, 2 unless $scopeName;
</span><del>-    return GetJSBuiltinFunctionNameFromString($scopeName, $function-&gt;signature-&gt;name);
</del><ins>+    return GetJSBuiltinFunctionNameFromString($scopeName, $function-&gt;name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetJSBuiltinFunctionNameFromString
</span><span class="lines">@@ -6164,7 +6171,7 @@
</span><span class="cx"> sub GetJSBuiltinScopeName
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $object) = @_;
</span><del>-    return $object-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedBy} || $interface-&gt;type-&gt;name;
</del><ins>+    return $object-&gt;extendedAttributes-&gt;{ImplementedBy} || $interface-&gt;type-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub AddJSBuiltinIncludesIfNeeded()
</span><span class="lines">@@ -6177,11 +6184,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     foreach my $function (@{$interface-&gt;functions}) {
</span><del>-        AddToImplIncludes(GetJSBuiltinScopeName($interface, $function) . &quot;Builtins.h&quot;, $function-&gt;signature-&gt;extendedAttributes-&gt;{Conditional}) if IsJSBuiltin($interface, $function);
</del><ins>+        AddToImplIncludes(GetJSBuiltinScopeName($interface, $function) . &quot;Builtins.h&quot;, $function-&gt;extendedAttributes-&gt;{Conditional}) if IsJSBuiltin($interface, $function);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-        AddToImplIncludes(GetJSBuiltinScopeName($interface, $attribute) . &quot;Builtins.h&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{Conditional}) if IsJSBuiltin($interface, $attribute);
</del><ins>+        AddToImplIncludes(GetJSBuiltinScopeName($interface, $attribute) . &quot;Builtins.h&quot;, $attribute-&gt;extendedAttributes-&gt;{Conditional}) if IsJSBuiltin($interface, $attribute);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -37,14 +37,15 @@
</span><span class="cx"> use constant EmptyToken =&gt; 5;
</span><span class="cx"> 
</span><span class="cx"> # Used to represent a parsed IDL document
</span><del>-struct( idlDocument =&gt; {
-    interfaces =&gt; '@', # List of 'domInterface'
-    enumerations =&gt; '@', # List of 'domEnum'
-    dictionaries =&gt; '@', # List of 'domDictionary'
</del><ins>+struct( IDLDocument =&gt; {
+    interfaces =&gt; '@', # List of 'IDLInterface'
+    enumerations =&gt; '@', # List of 'IDLEnum'
+    dictionaries =&gt; '@', # List of 'IDLDictionary'
</ins><span class="cx">     fileName =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-struct( domType =&gt; {
</del><ins>+# https://heycam.github.io/webidl/#idl-types
+struct( IDLType =&gt; {
</ins><span class="cx">     name =&gt;         '$', # Type identifier
</span><span class="cx">     isNullable =&gt;   '$', # Is the type Nullable (T?)
</span><span class="cx">     isUnion =&gt;      '$', # Is the type a union (T or U)
</span><span class="lines">@@ -51,62 +52,66 @@
</span><span class="cx">     subtypes =&gt;     '@', # Array of subtypes, only valid if isUnion or sequence
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-# Used to represent a map of 'variable name' &lt;-&gt; 'variable type'
-struct( domSignature =&gt; {
-    direction =&gt; '$',   # Variable direction (in or out)
-    name =&gt; '$',        # Variable name
-    type =&gt; 'domType',  # Variable type
-    specials =&gt; '@',    # Specials
-    extendedAttributes =&gt; '$', # Extended attributes
-    isVariadic =&gt; '$',  # Is variable variadic (long... numbers)
-    isOptional =&gt; '$',  # Is variable optional (optional T)
-    default =&gt; '$',     # Default value for parameters
-});
-
</del><span class="cx"> # Used to represent 'interface' blocks
</span><del>-struct( domInterface =&gt; {
-    type =&gt; 'domType', # Class type
-    parentType =&gt; 'domType', # Parent class type
-    constants =&gt; '@',    # List of 'domConstant'
-    functions =&gt; '@',    # List of 'domFunction'
-    anonymousFunctions =&gt; '@', # List of 'domFunction'
-    attributes =&gt; '@',    # List of 'domAttribute'    
-    extendedAttributes =&gt; '$', # Extended attributes
-    constructors =&gt; '@', # Constructors, list of 'domFunction'
-    customConstructors =&gt; '@', # Custom constructors, list of 'domFunction'
</del><ins>+struct( IDLInterface =&gt; {
+    type =&gt; 'IDLType',
+    parentType =&gt; 'IDLType',
+    constants =&gt; '@',    # List of 'IDLConstant'
+    functions =&gt; '@',    # List of 'IDLOperation'
+    anonymousFunctions =&gt; '@', # List of 'IDLOperation'
+    attributes =&gt; '@',    # List of 'IDLAttribute'    
+    constructors =&gt; '@', # Constructors, list of 'IDLOperation'
+    customConstructors =&gt; '@', # Custom constructors, list of 'IDLOperation'
</ins><span class="cx">     isException =&gt; '$', # Used for exception interfaces
</span><span class="cx">     isCallback =&gt; '$', # Used for callback interfaces
</span><span class="cx">     isPartial =&gt; '$', # Used for partial interfaces
</span><span class="cx">     iterable =&gt; '$', # Used for iterable interfaces
</span><span class="cx">     serializable =&gt; '$', # Used for serializable interfaces
</span><ins>+    extendedAttributes =&gt; '$',
</ins><span class="cx"> });
</span><span class="cx"> 
</span><del>-# Used to represent domInterface contents (name of method, signature)
-struct( domFunction =&gt; {
</del><ins>+# Used to represent an argument to a IDLOperation.
+struct( IDLArgument =&gt; {
+    name =&gt; '$',
+    type =&gt; 'IDLType',
+    isVariadic =&gt; '$',
+    isOptional =&gt; '$',
+    default =&gt; '$',
+    extendedAttributes =&gt; '$',
+});
+
+# https://heycam.github.io/webidl/#idl-operations
+struct( IDLOperation =&gt; {
+    name =&gt; '$',
+    type =&gt; 'IDLType', # Return type
+    arguments =&gt; '@', # List of 'IDLArgument'
</ins><span class="cx">     isStatic =&gt; '$',
</span><del>-    signature =&gt; 'domSignature', # Return type/Object name/extended attributes
-    parameters =&gt; '@', # List of 'domSignature'
</del><ins>+    specials =&gt; '@',
+    extendedAttributes =&gt; '$',
</ins><span class="cx"> });
</span><span class="cx"> 
</span><del>-# Used to represent domInterface contents (name of attribute, signature)
-struct( domAttribute =&gt; {
</del><ins>+
+# https://heycam.github.io/webidl/#idl-attributes
+struct( IDLAttribute =&gt; {
+    name =&gt; '$',
+    type =&gt; 'IDLType',
</ins><span class="cx">     isStatic =&gt; '$',
</span><span class="cx">     isStringifier =&gt; '$',
</span><span class="cx">     isReadOnly =&gt; '$',
</span><del>-    signature =&gt; 'domSignature', # Attribute signature
</del><ins>+    extendedAttributes =&gt; '$',
</ins><span class="cx"> });
</span><span class="cx"> 
</span><del>-# Used to represent Iterable interfaces
-struct( domIterable =&gt; {
-    isKeyValue =&gt; '$',# Is map iterable or set iterable
-    keyType =&gt; 'domType', # Key type for map iterables
-    valueType =&gt; 'domType', # Value type for map or set iterables
</del><ins>+# https://heycam.github.io/webidl/#idl-iterable
+struct( IDLIterable =&gt; {
+    isKeyValue =&gt; '$',
+    keyType =&gt; 'IDLType',
+    valueType =&gt; 'IDLType',
</ins><span class="cx">     functions =&gt; '@', # Iterable functions (entries, keys, values, [Symbol.Iterator], forEach)
</span><del>-    extendedAttributes =&gt; '$', # Extended attributes
</del><ins>+    extendedAttributes =&gt; '$',
</ins><span class="cx"> });
</span><span class="cx"> 
</span><del>-# Used to represent serializable interface
-struct( domSerializable =&gt; {
</del><ins>+# https://heycam.github.io/webidl/#idl-serializers
+struct( IDLSerializable =&gt; {
</ins><span class="cx">     attributes =&gt; '@', # List of attributes to serialize
</span><span class="cx">     hasAttribute =&gt; '$', # serializer = { attribute }
</span><span class="cx">     hasInherit =&gt; '$', # serializer = { inherit }
</span><span class="lines">@@ -114,39 +119,50 @@
</span><span class="cx">     functions =&gt; '@', # toJSON function
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-# Used to represent string constants
-struct( domConstant =&gt; {
-    name =&gt; '$', # DOM Constant identifier
-    type =&gt; 'domType', # Type name of data
-    value =&gt; '$', # Constant value
-    extendedAttributes =&gt; '$', # Extended attributes
</del><ins>+# https://heycam.github.io/webidl/#idl-constants
+struct( IDLConstant =&gt; {
+    name =&gt; '$',
+    type =&gt; 'IDLType',
+    value =&gt; '$',
+    extendedAttributes =&gt; '$',
</ins><span class="cx"> });
</span><span class="cx"> 
</span><del>-# Used to represent 'enum' definitions
-struct( domEnum =&gt; {
-    name =&gt; '$', # Enumeration identifier
-    type =&gt; 'domType', # Enumeration type
-    values =&gt; '@', # Enumeration values (list of unique strings)
</del><ins>+# https://heycam.github.io/webidl/#idl-enums
+struct( IDLEnum =&gt; {
+    name =&gt; '$',
+    type =&gt; 'IDLType',
+    values =&gt; '@',
</ins><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-struct( domDictionary =&gt; {
-    type =&gt; 'domType', # Dictionary type
-    parentType =&gt; 'domType',  # Parent type identifier
-    members =&gt; '@', # List of 'domSignature'
</del><ins>+
+struct( IDLDictionaryMember =&gt; {
+    name =&gt; '$',
+    type =&gt; 'IDLType',
+    isRequired =&gt; '$',
+    default =&gt; '$',
</ins><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+
+# https://heycam.github.io/webidl/#idl-dictionaries
+struct( IDLDictionary =&gt; {
+    type =&gt; 'IDLType',
+    parentType =&gt; 'IDLType',
+    members =&gt; '@', # List of 'IDLDictionaryMember'
+    extendedAttributes =&gt; '$',
+});
+
+# https://heycam.github.io/webidl/#idl-enums
+struct( IDLTypedef =&gt; {
+    type =&gt; 'IDLType',
+});
+
</ins><span class="cx"> struct( Token =&gt; {
</span><span class="cx">     type =&gt; '$', # type of token
</span><span class="cx">     value =&gt; '$' # value of token
</span><span class="cx"> });
</span><span class="cx"> 
</span><del>-struct( Typedef =&gt; {
-    extendedAttributes =&gt; '$', # Extended attributes
-    type =&gt; 'domType', # Type of data
-});
-
</del><span class="cx"> # Maps 'typedef name' -&gt; Typedef
</span><span class="cx"> my %typedefs = ();
</span><span class="cx"> 
</span><span class="lines">@@ -251,14 +267,14 @@
</span><span class="cx">     };
</span><span class="cx">     assert $@ . &quot; in $fileName&quot; if $@;
</span><span class="cx"> 
</span><del>-    my $document = idlDocument-&gt;new();
</del><ins>+    my $document = IDLDocument-&gt;new();
</ins><span class="cx">     $document-&gt;fileName($fileName);
</span><span class="cx">     foreach my $definition (@definitions) {
</span><del>-        if (ref($definition) eq &quot;domInterface&quot;) {
</del><ins>+        if (ref($definition) eq &quot;IDLInterface&quot;) {
</ins><span class="cx">             push(@{$document-&gt;interfaces}, $definition);
</span><del>-        } elsif (ref($definition) eq &quot;domEnum&quot;) {
</del><ins>+        } elsif (ref($definition) eq &quot;IDLEnum&quot;) {
</ins><span class="cx">             push(@{$document-&gt;enumerations}, $definition);
</span><del>-        } elsif (ref($definition) eq &quot;domDictionary&quot;) {
</del><ins>+        } elsif (ref($definition) eq &quot;IDLDictionary&quot;) {
</ins><span class="cx">             push(@{$document-&gt;dictionaries}, $definition);
</span><span class="cx">         } else {
</span><span class="cx">             die &quot;Unrecognized IDL definition kind: \&quot;&quot; . ref($definition) . &quot;\&quot;&quot;;
</span><span class="lines">@@ -362,7 +378,7 @@
</span><span class="cx"> {
</span><span class="cx">     my $typeName = shift;
</span><span class="cx"> 
</span><del>-    my $type = domType-&gt;new();
</del><ins>+    my $type = IDLType-&gt;new();
</ins><span class="cx">     $type-&gt;name($typeName);
</span><span class="cx">     
</span><span class="cx">     return $type;
</span><span class="lines">@@ -373,7 +389,7 @@
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $type = shift;
</span><span class="cx"> 
</span><del>-    my $clonedType = domType-&gt;new();
</del><ins>+    my $clonedType = IDLType-&gt;new();
</ins><span class="cx">     $clonedType-&gt;name($type-&gt;name);
</span><span class="cx">     $clonedType-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx">     $clonedType-&gt;isUnion($type-&gt;isUnion);
</span><span class="lines">@@ -441,84 +457,61 @@
</span><span class="cx">     if (!%typedefs) {
</span><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+    
+    # FIXME: Add support for applying typedefs to IDLIterable.
</ins><span class="cx">     foreach my $definition (@$definitions) {
</span><del>-        if (ref($definition) eq &quot;domInterface&quot;) {
</del><ins>+        if (ref($definition) eq &quot;IDLInterface&quot;) {
</ins><span class="cx">             foreach my $constant (@{$definition-&gt;constants}) {
</span><del>-                if (exists $typedefs{$constant-&gt;type-&gt;name}) {
-                    my $typedef = $typedefs{$constant-&gt;type-&gt;name};
-                    $self-&gt;assertNoExtendedAttributesInTypedef($constant-&gt;type-&gt;name, __LINE__);
-
-                    my $clonedType = $self-&gt;cloneType($typedef-&gt;type);
-                
-                    # Retain nullability from the original type.
-                    $clonedType-&gt;isNullable($constant-&gt;type-&gt;isNullable);
-
-                    $constant-&gt;type($clonedType);
-                }
</del><ins>+                $constant-&gt;type($self-&gt;typeByApplyingTypedefs($constant-&gt;type));
</ins><span class="cx">             }
</span><span class="cx">             foreach my $attribute (@{$definition-&gt;attributes}) {
</span><del>-                $self-&gt;applyTypedefsForSignature($attribute-&gt;signature);
</del><ins>+                $attribute-&gt;type($self-&gt;typeByApplyingTypedefs($attribute-&gt;type));
</ins><span class="cx">             }
</span><span class="cx">             foreach my $function (@{$definition-&gt;functions}, @{$definition-&gt;anonymousFunctions}, @{$definition-&gt;constructors}, @{$definition-&gt;customConstructors}) {
</span><del>-                $self-&gt;applyTypedefsForSignature($function-&gt;signature);
-                foreach my $signature (@{$function-&gt;parameters}) {
-                    $self-&gt;applyTypedefsForSignature($signature);
</del><ins>+                if ($function-&gt;type) {
+                    $function-&gt;type($self-&gt;typeByApplyingTypedefs($function-&gt;type));
</ins><span class="cx">                 }
</span><ins>+
+                foreach my $argument (@{$function-&gt;arguments}) {
+                    $argument-&gt;type($self-&gt;typeByApplyingTypedefs($argument-&gt;type));
+                }
</ins><span class="cx">             }
</span><del>-        } elsif (ref($definition) eq &quot;domDictionary&quot;) {
</del><ins>+        } elsif (ref($definition) eq &quot;IDLDictionary&quot;) {
</ins><span class="cx">             foreach my $member (@{$definition-&gt;members}) {
</span><del>-                $self-&gt;applyTypedefsForSignature($member);
</del><ins>+                $member-&gt;type($self-&gt;typeByApplyingTypedefs($member-&gt;type));
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub applyTypedefsForSignature
</del><ins>+sub typeByApplyingTypedefs
</ins><span class="cx"> {
</span><span class="cx">     my $self = shift;
</span><del>-    my $signature = shift;
</del><ins>+    my $type = shift;
</ins><span class="cx"> 
</span><del>-    if (!defined ($signature-&gt;type)) {
-        return;
-    }
</del><ins>+    assert(&quot;Missing type&quot;) if !$type;
</ins><span class="cx"> 
</span><del>-    my $typeName = $signature-&gt;type-&gt;name;
-
-    # Handle union types, sequences and etc.
-    # FIXME: This should be recursive.
-    my $numberOfSubtypes = scalar @{$signature-&gt;type-&gt;subtypes};
</del><ins>+    my $numberOfSubtypes = scalar @{$type-&gt;subtypes};
</ins><span class="cx">     if ($numberOfSubtypes) {
</span><span class="cx">         for my $i (0..$numberOfSubtypes - 1) {
</span><del>-            my $subtype = @{$signature-&gt;type-&gt;subtypes}[$i];
-            my $subtypeName = $subtype-&gt;name;
</del><ins>+            my $subtype = @{$type-&gt;subtypes}[$i];
+            my $replacementSubtype = $self-&gt;typeByApplyingTypedefs($subtype);
+            @{$type-&gt;subtypes}[$i] = $replacementSubtype
+        }
</ins><span class="cx"> 
</span><del>-            if (exists $typedefs{$subtypeName}) {
-                my $typedef = $typedefs{$subtypeName};
-
-                my $clonedType = $self-&gt;cloneType($typedef-&gt;type);
-                
-                # Retain nullability from the original type.
-                $clonedType-&gt;isNullable($subtype-&gt;isNullable);
-                
-                @{$signature-&gt;type-&gt;subtypes}[$i] = $clonedType;
-            }
-        }
-    
-        return;
</del><ins>+        return $type;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (exists $typedefs{$typeName}) {
-        my $typedef = $typedefs{$typeName};
</del><ins>+    if (exists $typedefs{$type-&gt;name}) {
+        my $typedef = $typedefs{$type-&gt;name};
</ins><span class="cx"> 
</span><span class="cx">         my $clonedType = $self-&gt;cloneType($typedef-&gt;type);
</span><del>-        
-        # Retain nullability from the original type.
-        $clonedType-&gt;isNullable($signature-&gt;type-&gt;isNullable);
</del><ins>+        $clonedType-&gt;isNullable($clonedType-&gt;isNullable || $type-&gt;isNullable);
</ins><span class="cx"> 
</span><del>-        $signature-&gt;type($clonedType);
-
-        copyExtendedAttributes($signature-&gt;extendedAttributes, $typedef-&gt;extendedAttributes);
</del><ins>+        return $clonedType;
</ins><span class="cx">     }
</span><ins>+    
+    return $type;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub parseDefinition
</span><span class="lines">@@ -591,7 +584,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() eq &quot;interface&quot;) {
</span><del>-        my $interface = domInterface-&gt;new();
</del><ins>+        my $interface = IDLInterface-&gt;new();
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;interface&quot;, __LINE__);
</span><span class="cx">         my $interfaceNameToken = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($interfaceNameToken, IdentifierToken);
</span><span class="lines">@@ -708,7 +701,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() eq &quot;dictionary&quot;) {
</span><del>-        my $dictionary = domDictionary-&gt;new();
</del><ins>+        my $dictionary = IDLDictionary-&gt;new();
</ins><span class="cx">         $dictionary-&gt;extendedAttributes($extendedAttributeList);
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;dictionary&quot;, __LINE__);
</span><span class="cx"> 
</span><span class="lines">@@ -759,12 +752,12 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextExceptionField_1/) {
</span><del>-        my $member = domSignature-&gt;new();
-        if ($next-&gt;value ne &quot;required&quot;) {
-            $member-&gt;isOptional(1);
</del><ins>+        my $member = IDLDictionaryMember-&gt;new();
+        if ($next-&gt;value eq &quot;required&quot;) {
+            $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;required&quot;, __LINE__);
+            $member-&gt;isRequired(1);
</ins><span class="cx">         } else {
</span><del>-            $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;required&quot;, __LINE__);
-            $member-&gt;isOptional(0);
</del><ins>+            $member-&gt;isRequired(0);
</ins><span class="cx">         }
</span><span class="cx">         $member-&gt;extendedAttributes($extendedAttributeList);
</span><span class="cx"> 
</span><span class="lines">@@ -833,7 +826,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() eq &quot;exception&quot;) {
</span><del>-        my $interface = domInterface-&gt;new();
</del><ins>+        my $interface = IDLInterface-&gt;new();
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;exception&quot;, __LINE__);
</span><span class="cx">         my $exceptionNameToken = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($exceptionNameToken, IdentifierToken);
</span><span class="lines">@@ -899,7 +892,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() eq &quot;enum&quot;) {
</span><del>-        my $enum = domEnum-&gt;new();
</del><ins>+        my $enum = IDLEnum-&gt;new();
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;enum&quot;, __LINE__);
</span><span class="cx">         my $enumNameToken = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($enumNameToken, IdentifierToken);
</span><span class="lines">@@ -978,8 +971,7 @@
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() eq &quot;typedef&quot;) {
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;typedef&quot;, __LINE__);
</span><del>-        my $typedef = Typedef-&gt;new();
-        $typedef-&gt;extendedAttributes($self-&gt;parseExtendedAttributeListAllowEmpty());
</del><ins>+        my $typedef = IDLTypedef-&gt;new();
</ins><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><span class="cx">         $typedef-&gt;type($type);
</span><span class="lines">@@ -1018,7 +1010,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() eq &quot;const&quot;) {
</span><del>-        my $newDataNode = domConstant-&gt;new();
</del><ins>+        my $newDataNode = IDLConstant-&gt;new();
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;const&quot;, __LINE__);
</span><span class="cx">         my $type = $self-&gt;parseConstType();
</span><span class="cx">         $newDataNode-&gt;type($type);
</span><span class="lines">@@ -1133,13 +1125,12 @@
</span><span class="cx">             $newDataNode = $self-&gt;parseSerializerRest($extendedAttributeList);
</span><span class="cx">             my $next = $self-&gt;nextToken();
</span><span class="cx">         } else {
</span><del>-            $newDataNode = domSerializable-&gt;new();
</del><ins>+            $newDataNode = IDLSerializable-&gt;new();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        my $toJSONFunction = domFunction-&gt;new();
-        $toJSONFunction-&gt;signature(domSignature-&gt;new());
-        $toJSONFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-        $toJSONFunction-&gt;signature-&gt;name(&quot;toJSON&quot;);
</del><ins>+        my $toJSONFunction = IDLOperation-&gt;new();
+        $toJSONFunction-&gt;name(&quot;toJSON&quot;);
+        $toJSONFunction-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx">         push(@{$newDataNode-&gt;functions}, $toJSONFunction);
</span><span class="cx"> 
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;;&quot;, __LINE__);
</span><span class="lines">@@ -1172,7 +1163,7 @@
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() eq &quot;{&quot;) {
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;{&quot;, __LINE__);
</span><del>-        my $newDataNode = domSerializable-&gt;new();
</del><ins>+        my $newDataNode = IDLSerializable-&gt;new();
</ins><span class="cx">         $self-&gt;parseSerializationAttributes($newDataNode);
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;}&quot;, __LINE__);
</span><span class="cx">         return $newDataNode;
</span><span class="lines">@@ -1186,7 +1177,7 @@
</span><span class="cx">         $self-&gt;assertTokenType($token, IdentifierToken);
</span><span class="cx">         push(@attributes, $token-&gt;value());
</span><span class="cx"> 
</span><del>-        my $newDataNode = domSerializable-&gt;new();
</del><ins>+        my $newDataNode = IDLSerializable-&gt;new();
</ins><span class="cx">         $newDataNode-&gt;attributes(\@attributes);
</span><span class="cx"> 
</span><span class="cx">         return $newDataNode;
</span><span class="lines">@@ -1197,21 +1188,21 @@
</span><span class="cx"> sub parseSerializationAttributes
</span><span class="cx"> {
</span><span class="cx">     my $self = shift;
</span><del>-    my $domSerializable = shift;
</del><ins>+    my $serializable = shift;
</ins><span class="cx">     my $token = $self-&gt;getToken();
</span><span class="cx"> 
</span><span class="cx">     if ($token-&gt;value() eq &quot;getter&quot;) {
</span><del>-        $domSerializable-&gt;hasGetter(1);
</del><ins>+        $serializable-&gt;hasGetter(1);
</ins><span class="cx">         die &quot;Serializer getter keyword is not currently supported.&quot;;
</span><span class="cx"> 
</span><span class="cx">     }
</span><span class="cx">     if ($token-&gt;value() eq &quot;inherit&quot;) {
</span><del>-        $domSerializable-&gt;hasInherit(1);
</del><ins>+        $serializable-&gt;hasInherit(1);
</ins><span class="cx">         die &quot;Serializer inherit keyword is not currently supported.&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($token-&gt;value() eq &quot;attribute&quot;) {
</span><del>-        $domSerializable-&gt;hasAttribute(1);
</del><ins>+        $serializable-&gt;hasAttribute(1);
</ins><span class="cx">         # Attributes will be filled in via applyMemberList()
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1220,7 +1211,7 @@
</span><span class="cx">     $self-&gt;assertTokenType($token, IdentifierToken);
</span><span class="cx">     push(@attributes, $token-&gt;value());
</span><span class="cx">     push(@attributes, @{$self-&gt;parseIdentifiers()});
</span><del>-    $domSerializable-&gt;attributes(\@attributes);
</del><ins>+    $serializable-&gt;attributes(\@attributes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub parseIdentifierList
</span><span class="lines">@@ -1286,11 +1277,11 @@
</span><span class="cx">     }
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextAttributeOrOperationRest_1/) {
</span><span class="cx">         my $returnType = $self-&gt;parseReturnType();
</span><del>-        my $interface = $self-&gt;parseOperationRest($extendedAttributeList);
-        if (defined ($interface)) {
-            $interface-&gt;signature-&gt;type($returnType);
</del><ins>+        my $operation = $self-&gt;parseOperationRest($extendedAttributeList);
+        if (defined ($operation)) {
+            $operation-&gt;type($returnType);
</ins><span class="cx">         }
</span><del>-        return $interface;
</del><ins>+        return $operation;
</ins><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -1315,26 +1306,25 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;value() =~ /$nextAttributeRest_1/) {
</span><del>-        my $newDataNode = domAttribute-&gt;new();
-        if ($self-&gt;parseReadOnly()) {
-            $newDataNode-&gt;isReadOnly(1);
-        }
</del><ins>+        my $newDataNode = IDLAttribute-&gt;new();
+        $newDataNode-&gt;isReadOnly($self-&gt;parseReadOnly());
+
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;attribute&quot;, __LINE__);
</span><del>-        $newDataNode-&gt;signature(domSignature-&gt;new());
</del><span class="cx">         
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><del>-        $newDataNode-&gt;signature-&gt;type($type);
</del><ins>+        $newDataNode-&gt;type($type);
</ins><span class="cx"> 
</span><span class="cx">         my $token = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($token, IdentifierToken);
</span><del>-        $newDataNode-&gt;signature-&gt;name(identifierRemoveNullablePrefix($token-&gt;value()));
</del><ins>+        $newDataNode-&gt;name(identifierRemoveNullablePrefix($token-&gt;value()));
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;;&quot;, __LINE__);
</span><ins>+
</ins><span class="cx">         # CustomConstructor may also be used on attributes.
</span><span class="cx">         if (defined $extendedAttributeList-&gt;{&quot;CustomConstructors&quot;}) {
</span><span class="cx">             delete $extendedAttributeList-&gt;{&quot;CustomConstructors&quot;};
</span><span class="cx">             $extendedAttributeList-&gt;{&quot;CustomConstructor&quot;} = &quot;VALUE_IS_MISSING&quot;;
</span><span class="cx">         }
</span><del>-        $newDataNode-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
</del><ins>+        $newDataNode-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx">         return $newDataNode;
</span><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="lines">@@ -1379,7 +1369,7 @@
</span><span class="cx">         my $next = $self-&gt;nextToken();
</span><span class="cx">         if ($next-&gt;type() == IdentifierToken || $next-&gt;value() eq &quot;(&quot;) {
</span><span class="cx">             my $operation = $self-&gt;parseOperationRest($extendedAttributeList);
</span><del>-            $operation-&gt;signature-&gt;type($returnType);
</del><ins>+            $operation-&gt;type($returnType);
</ins><span class="cx">             return $operation;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1396,12 +1386,12 @@
</span><span class="cx">         my @specials = ();
</span><span class="cx">         push(@specials, @{$self-&gt;parseSpecials()});
</span><span class="cx">         my $returnType = $self-&gt;parseReturnType();
</span><del>-        my $interface = $self-&gt;parseOperationRest($extendedAttributeList);
-        if (defined ($interface)) {
-            $interface-&gt;signature-&gt;type($returnType);
-            $interface-&gt;signature-&gt;specials(\@specials);
</del><ins>+        my $operation = $self-&gt;parseOperationRest($extendedAttributeList);
+        if (defined ($operation)) {
+            $operation-&gt;type($returnType);
+            $operation-&gt;specials(\@specials);
</ins><span class="cx">         }
</span><del>-        return $interface;
</del><ins>+        return $operation;
</ins><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="cx"> }
</span><span class="lines">@@ -1469,36 +1459,31 @@
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $extendedAttributeList = shift;
</span><span class="cx"> 
</span><del>-    my $symbolIteratorFunction = domFunction-&gt;new();
-    $symbolIteratorFunction-&gt;signature(domSignature-&gt;new());
-    $symbolIteratorFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-    $symbolIteratorFunction-&gt;signature-&gt;name(&quot;[Symbol.Iterator]&quot;);
</del><ins>+    my $symbolIteratorFunction = IDLOperation-&gt;new();
+    $symbolIteratorFunction-&gt;name(&quot;[Symbol.Iterator]&quot;);
+    $symbolIteratorFunction-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx"> 
</span><del>-    my $entriesFunction = domFunction-&gt;new();
-    $entriesFunction-&gt;signature(domSignature-&gt;new());
-    $entriesFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-    $entriesFunction-&gt;signature-&gt;name(&quot;entries&quot;);
</del><ins>+    my $entriesFunction = IDLOperation-&gt;new();
+    $entriesFunction-&gt;name(&quot;entries&quot;);
+    $entriesFunction-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx"> 
</span><del>-    my $keysFunction = domFunction-&gt;new();
-    $keysFunction-&gt;signature(domSignature-&gt;new());
-    $keysFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-    $keysFunction-&gt;signature-&gt;name(&quot;keys&quot;);
</del><ins>+    my $keysFunction = IDLOperation-&gt;new();
+    $keysFunction-&gt;name(&quot;keys&quot;);
+    $keysFunction-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx"> 
</span><del>-    my $valuesFunction = domFunction-&gt;new();
-    $valuesFunction-&gt;signature(domSignature-&gt;new());
-    $valuesFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-    $valuesFunction-&gt;signature-&gt;name(&quot;values&quot;);
</del><ins>+    my $valuesFunction = IDLOperation-&gt;new();
+    $valuesFunction-&gt;name(&quot;values&quot;);
+    $valuesFunction-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx"> 
</span><del>-    my $forEachFunction = domFunction-&gt;new();
-    $forEachFunction-&gt;signature(domSignature-&gt;new());
-    $forEachFunction-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-    $forEachFunction-&gt;signature-&gt;name(&quot;forEach&quot;);
-    my $forEachArgument = domSignature-&gt;new();
</del><ins>+    my $forEachFunction = IDLOperation-&gt;new();
+    $forEachFunction-&gt;name(&quot;forEach&quot;);
+    $forEachFunction-&gt;extendedAttributes($extendedAttributeList);
+    my $forEachArgument = IDLArgument-&gt;new();
</ins><span class="cx">     $forEachArgument-&gt;name(&quot;callback&quot;);
</span><span class="cx">     $forEachArgument-&gt;type(makeSimpleType(&quot;any&quot;));
</span><del>-    push(@{$forEachFunction-&gt;parameters}, ($forEachArgument));
</del><ins>+    push(@{$forEachFunction-&gt;arguments}, ($forEachArgument));
</ins><span class="cx"> 
</span><del>-    my $newDataNode = domIterable-&gt;new();
</del><ins>+    my $newDataNode = IDLIterable-&gt;new();
</ins><span class="cx">     $newDataNode-&gt;extendedAttributes($extendedAttributeList);
</span><span class="cx">     push(@{$newDataNode-&gt;functions}, $symbolIteratorFunction);
</span><span class="cx">     push(@{$newDataNode-&gt;functions}, $entriesFunction);
</span><span class="lines">@@ -1532,15 +1517,19 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() eq &quot;(&quot;) {
</span><del>-        my $newDataNode = domFunction-&gt;new();
-        $newDataNode-&gt;signature(domSignature-&gt;new());
</del><ins>+        my $newDataNode = IDLOperation-&gt;new();
+
</ins><span class="cx">         my $name = $self-&gt;parseOptionalIdentifier();
</span><del>-        $newDataNode-&gt;signature-&gt;name(identifierRemoveNullablePrefix($name));
</del><ins>+        $newDataNode-&gt;name(identifierRemoveNullablePrefix($name));
+        
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;(&quot;, $name, __LINE__);
</span><del>-        push(@{$newDataNode-&gt;parameters}, @{$self-&gt;parseArgumentList()});
</del><ins>+        
+        push(@{$newDataNode-&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>-        $newDataNode-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
</del><ins>+        
+        $newDataNode-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx">         return $newDataNode;
</span><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="lines">@@ -1592,10 +1581,8 @@
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextArgumentList_1/) {
</span><del>-        my $in = $self-&gt;parseIn();
</del><span class="cx">         my $extendedAttributeList = $self-&gt;parseExtendedAttributeListAllowEmpty();
</span><span class="cx">         my $argument = $self-&gt;parseOptionalOrRequiredArgument($extendedAttributeList);
</span><del>-        $argument-&gt;direction($self-&gt;parseIn());
</del><span class="cx">         return $argument;
</span><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="lines">@@ -1606,7 +1593,7 @@
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $extendedAttributeList = shift;
</span><span class="cx"> 
</span><del>-    my $paramDataNode = domSignature-&gt;new();
</del><ins>+    my $paramDataNode = IDLArgument-&gt;new();
</ins><span class="cx">     $paramDataNode-&gt;extendedAttributes($extendedAttributeList);
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="lines">@@ -1677,19 +1664,17 @@
</span><span class="cx"> 
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextExceptionField_1/) {
</span><del>-        my $newDataNode = domAttribute-&gt;new();
-        $newDataNode-&gt;type(&quot;attribute&quot;);
</del><ins>+        my $newDataNode = IDLAttribute-&gt;new();
</ins><span class="cx">         $newDataNode-&gt;isReadOnly(1);
</span><del>-        $newDataNode-&gt;signature(domSignature-&gt;new());
</del><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><del>-        $newDataNode-&gt;signature-&gt;type($type);
</del><ins>+        $newDataNode-&gt;type($type);
</ins><span class="cx">         
</span><span class="cx">         my $token = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($token, IdentifierToken);
</span><del>-        $newDataNode-&gt;signature-&gt;name(identifierRemoveNullablePrefix($token-&gt;value()));
</del><ins>+        $newDataNode-&gt;name(identifierRemoveNullablePrefix($token-&gt;value()));
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;;&quot;, __LINE__);
</span><del>-        $newDataNode-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
</del><ins>+        $newDataNode-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx">         return $newDataNode;
</span><span class="cx">     }
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="lines">@@ -1959,7 +1944,7 @@
</span><span class="cx">     if ($next-&gt;value() eq &quot;any&quot;) {
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;any&quot;, __LINE__);
</span><span class="cx">         
</span><del>-        my $anyType = domType-&gt;new();
</del><ins>+        my $anyType = IDLType-&gt;new();
</ins><span class="cx">         $anyType-&gt;name(&quot;any&quot;);
</span><span class="cx">         return $anyType;
</span><span class="cx">     }
</span><span class="lines">@@ -1976,7 +1961,7 @@
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx"> 
</span><del>-    my $unionType = domType-&gt;new();
</del><ins>+    my $unionType = IDLType-&gt;new();
</ins><span class="cx">     $unionType-&gt;name(&quot;UNION&quot;);
</span><span class="cx">     $unionType-&gt;isUnion(1);
</span><span class="cx"> 
</span><span class="lines">@@ -2035,7 +2020,7 @@
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx"> 
</span><del>-    my $type = domType-&gt;new();
</del><ins>+    my $type = IDLType-&gt;new();
</ins><span class="cx"> 
</span><span class="cx">     if ($next-&gt;value() =~ /$nextNonAnyType_1/) {
</span><span class="cx">         $type-&gt;name($self-&gt;parsePrimitiveType());
</span><span class="lines">@@ -2131,7 +2116,7 @@
</span><span class="cx">     my $self = shift;
</span><span class="cx">     my $next = $self-&gt;nextToken();
</span><span class="cx"> 
</span><del>-    my $type = domType-&gt;new();
</del><ins>+    my $type = IDLType-&gt;new();
</ins><span class="cx"> 
</span><span class="cx">     if ($next-&gt;value() =~ /$nextNonAnyType_1/) {
</span><span class="cx">         $type-&gt;name($self-&gt;parsePrimitiveType());
</span><span class="lines">@@ -2268,7 +2253,7 @@
</span><span class="cx">     if ($next-&gt;value() eq &quot;void&quot;) {
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;void&quot;, __LINE__);
</span><span class="cx">         
</span><del>-        my $voidType = domType-&gt;new();
</del><ins>+        my $voidType = IDLType-&gt;new();
</ins><span class="cx">         $voidType-&gt;name(&quot;void&quot;);
</span><span class="cx">         return $voidType;
</span><span class="cx">     }
</span><span class="lines">@@ -2278,17 +2263,6 @@
</span><span class="cx">     $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub parseIn
-{
-    my $self = shift;
-    my $next = $self-&gt;nextToken();
-    if ($next-&gt;value() eq &quot;in&quot;) {
-        $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;in&quot;, __LINE__);
-        return &quot;in&quot;;
-    }
-    return &quot;&quot;;
-}
-
</del><span class="cx"> sub parseOptionalSemicolon
</span><span class="cx"> {
</span><span class="cx">     my $self = shift;
</span><span class="lines">@@ -2329,7 +2303,7 @@
</span><span class="cx">     # This check may have to move to the code generator, if we don't have enough information
</span><span class="cx">     # here to determine serializability: https://heycam.github.io/webidl/#idl-serializers
</span><span class="cx">     my $serializable_types = '^(\(byte|octet|short|unsigned short|long|unsigned long|long long|unsigned long long|float|unrestricted float|double|unrestricted double|boolean|DOMString|ByteString|USVString)$';
</span><del>-    return $attribute-&gt;signature-&gt;type-&gt;name =~ /$serializable_types/;
</del><ins>+    return $attribute-&gt;type-&gt;name =~ /$serializable_types/;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub applyMemberList
</span><span class="lines">@@ -2338,20 +2312,20 @@
</span><span class="cx">     my $members = shift;
</span><span class="cx"> 
</span><span class="cx">     for my $item (@{$members}) {
</span><del>-        if (ref($item) eq &quot;domAttribute&quot;) {
</del><ins>+        if (ref($item) eq &quot;IDLAttribute&quot;) {
</ins><span class="cx">             push(@{$interface-&gt;attributes}, $item);
</span><span class="cx">             next;
</span><span class="cx">         }
</span><del>-        if (ref($item) eq &quot;domConstant&quot;) {
</del><ins>+        if (ref($item) eq &quot;IDLConstant&quot;) {
</ins><span class="cx">             push(@{$interface-&gt;constants}, $item);
</span><span class="cx">             next;
</span><span class="cx">         }
</span><del>-        if (ref($item) eq &quot;domIterable&quot;) {
</del><ins>+        if (ref($item) eq &quot;IDLIterable&quot;) {
</ins><span class="cx">             $interface-&gt;iterable($item);
</span><span class="cx">             next;
</span><span class="cx">         }
</span><del>-        if (ref($item) eq &quot;domFunction&quot;) {
-            if ($item-&gt;signature-&gt;name eq &quot;&quot;) {
</del><ins>+        if (ref($item) eq &quot;IDLOperation&quot;) {
+            if ($item-&gt;name eq &quot;&quot;) {
</ins><span class="cx">                 push(@{$interface-&gt;anonymousFunctions}, $item);
</span><span class="cx">             } else {
</span><span class="cx">                 push(@{$interface-&gt;functions}, $item);
</span><span class="lines">@@ -2358,7 +2332,7 @@
</span><span class="cx">             }
</span><span class="cx">             next;
</span><span class="cx">         }
</span><del>-        if (ref($item) eq &quot;domSerializable&quot;) {
</del><ins>+        if (ref($item) eq &quot;IDLSerializable&quot;) {
</ins><span class="cx">             $interface-&gt;serializable($item);
</span><span class="cx">             next;
</span><span class="cx">         }
</span><span class="lines">@@ -2369,12 +2343,12 @@
</span><span class="cx">         if ($interface-&gt;serializable-&gt;hasAttribute) {
</span><span class="cx">             foreach my $attribute (@{$interface-&gt;attributes}) {
</span><span class="cx">                 if (isSerializableAttribute($attribute)) {
</span><del>-                    push(@{$interface-&gt;serializable-&gt;attributes}, $attribute-&gt;signature-&gt;name);
</del><ins>+                    push(@{$interface-&gt;serializable-&gt;attributes}, $attribute-&gt;name);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         } elsif ($numSerializerAttributes == 0) {
</span><span class="cx">             foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-                push(@{$interface-&gt;serializable-&gt;attributes}, $attribute-&gt;signature-&gt;name);
</del><ins>+                push(@{$interface-&gt;serializable-&gt;attributes}, $attribute-&gt;name);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2389,24 +2363,22 @@
</span><span class="cx">         my @constructorParams = @{$extendedAttributeList-&gt;{&quot;Constructors&quot;}};
</span><span class="cx">         my $index = (@constructorParams == 1) ? 0 : 1;
</span><span class="cx">         foreach my $param (@constructorParams) {
</span><del>-            my $constructor = domFunction-&gt;new();
-            $constructor-&gt;signature(domSignature-&gt;new());
-            $constructor-&gt;signature-&gt;name(&quot;Constructor&quot;);
-            $constructor-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-            $constructor-&gt;parameters($param);
</del><ins>+            my $constructor = IDLOperation-&gt;new();
+            $constructor-&gt;name(&quot;Constructor&quot;);
+            $constructor-&gt;extendedAttributes($extendedAttributeList);
+            $constructor-&gt;arguments($param);
</ins><span class="cx">             push(@{$interface-&gt;constructors}, $constructor);
</span><span class="cx">         }
</span><span class="cx">         delete $extendedAttributeList-&gt;{&quot;Constructors&quot;};
</span><span class="cx">         $extendedAttributeList-&gt;{&quot;Constructor&quot;} = &quot;VALUE_IS_MISSING&quot;;
</span><span class="cx">     } elsif (defined $extendedAttributeList-&gt;{&quot;NamedConstructor&quot;}) {
</span><del>-        my $newDataNode = domFunction-&gt;new();
-        $newDataNode-&gt;signature(domSignature-&gt;new());
-        $newDataNode-&gt;signature-&gt;name(&quot;NamedConstructor&quot;);
-        $newDataNode-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
</del><ins>+        my $newDataNode = IDLOperation-&gt;new();
+        $newDataNode-&gt;name(&quot;NamedConstructor&quot;);
+        $newDataNode-&gt;extendedAttributes($extendedAttributeList);
</ins><span class="cx">         my %attributes = %{$extendedAttributeList-&gt;{&quot;NamedConstructor&quot;}};
</span><span class="cx">         my @attributeKeys = keys (%attributes);
</span><span class="cx">         my $constructorName = $attributeKeys[0];
</span><del>-        push(@{$newDataNode-&gt;parameters}, @{$attributes{$constructorName}});
</del><ins>+        push(@{$newDataNode-&gt;arguments}, @{$attributes{$constructorName}});
</ins><span class="cx">         $extendedAttributeList-&gt;{&quot;NamedConstructor&quot;} = $constructorName;
</span><span class="cx">         push(@{$interface-&gt;constructors}, $newDataNode);
</span><span class="cx">     }
</span><span class="lines">@@ -2414,11 +2386,10 @@
</span><span class="cx">         my @customConstructorParams = @{$extendedAttributeList-&gt;{&quot;CustomConstructors&quot;}};
</span><span class="cx">         my $index = (@customConstructorParams == 1) ? 0 : 1;
</span><span class="cx">         foreach my $param (@customConstructorParams) {
</span><del>-            my $customConstructor = domFunction-&gt;new();
-            $customConstructor-&gt;signature(domSignature-&gt;new());
-            $customConstructor-&gt;signature-&gt;name(&quot;CustomConstructor&quot;);
-            $customConstructor-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
-            $customConstructor-&gt;parameters($param);
</del><ins>+            my $customConstructor = IDLOperation-&gt;new();
+            $customConstructor-&gt;name(&quot;CustomConstructor&quot;);
+            $customConstructor-&gt;extendedAttributes($extendedAttributeList);
+            $customConstructor-&gt;arguments($param);
</ins><span class="cx">             push(@{$interface-&gt;customConstructors}, $customConstructor);
</span><span class="cx">         }
</span><span class="cx">         delete $extendedAttributeList-&gt;{&quot;CustomConstructors&quot;};
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsgeneratebindingspl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/generate-bindings.pl (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/generate-bindings.pl        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/bindings/scripts/generate-bindings.pl        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -157,14 +157,14 @@
</span><span class="cx"> 
</span><span class="cx">             # Support for attributes of partial interfaces.
</span><span class="cx">             foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-                next unless shouldPropertyBeExposed($attribute-&gt;signature, \@targetGlobalContexts);
</del><ins>+                next unless shouldPropertyBeExposed($attribute, \@targetGlobalContexts);
</ins><span class="cx"> 
</span><span class="cx">                 # Record that this attribute is implemented by $interfaceName.
</span><del>-                $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;} = $interfaceName if $interface-&gt;isPartial;
</del><ins>+                $attribute-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;} = $interfaceName if $interface-&gt;isPartial;
</ins><span class="cx"> 
</span><span class="cx">                 # Add interface-wide extended attributes to each attribute.
</span><span class="cx">                 foreach my $extendedAttributeName (keys %{$interface-&gt;extendedAttributes}) {
</span><del>-                    $attribute-&gt;signature-&gt;extendedAttributes-&gt;{$extendedAttributeName} = $interface-&gt;extendedAttributes-&gt;{$extendedAttributeName};
</del><ins>+                    $attribute-&gt;extendedAttributes-&gt;{$extendedAttributeName} = $interface-&gt;extendedAttributes-&gt;{$extendedAttributeName};
</ins><span class="cx">                 }
</span><span class="cx">                 push(@{$targetDataNode-&gt;attributes}, $attribute);
</span><span class="cx">             }
</span><span class="lines">@@ -171,14 +171,14 @@
</span><span class="cx"> 
</span><span class="cx">             # Support for methods of partial interfaces.
</span><span class="cx">             foreach my $function (@{$interface-&gt;functions}) {
</span><del>-                next unless shouldPropertyBeExposed($function-&gt;signature, \@targetGlobalContexts);
</del><ins>+                next unless shouldPropertyBeExposed($function, \@targetGlobalContexts);
</ins><span class="cx"> 
</span><span class="cx">                 # Record that this method is implemented by $interfaceName.
</span><del>-                $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;} = $interfaceName if $interface-&gt;isPartial;
</del><ins>+                $function-&gt;extendedAttributes-&gt;{&quot;ImplementedBy&quot;} = $interfaceName if $interface-&gt;isPartial;
</ins><span class="cx"> 
</span><span class="cx">                 # Add interface-wide extended attributes to each method.
</span><span class="cx">                 foreach my $extendedAttributeName (keys %{$interface-&gt;extendedAttributes}) {
</span><del>-                    $function-&gt;signature-&gt;extendedAttributes-&gt;{$extendedAttributeName} = $interface-&gt;extendedAttributes-&gt;{$extendedAttributeName};
</del><ins>+                    $function-&gt;extendedAttributes-&gt;{$extendedAttributeName} = $interface-&gt;extendedAttributes-&gt;{$extendedAttributeName};
</ins><span class="cx">                 }
</span><span class="cx">                 push(@{$targetDataNode-&gt;functions}, $function);
</span><span class="cx">             }
</span><span class="lines">@@ -210,9 +210,9 @@
</span><span class="cx"> # on which global contexts they should be exposed.
</span><span class="cx"> sub shouldPropertyBeExposed
</span><span class="cx"> {
</span><del>-    my ($signature, $targetGlobalContexts) = @_;
</del><ins>+    my ($context, $targetGlobalContexts) = @_;
</ins><span class="cx"> 
</span><del>-    my $exposed = $signature-&gt;extendedAttributes-&gt;{Exposed};
</del><ins>+    my $exposed = $context-&gt;extendedAttributes-&gt;{Exposed};
</ins><span class="cx"> 
</span><span class="cx">     return 1 unless $exposed;
</span><span class="cx"> 
</span><span class="lines">@@ -289,13 +289,13 @@
</span><span class="cx">         checkIfIDLAttributesExists($idlAttributes, $interface-&gt;extendedAttributes, $idlFile);
</span><span class="cx"> 
</span><span class="cx">         foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-            checkIfIDLAttributesExists($idlAttributes, $attribute-&gt;signature-&gt;extendedAttributes, $idlFile);
</del><ins>+            checkIfIDLAttributesExists($idlAttributes, $attribute-&gt;extendedAttributes, $idlFile);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><del>-            checkIfIDLAttributesExists($idlAttributes, $function-&gt;signature-&gt;extendedAttributes, $idlFile);
-            foreach my $parameter (@{$function-&gt;parameters}) {
-                checkIfIDLAttributesExists($idlAttributes, $parameter-&gt;extendedAttributes, $idlFile);
</del><ins>+            checkIfIDLAttributesExists($idlAttributes, $function-&gt;extendedAttributes, $idlFile);
+            foreach my $argument (@{$function-&gt;arguments}) {
+                checkIfIDLAttributesExists($idlAttributes, $argument-&gt;extendedAttributes, $idlFile);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionUnionArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFuncWithClamp(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionImmutablePointFunction(JSC::ExecState*);
</span><span class="lines">@@ -173,6 +174,7 @@
</span><span class="cx">     { &quot;nullableSequenceArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestTypedefsPrototypeFunctionNullableSequenceArg), (intptr_t) (1) } },
</span><span class="cx">     { &quot;sequenceOfNullablesArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg), (intptr_t) (1) } },
</span><span class="cx">     { &quot;nullableSequenceOfNullablesArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg), (intptr_t) (1) } },
</span><ins>+    { &quot;nullableSequenceOfUnionsArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg), (intptr_t) (1) } },
</ins><span class="cx">     { &quot;unionArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestTypedefsPrototypeFunctionUnionArg), (intptr_t) (1) } },
</span><span class="cx">     { &quot;funcWithClamp&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestTypedefsPrototypeFunctionFuncWithClamp), (intptr_t) (1) } },
</span><span class="cx">     { &quot;immutablePointFunction&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestTypedefsPrototypeFunctionImmutablePointFunction), (intptr_t) (0) } },
</span><span class="lines">@@ -610,6 +612,26 @@
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgCaller(JSC::ExecState*, JSTestTypedefs*, JSC::ThrowScope&amp;);
+
+EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg(ExecState* state)
+{
+    return BindingCaller&lt;JSTestTypedefs&gt;::callOperation&lt;jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgCaller&gt;(state, &quot;nullableSequenceOfUnionsArg&quot;);
+}
+
+static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgCaller(JSC::ExecState* state, JSTestTypedefs* castedThis, JSC::ThrowScope&amp; throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto&amp; impl = castedThis-&gt;wrapped();
+    if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
+        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+    auto sequenceArg = convert&lt;IDLNullable&lt;IDLSequence&lt;IDLUnion&lt;IDLDOMString, IDLSequence&lt;IDLDOMString&gt;&gt;&gt;&gt;&gt;(*state, state-&gt;uncheckedArgument(0));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    impl.nullableSequenceOfUnionsArg(WTFMove(sequenceArg));
+    return JSValue::encode(jsUndefined());
+}
+
</ins><span class="cx"> static inline JSC::EncodedJSValue jsTestTypedefsPrototypeFunctionUnionArgCaller(JSC::ExecState*, JSTestTypedefs*, JSC::ThrowScope&amp;);
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionUnionArg(ExecState* state)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestTypedefsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/bindings/scripts/test/TestTypedefs.idl        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -49,10 +49,11 @@
</span><span class="cx">     void nullableSequenceArg(SEQUENCE_OF_STRINGS? sequenceArg);
</span><span class="cx">     void sequenceOfNullablesArg(sequence&lt;STRING?&gt; sequenceArg);
</span><span class="cx">     void nullableSequenceOfNullablesArg(SEQUENCE_OF_NULLABLE_STRINGS? sequenceArg);
</span><ins>+    void nullableSequenceOfUnionsArg(sequence&lt;(STRING or SEQUENCE_OF_STRINGS)&gt;? sequenceArg);
</ins><span class="cx"> 
</span><span class="cx">     void unionArg(UNION_STRING_LONG unionArg);
</span><span class="cx"> 
</span><del>-    void funcWithClamp(ULONGLONG_CLAMP arg1, optional ULONGLONG_CLAMP arg2);
</del><ins>+    void funcWithClamp([Clamp] ULONGLONG arg1, [Clamp] optional ULONGLONG arg2);
</ins><span class="cx"> 
</span><span class="cx">     [Immutable] SVGPOINT immutablePointFunction();
</span><span class="cx"> 
</span><span class="lines">@@ -71,7 +72,6 @@
</span><span class="cx"> 
</span><span class="cx"> typedef unrestricted float         DOUBLE;
</span><span class="cx"> typedef unsigned long long         ULONGLONG;
</span><del>-typedef [Clamp] unsigned long long ULONGLONG_CLAMP;
</del><span class="cx"> typedef SerializedScriptValue      SCRIPT_VALUE;
</span><span class="cx"> typedef sequence&lt;long&gt;             SEQUENCE_OF_LONGS;
</span><span class="cx"> typedef long?                      NULLABLE_LONG;
</span></span></pre></div>
<a id="trunkSourceWebCorepagemake_settingspl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/make_settings.pl (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/make_settings.pl        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Source/WebCore/page/make_settings.pl        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -370,7 +370,7 @@
</span><span class="cx">         my $type = $parsedItems{$settingName}{&quot;type&quot;};
</span><span class="cx">         my $idlType = $webcoreTypeToIdlType{$type};
</span><span class="cx">         my $setterFunctionName = setterFunctionName($settingName);
</span><del>-        print $file &quot;    void $setterFunctionName(in $idlType $settingName);\n&quot;;
</del><ins>+        print $file &quot;    void $setterFunctionName($idlType $settingName);\n&quot;;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     enumerateParsedItems($file, $parsedItemsRef, \&amp;writeIdlSetter);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Tools/ChangeLog        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-30  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
+        https://bugs.webkit.org/show_bug.cgi?id=164208
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
+        * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+        Update for new struct types.
+
</ins><span class="cx"> 2016-10-29  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix failing ExtendedColor tests.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeBindingsCodeGeneratorDumpRenderTreepm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">     if (my @functions = @{$interface-&gt;functions}) {
</span><span class="cx">         push(@contents, &quot;\n    // Functions\n\n&quot;);
</span><span class="cx">         foreach my $function (@functions) {
</span><del>-            push(@contents, &quot;    static JSValueRef @{[$function-&gt;signature-&gt;name]}(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*);\n&quot;);
</del><ins>+            push(@contents, &quot;    static JSValueRef @{[$function-&gt;name]}(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*);\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -270,7 +270,7 @@
</span><span class="cx">         foreach my $function (@functions) {
</span><span class="cx">             push(@contents, &lt;&lt;EOF);
</span><span class="cx"> 
</span><del>-JSValueRef ${className}::@{[$function-&gt;signature-&gt;name]}(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</del><ins>+JSValueRef ${className}::@{[$function-&gt;name]}(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</ins><span class="cx"> {
</span><span class="cx">     ${implementationClassName}* impl = to${implementationClassName}(context, thisObject);
</span><span class="cx">     if (!impl)
</span><span class="lines">@@ -278,33 +278,33 @@
</span><span class="cx"> 
</span><span class="cx"> EOF
</span><span class="cx">             my $functionCall;
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CustomArgumentHandling&quot;}) {
-                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;signature-&gt;name . &quot;(context, argumentCount, arguments, exception)&quot;;
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{&quot;CustomArgumentHandling&quot;}) {
+                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;name . &quot;(context, argumentCount, arguments, exception)&quot;;
</ins><span class="cx">             } else {
</span><del>-                my @parameters = ();
-                my @specifiedParameters = @{$function-&gt;parameters};
</del><ins>+                my @arguments = ();
+                my @specifiedArguments = @{$function-&gt;arguments};
</ins><span class="cx"> 
</span><del>-                $self-&gt;_includeHeaders(\%contentsIncludes, $function-&gt;signature-&gt;type, $function-&gt;signature);
</del><ins>+                $self-&gt;_includeHeaders(\%contentsIncludes, $function-&gt;type);
</ins><span class="cx"> 
</span><del>-                if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;PassContext&quot;}) {
-                    push(@parameters, &quot;context&quot;);
</del><ins>+                if ($function-&gt;extendedAttributes-&gt;{&quot;PassContext&quot;}) {
+                    push(@arguments, &quot;context&quot;);
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                foreach my $i (0..$#specifiedParameters) {
-                    my $parameter = $specifiedParameters[$i];
</del><ins>+                foreach my $i (0..$#specifiedArguments) {
+                    my $argument = $specifiedArguments[$i];
</ins><span class="cx"> 
</span><del>-                    $self-&gt;_includeHeaders(\%contentsIncludes, $type, $parameter);
</del><ins>+                    $self-&gt;_includeHeaders(\%contentsIncludes, $type);
</ins><span class="cx"> 
</span><del>-                    push(@contents, &quot;    &quot; . $self-&gt;_platformTypeVariableDeclaration($parameter, $parameter-&gt;name, &quot;arguments[$i]&quot;, &quot;argumentCount &gt; $i&quot;) . &quot;\n&quot;);
</del><ins>+                    push(@contents, &quot;    &quot; . $self-&gt;_platformTypeVariableDeclaration($argument-&gt;type, $argument-&gt;name, &quot;arguments[$i]&quot;, &quot;argumentCount &gt; $i&quot;) . &quot;\n&quot;);
</ins><span class="cx">                     
</span><del>-                    push(@parameters, $self-&gt;_parameterExpression($parameter));
</del><ins>+                    push(@arguments, $self-&gt;_argumentExpression($argument));
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;signature-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @parameters) . &quot;)&quot;;
</del><ins>+                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;;
</ins><span class="cx">             }
</span><span class="cx">             
</span><del>-            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;signature-&gt;type-&gt;name eq &quot;void&quot;;
-            push(@contents, &quot;    return &quot; . $self-&gt;_returnExpression($function-&gt;signature, $functionCall) . &quot;;\n}\n&quot;);
</del><ins>+            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;type-&gt;name eq &quot;void&quot;;
+            push(@contents, &quot;    return &quot; . $self-&gt;_returnExpression($function-&gt;type, $functionCall) . &quot;;\n}\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx">     if (my @attributes = @{$interface-&gt;attributes}) {
</span><span class="cx">         push(@contents, &quot;\n// Attributes\n&quot;);
</span><span class="cx">         foreach my $attribute (@attributes) {
</span><del>-            $self-&gt;_includeHeaders(\%contentsIncludes, $attribute-&gt;signature-&gt;type, $attribute-&gt;signature);
</del><ins>+            $self-&gt;_includeHeaders(\%contentsIncludes, $attribute-&gt;type);
</ins><span class="cx"> 
</span><span class="cx">             my $getterName = $self-&gt;_getterName($attribute);
</span><span class="cx">             my $getterExpression = &quot;impl-&gt;${getterName}()&quot;;
</span><span class="lines">@@ -324,7 +324,7 @@
</span><span class="cx">     if (!impl)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    return @{[$self-&gt;_returnExpression($attribute-&gt;signature, $getterExpression)]};
</del><ins>+    return @{[$self-&gt;_returnExpression($attribute-&gt;type, $getterExpression)]};
</ins><span class="cx"> }
</span><span class="cx"> EOF
</span><span class="cx"> 
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx"> 
</span><span class="cx"> EOF
</span><span class="cx"> 
</span><del>-                my $platformValue = $self-&gt;_platformTypeConstructor($attribute-&gt;signature, &quot;value&quot;);
</del><ins>+                my $platformValue = $self-&gt;_platformTypeConstructor($attribute-&gt;type, &quot;value&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 push(@contents, &lt;&lt;EOF);
</span><span class="cx">     impl-&gt;@{[$self-&gt;_setterName($attribute)]}(${platformValue});
</span><span class="lines">@@ -368,12 +368,12 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    return $attribute-&gt;signature-&gt;name;
</del><ins>+    return $attribute-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _includeHeaders
</span><span class="cx"> {
</span><del>-    my ($self, $headers, $type, $signature) = @_;
</del><ins>+    my ($self, $headers, $type) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return unless defined $type;
</span><span class="cx">     return if $type-&gt;name eq &quot;boolean&quot;;
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub _platformType
</span><span class="cx"> {
</span><del>-    my ($self, $type, $signature) = @_;
</del><ins>+    my ($self, $type) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return undef unless defined $type;
</span><span class="cx"> 
</span><span class="lines">@@ -429,10 +429,8 @@
</span><span class="cx"> 
</span><span class="cx"> sub _platformTypeConstructor
</span><span class="cx"> {
</span><del>-    my ($self, $signature, $argumentName) = @_;
</del><ins>+    my ($self, $type, $argumentName) = @_;
</ins><span class="cx"> 
</span><del>-    my $type = $signature-&gt;type;
-
</del><span class="cx">     return &quot;JSValueToBoolean(context, $argumentName)&quot; if $type eq &quot;boolean&quot;;
</span><span class="cx">     return &quot;$argumentName&quot; if $type-&gt;name eq &quot;object&quot;;
</span><span class="cx">     return &quot;JSRetainPtr&lt;JSStringRef&gt;(Adopt, JSValueToStringCopy(context, $argumentName, 0))&quot; if $$self{codeGenerator}-&gt;IsStringType($type);
</span><span class="lines">@@ -442,10 +440,10 @@
</span><span class="cx"> 
</span><span class="cx"> sub _platformTypeVariableDeclaration
</span><span class="cx"> {
</span><del>-    my ($self, $signature, $variableName, $argumentName, $condition) = @_;
</del><ins>+    my ($self, $type, $variableName, $argumentName, $condition) = @_;
</ins><span class="cx"> 
</span><del>-    my $platformType = $self-&gt;_platformType($signature-&gt;type, $signature);
-    my $constructor = $self-&gt;_platformTypeConstructor($signature, $argumentName);
</del><ins>+    my $platformType = $self-&gt;_platformType($type);
+    my $constructor = $self-&gt;_platformTypeConstructor($type, $argumentName);
</ins><span class="cx"> 
</span><span class="cx">     my %nonPointerTypes = (
</span><span class="cx">         &quot;bool&quot; =&gt; 1,
</span><span class="lines">@@ -470,10 +468,8 @@
</span><span class="cx"> 
</span><span class="cx"> sub _returnExpression
</span><span class="cx"> {
</span><del>-    my ($self, $signature, $expression) = @_;
</del><ins>+    my ($self, $returnType, $expression) = @_;
</ins><span class="cx"> 
</span><del>-    my $returnType = $signature-&gt;type;
-
</del><span class="cx">     return &quot;JSValueMakeUndefined(context)&quot; if $returnType-&gt;name eq &quot;void&quot;;
</span><span class="cx">     return &quot;JSValueMakeBoolean(context, ${expression})&quot; if $returnType-&gt;name eq &quot;boolean&quot;;
</span><span class="cx">     return &quot;${expression}&quot; if $returnType-&gt;name eq &quot;object&quot;;
</span><span class="lines">@@ -482,12 +478,12 @@
</span><span class="cx">     return &quot;toJS(context, WTF::getPtr(${expression}))&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub _parameterExpression
</del><ins>+sub _argumentExpression
</ins><span class="cx"> {
</span><del>-    my ($self, $parameter) = @_;
</del><ins>+    my ($self, $argument) = @_;
</ins><span class="cx"> 
</span><del>-    my $type = $parameter-&gt;type;
-    my $name = $parameter-&gt;name;
</del><ins>+    my $type = $argument-&gt;type;
+    my $name = $argument-&gt;name;
</ins><span class="cx"> 
</span><span class="cx">     return &quot;${name}.get()&quot; if $$self{codeGenerator}-&gt;IsStringType($type);
</span><span class="cx">     return $name;
</span><span class="lines">@@ -497,7 +493,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    my $name = $attribute-&gt;signature-&gt;name;
</del><ins>+    my $name = $attribute-&gt;name;
</ins><span class="cx"> 
</span><span class="cx">     return &quot;set&quot; . $$self{codeGenerator}-&gt;WK_ucfirst($name);
</span><span class="cx"> }
</span><span class="lines">@@ -507,9 +503,9 @@
</span><span class="cx">     my ($self, $interface) = @_;
</span><span class="cx"> 
</span><span class="cx">     my $mapFunction = sub {
</span><del>-        my $name = $_-&gt;signature-&gt;name;
</del><ins>+        my $name = $_-&gt;name;
</ins><span class="cx">         my @attributes = qw(kJSPropertyAttributeDontDelete kJSPropertyAttributeReadOnly);
</span><del>-        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</del><ins>+        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</ins><span class="cx"> 
</span><span class="cx">         return  &quot;{ \&quot;$name\&quot;, $name, &quot; . join(&quot; | &quot;, @attributes) . &quot; }&quot;;
</span><span class="cx">     };
</span><span class="lines">@@ -547,14 +543,14 @@
</span><span class="cx">     my ($self, $interface) = @_;
</span><span class="cx"> 
</span><span class="cx">     my $mapFunction = sub {
</span><del>-        return if $_-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NoImplementation&quot;};
</del><ins>+        return if $_-&gt;extendedAttributes-&gt;{&quot;NoImplementation&quot;};
</ins><span class="cx"> 
</span><del>-        my $attributeName = $_-&gt;signature-&gt;name;
</del><ins>+        my $attributeName = $_-&gt;name;
</ins><span class="cx">         my $getterName = $self-&gt;_getterName($_);
</span><span class="cx">         my $setterName = $_-&gt;isReadOnly ? &quot;0&quot; : $self-&gt;_setterName($_);
</span><span class="cx">         my @attributes = qw(kJSPropertyAttributeDontDelete);
</span><span class="cx">         push(@attributes, &quot;kJSPropertyAttributeReadOnly&quot;) if $_-&gt;isReadOnly;
</span><del>-        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</del><ins>+        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</ins><span class="cx"> 
</span><span class="cx">         return &quot;{ \&quot;$attributeName\&quot;, $getterName, $setterName, &quot; . join(&quot; | &quot;, @attributes) . &quot; }&quot;;
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsCodeGeneratorTestRunnerpm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm (208133 => 208134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm        2016-10-30 22:33:02 UTC (rev 208133)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm        2016-10-30 22:35:00 UTC (rev 208134)
</span><span class="lines">@@ -71,8 +71,6 @@
</span><span class="cx"> {
</span><span class="cx">     my ($type) = @_;
</span><span class="cx"> 
</span><del>-    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
-
</del><span class="cx">     return &quot;JS&quot; . _implementationClassName($type);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -191,7 +189,7 @@
</span><span class="cx">     if (my @functions = @{$interface-&gt;functions}) {
</span><span class="cx">         push(@contents, &quot;\n    // Functions\n\n&quot;);
</span><span class="cx">         foreach my $function (@functions) {
</span><del>-            push(@contents, &quot;    static JSValueRef @{[$function-&gt;signature-&gt;name]}(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*);\n&quot;);
</del><ins>+            push(@contents, &quot;    static JSValueRef @{[$function-&gt;name]}(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*);\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -285,7 +283,7 @@
</span><span class="cx">         foreach my $function (@functions) {
</span><span class="cx">             push(@contents, &lt;&lt;EOF);
</span><span class="cx"> 
</span><del>-JSValueRef ${className}::@{[$function-&gt;signature-&gt;name]}(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</del><ins>+JSValueRef ${className}::@{[$function-&gt;name]}(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</ins><span class="cx"> {
</span><span class="cx">     ${implementationClassName}* impl = to${implementationClassName}(context, thisObject);
</span><span class="cx">     if (!impl)
</span><span class="lines">@@ -293,33 +291,33 @@
</span><span class="cx"> 
</span><span class="cx"> EOF
</span><span class="cx">             my $functionCall;
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CustomArgumentHandling&quot;}) {
-                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;signature-&gt;name . &quot;(context, argumentCount, arguments, exception)&quot;;
</del><ins>+            if ($function-&gt;extendedAttributes-&gt;{&quot;CustomArgumentHandling&quot;}) {
+                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;name . &quot;(context, argumentCount, arguments, exception)&quot;;
</ins><span class="cx">             } else {
</span><del>-                my @parameters = ();
-                my @specifiedParameters = @{$function-&gt;parameters};
</del><ins>+                my @arguments = ();
+                my @specifiedArguments = @{$function-&gt;arguments};
</ins><span class="cx"> 
</span><del>-                $self-&gt;_includeHeaders(\%contentsIncludes, $function-&gt;signature-&gt;type, $function-&gt;signature);
</del><ins>+                $self-&gt;_includeHeaders(\%contentsIncludes, $function-&gt;type);
</ins><span class="cx"> 
</span><del>-                if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;PassContext&quot;}) {
-                    push(@parameters, &quot;context&quot;);
</del><ins>+                if ($function-&gt;extendedAttributes-&gt;{&quot;PassContext&quot;}) {
+                    push(@arguments, &quot;context&quot;);
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                foreach my $i (0..$#specifiedParameters) {
-                    my $parameter = $specifiedParameters[$i];
</del><ins>+                foreach my $i (0..$#specifiedArguments) {
+                    my $argument = $specifiedArguments[$i];
</ins><span class="cx"> 
</span><del>-                    $self-&gt;_includeHeaders(\%contentsIncludes, $type, $parameter);
</del><ins>+                    $self-&gt;_includeHeaders(\%contentsIncludes, $type);
</ins><span class="cx"> 
</span><del>-                    push(@contents, &quot;    &quot; . $self-&gt;_platformTypeVariableDeclaration($parameter, $parameter-&gt;name, &quot;arguments[$i]&quot;, &quot;argumentCount &gt; $i&quot;) . &quot;\n&quot;);
</del><ins>+                    push(@contents, &quot;    &quot; . $self-&gt;_platformTypeVariableDeclaration($argument-&gt;type, $argument-&gt;name, &quot;arguments[$i]&quot;, &quot;argumentCount &gt; $i&quot;) . &quot;\n&quot;);
</ins><span class="cx">                     
</span><del>-                    push(@parameters, $self-&gt;_parameterExpression($parameter));
</del><ins>+                    push(@arguments, $self-&gt;_argumentExpression($argument));
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;signature-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @parameters) . &quot;)&quot;;
</del><ins>+                $functionCall = &quot;impl-&gt;&quot; . $function-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;;
</ins><span class="cx">             }
</span><span class="cx">             
</span><del>-            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;signature-&gt;type-&gt;name eq &quot;void&quot;;
-            push(@contents, &quot;    return &quot; . $self-&gt;_returnExpression($function-&gt;signature, $functionCall) . &quot;;\n}\n&quot;);
</del><ins>+            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;type-&gt;name eq &quot;void&quot;;
+            push(@contents, &quot;    return &quot; . $self-&gt;_returnExpression($function-&gt;type, $functionCall) . &quot;;\n}\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -326,7 +324,7 @@
</span><span class="cx">     if (my @attributes = @{$interface-&gt;attributes}) {
</span><span class="cx">         push(@contents, &quot;\n// Attributes\n&quot;);
</span><span class="cx">         foreach my $attribute (@attributes) {
</span><del>-            $self-&gt;_includeHeaders(\%contentsIncludes, $attribute-&gt;signature-&gt;type, $attribute-&gt;signature);
</del><ins>+            $self-&gt;_includeHeaders(\%contentsIncludes, $attribute-&gt;type);
</ins><span class="cx"> 
</span><span class="cx">             my $getterName = $self-&gt;_getterName($attribute);
</span><span class="cx">             my $getterExpression = &quot;impl-&gt;${getterName}()&quot;;
</span><span class="lines">@@ -339,7 +337,7 @@
</span><span class="cx">     if (!impl)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    return @{[$self-&gt;_returnExpression($attribute-&gt;signature, $getterExpression)]};
</del><ins>+    return @{[$self-&gt;_returnExpression($attribute-&gt;type, $getterExpression)]};
</ins><span class="cx"> }
</span><span class="cx"> EOF
</span><span class="cx"> 
</span><span class="lines">@@ -354,7 +352,7 @@
</span><span class="cx"> 
</span><span class="cx"> EOF
</span><span class="cx"> 
</span><del>-                my $platformValue = $self-&gt;_platformTypeConstructor($attribute-&gt;signature, &quot;value&quot;);
</del><ins>+                my $platformValue = $self-&gt;_platformTypeConstructor($attribute-&gt;type, &quot;value&quot;);
</ins><span class="cx"> 
</span><span class="cx">                 push(@contents, &lt;&lt;EOF);
</span><span class="cx">     impl-&gt;@{[$self-&gt;_setterName($attribute)]}(${platformValue});
</span><span class="lines">@@ -383,12 +381,12 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    return $attribute-&gt;signature-&gt;name;
</del><ins>+    return $attribute-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _includeHeaders
</span><span class="cx"> {
</span><del>-    my ($self, $headers, $type, $signature) = @_;
</del><ins>+    my ($self, $headers, $type) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return unless defined $type;
</span><span class="cx">     return if $type-&gt;name eq &quot;boolean&quot;;
</span><span class="lines">@@ -431,7 +429,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub _platformType
</span><span class="cx"> {
</span><del>-    my ($self, $type, $signature) = @_;
</del><ins>+    my ($self, $type) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return undef unless defined $type;
</span><span class="cx"> 
</span><span class="lines">@@ -444,10 +442,8 @@
</span><span class="cx"> 
</span><span class="cx"> sub _platformTypeConstructor
</span><span class="cx"> {
</span><del>-    my ($self, $signature, $argumentName) = @_;
</del><ins>+    my ($self, $type, $argumentName) = @_;
</ins><span class="cx"> 
</span><del>-    my $type = $signature-&gt;type;
-
</del><span class="cx">     return &quot;JSValueToBoolean(context, $argumentName)&quot; if $type-&gt;name eq &quot;boolean&quot;;
</span><span class="cx">     return &quot;$argumentName&quot; if $type-&gt;name eq &quot;object&quot;;
</span><span class="cx">     return &quot;JSRetainPtr&lt;JSStringRef&gt;(Adopt, JSValueToStringCopy(context, $argumentName, 0))&quot; if $$self{codeGenerator}-&gt;IsStringType($type);
</span><span class="lines">@@ -457,10 +453,10 @@
</span><span class="cx"> 
</span><span class="cx"> sub _platformTypeVariableDeclaration
</span><span class="cx"> {
</span><del>-    my ($self, $signature, $variableName, $argumentName, $condition) = @_;
</del><ins>+    my ($self, $type, $variableName, $argumentName, $condition) = @_;
</ins><span class="cx"> 
</span><del>-    my $platformType = $self-&gt;_platformType($signature-&gt;type, $signature);
-    my $constructor = $self-&gt;_platformTypeConstructor($signature, $argumentName);
</del><ins>+    my $platformType = $self-&gt;_platformType($type);
+    my $constructor = $self-&gt;_platformTypeConstructor($type, $argumentName);
</ins><span class="cx"> 
</span><span class="cx">     my %nonPointerTypes = (
</span><span class="cx">         &quot;bool&quot; =&gt; 1,
</span><span class="lines">@@ -485,10 +481,8 @@
</span><span class="cx"> 
</span><span class="cx"> sub _returnExpression
</span><span class="cx"> {
</span><del>-    my ($self, $signature, $expression) = @_;
</del><ins>+    my ($self, $returnType, $expression) = @_;
</ins><span class="cx"> 
</span><del>-    my $returnType = $signature-&gt;type;
-
</del><span class="cx">     return &quot;JSValueMakeUndefined(context)&quot; if $returnType-&gt;name eq &quot;void&quot;;
</span><span class="cx">     return &quot;JSValueMakeBoolean(context, ${expression})&quot; if $returnType-&gt;name eq &quot;boolean&quot;;
</span><span class="cx">     return &quot;${expression}&quot; if $returnType-&gt;name eq &quot;object&quot;;
</span><span class="lines">@@ -497,12 +491,12 @@
</span><span class="cx">     return &quot;toJS(context, WTF::getPtr(${expression}))&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub _parameterExpression
</del><ins>+sub _argumentExpression
</ins><span class="cx"> {
</span><del>-    my ($self, $parameter) = @_;
</del><ins>+    my ($self, $argument) = @_;
</ins><span class="cx"> 
</span><del>-    my $type = $parameter-&gt;type;
-    my $name = $parameter-&gt;name;
</del><ins>+    my $type = $argument-&gt;type;
+    my $name = $argument-&gt;name;
</ins><span class="cx"> 
</span><span class="cx">     return &quot;${name}.get()&quot; if $$self{codeGenerator}-&gt;IsStringType($type);
</span><span class="cx">     return $name;
</span><span class="lines">@@ -512,7 +506,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    my $name = $attribute-&gt;signature-&gt;name;
</del><ins>+    my $name = $attribute-&gt;name;
</ins><span class="cx"> 
</span><span class="cx">     return &quot;set&quot; . $$self{codeGenerator}-&gt;WK_ucfirst($name);
</span><span class="cx"> }
</span><span class="lines">@@ -522,9 +516,9 @@
</span><span class="cx">     my ($self, $interface) = @_;
</span><span class="cx"> 
</span><span class="cx">     my $mapFunction = sub {
</span><del>-        my $name = $_-&gt;signature-&gt;name;
</del><ins>+        my $name = $_-&gt;name;
</ins><span class="cx">         my @attributes = qw(kJSPropertyAttributeDontDelete kJSPropertyAttributeReadOnly);
</span><del>-        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</del><ins>+        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</ins><span class="cx"> 
</span><span class="cx">         return  &quot;{ \&quot;$name\&quot;, $name, &quot; . join(&quot; | &quot;, @attributes) . &quot; }&quot;;
</span><span class="cx">     };
</span><span class="lines">@@ -562,14 +556,14 @@
</span><span class="cx">     my ($self, $interface) = @_;
</span><span class="cx"> 
</span><span class="cx">     my $mapFunction = sub {
</span><del>-        return if $_-&gt;signature-&gt;extendedAttributes-&gt;{&quot;NoImplementation&quot;};
</del><ins>+        return if $_-&gt;extendedAttributes-&gt;{&quot;NoImplementation&quot;};
</ins><span class="cx"> 
</span><del>-        my $attributeName = $_-&gt;signature-&gt;name;
</del><ins>+        my $attributeName = $_-&gt;name;
</ins><span class="cx">         my $getterName = $self-&gt;_getterName($_);
</span><span class="cx">         my $setterName = $_-&gt;isReadOnly ? &quot;0&quot; : $self-&gt;_setterName($_);
</span><span class="cx">         my @attributes = qw(kJSPropertyAttributeDontDelete);
</span><span class="cx">         push(@attributes, &quot;kJSPropertyAttributeReadOnly&quot;) if $_-&gt;isReadOnly;
</span><del>-        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</del><ins>+        push(@attributes, &quot;kJSPropertyAttributeDontEnum&quot;) if $_-&gt;extendedAttributes-&gt;{&quot;DontEnum&quot;};
</ins><span class="cx"> 
</span><span class="cx">         return &quot;{ \&quot;$attributeName\&quot;, $getterName, $setterName, &quot; . join(&quot; | &quot;, @attributes) . &quot; }&quot;;
</span><span class="cx">     };
</span></span></pre>
</div>
</div>

</body>
</html>