<!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>[208023] 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/208023">208023</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-10-27 19:03:05 -0700 (Thu, 27 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
https://bugs.webkit.org/show_bug.cgi?id=164089

Patch by Sam Weinig &lt;sam@webkit.org&gt; on 2016-10-27
Reviewed by Alex Christensen.

Source/WebCore:

Make more IDLParser structures contain domTypes for type descriptions, rather than strings:
- domInterface gains type and parentType.
- domConstant gains type.
- domEnum gains type.
- domDictionary gains type and parentType.

With these structs now containing domTypes, we can update the CodeGenerators to operate on
domTypes exclusively, rather than types as strings. This allows us to consistently have access
to information such as subtypes and nullability.

* bindings/scripts/CodeGenerator.pm:
Update helpers to operate of domTypes. The one exception is SkipIncludeHeader, which
still operates on a type name, since it is called late in code generation on the textual
form of type names in the include list.

* bindings/scripts/CodeGeneratorJS.pm:
Update to use domTypes.

* bindings/scripts/IDLParser.pm:
- Add domType accessors to domInterface, domConstant, domEnum, and domDictionary
  and populate them.
- Remove type accessors from domSignature (domType is accessible from idlType).
- Remove special cases for sequence and FrozenArray, now that they are always
  accessed as domTypes.

* html/HTMLEmbedElement.idl:
* html/HTMLFrameElement.idl:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::getSVGDocument):
* html/HTMLFrameOwnerElement.h:
* html/HTMLIFrameElement.idl:
* html/HTMLObjectElement.idl:
Fix interfaces declaring getSVGDocument() to correctly have it return
a Document, rather than an SVGDocument, which does exist anymore. To
make the bindings happy, also change the signature of HTMLFrameOwnerElement::getSVGDocument
to return a Document.

* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Update test results to remove some redundant headers (Already included JSFoo.h, so no need for Foo.h).

Tools:

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
Update for the removal of domSignature::type, and new signatures of helper predicates.</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="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLEmbedElementidl">trunk/Source/WebCore/html/HTMLEmbedElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFrameElementidl">trunk/Source/WebCore/html/HTMLFrameElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFrameOwnerElementcpp">trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFrameOwnerElementh">trunk/Source/WebCore/html/HTMLFrameOwnerElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLIFrameElementidl">trunk/Source/WebCore/html/HTMLIFrameElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementidl">trunk/Source/WebCore/html/HTMLObjectElement.idl</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 (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/ChangeLog        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2016-10-27  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
+        https://bugs.webkit.org/show_bug.cgi?id=164089
+
+        Reviewed by Alex Christensen.
+
+        Make more IDLParser structures contain domTypes for type descriptions, rather than strings:
+        - domInterface gains type and parentType.
+        - domConstant gains type.
+        - domEnum gains type.
+        - domDictionary gains type and parentType.
+
+        With these structs now containing domTypes, we can update the CodeGenerators to operate on
+        domTypes exclusively, rather than types as strings. This allows us to consistently have access
+        to information such as subtypes and nullability.
+
+        * bindings/scripts/CodeGenerator.pm:
+        Update helpers to operate of domTypes. The one exception is SkipIncludeHeader, which
+        still operates on a type name, since it is called late in code generation on the textual
+        form of type names in the include list. 
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        Update to use domTypes.
+
+        * bindings/scripts/IDLParser.pm:
+        - Add domType accessors to domInterface, domConstant, domEnum, and domDictionary
+          and populate them.
+        - Remove type accessors from domSignature (domType is accessible from idlType).
+        - Remove special cases for sequence and FrozenArray, now that they are always
+          accessed as domTypes.
+
+        * html/HTMLEmbedElement.idl:
+        * html/HTMLFrameElement.idl:
+        * html/HTMLFrameOwnerElement.cpp:
+        (WebCore::HTMLFrameOwnerElement::getSVGDocument):
+        * html/HTMLFrameOwnerElement.h:
+        * html/HTMLIFrameElement.idl:
+        * html/HTMLObjectElement.idl:
+        Fix interfaces declaring getSVGDocument() to correctly have it return
+        a Document, rather than an SVGDocument, which does exist anymore. To
+        make the bindings happy, also change the signature of HTMLFrameOwnerElement::getSVGDocument
+        to return a Document.
+
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        Update test results to remove some redundant headers (Already included JSFoo.h, so no need for Foo.h).
+
</ins><span class="cx"> 2016-10-27  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -273,8 +273,8 @@
</span><span class="cx">         my $outerInterface = shift;
</span><span class="cx">         my $currentInterface = shift;
</span><span class="cx"> 
</span><del>-        for (@{$currentInterface-&gt;parents}) {
-            my $interfaceName = $_;
</del><ins>+        if  ($currentInterface-&gt;parentType) {
+            my $interfaceName = $currentInterface-&gt;parentType-&gt;name;
</ins><span class="cx">             my $parentInterface = $object-&gt;ParseInterface($outerInterface, $interfaceName);
</span><span class="cx"> 
</span><span class="cx">             if ($beforeRecursion) {
</span><span class="lines">@@ -326,12 +326,9 @@
</span><span class="cx">     return $idlFiles-&gt;{$interfaceName};
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GetAttributeFromInterface()
</del><ins>+sub GetAttributeFromInterface
</ins><span class="cx"> {
</span><del>-    my $object = shift;
-    my $outerInterface = shift;
-    my $interfaceName = shift;
-    my $attributeName = shift;
</del><ins>+    my ($object, $outerInterface, $interfaceName, $attributeName) = @_;
</ins><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><span class="lines">@@ -377,19 +374,19 @@
</span><span class="cx"> 
</span><span class="cx"> sub SkipIncludeHeader
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $typeName) = @_;
</ins><span class="cx"> 
</span><span class="cx">     # FIXME: This is a lot like !IsRefPtrType. Maybe they could share code?
</span><span class="cx"> 
</span><del>-    return 1 if $object-&gt;IsPrimitiveType($type);
-    return 1 if $object-&gt;IsTypedArrayType($type);
-    return 1 if $type eq &quot;Array&quot;;
-    return 1 if $type eq &quot;BufferSource&quot;;
-    return 1 if $type eq &quot;DOMString&quot; or $type eq &quot;USVString&quot;;
-    return 1 if $type eq &quot;DOMTimeStamp&quot;;
-    return 1 if $type eq &quot;SVGNumber&quot;;
-    return 1 if $type eq &quot;any&quot;;
</del><ins>+    return 1 if $primitiveTypeHash{$typeName};
+    return 1 if $integerTypeHash{$typeName};
+    return 1 if $floatingPointTypeHash{$typeName};
+    return 1 if $typedArrayTypes{$typeName};
+    return 1 if $typeName eq &quot;DOMString&quot;;
+    return 1 if $typeName eq &quot;USVString&quot;;
+    return 1 if $typeName eq &quot;BufferSource&quot;;
+    return 1 if $typeName eq &quot;SVGNumber&quot;;
+    return 1 if $typeName eq &quot;any&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -398,8 +395,10 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if $integerTypeHash{$type};
-    return 1 if $floatingPointTypeHash{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $integerTypeHash{$type-&gt;name};
+    return 1 if $floatingPointTypeHash{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -407,7 +406,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx">     
</span><del>-    return 1 if $type eq &quot;DOMString&quot; or $type eq &quot;USVString&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $object-&gt;IsStringType($type);
</ins><span class="cx">     return 1 if $object-&gt;IsEnumType($type);
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -416,7 +417,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if $integerTypeHash{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $integerTypeHash{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -424,7 +427,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if $floatingPointTypeHash{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $floatingPointTypeHash{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -432,7 +437,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if $primitiveTypeHash{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $primitiveTypeHash{$type-&gt;name};
</ins><span class="cx">     return 1 if $object-&gt;IsNumericType($type);
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -442,8 +449,10 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if $type eq &quot;DOMString&quot;;
-    return 1 if $type eq &quot;USVString&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $type-&gt;name eq &quot;DOMString&quot;;
+    return 1 if $type-&gt;name eq &quot;USVString&quot;;
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -451,13 +460,19 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return defined($object-&gt;GetEnumByName($type));
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return defined($object-&gt;GetEnumByType($type));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GetEnumByName
</del><ins>+sub GetEnumByType
</ins><span class="cx"> {
</span><del>-    my ($object, $name) = @_;
-    
</del><ins>+    my ($object, $type) = @_;
+
+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    my $name = $type-&gt;name;
+
</ins><span class="cx">     die &quot;GetEnumByName() was called with an undefined enumeration name&quot; unless defined($name);
</span><span class="cx"> 
</span><span class="cx">     for my $enumeration (@{$useDocument-&gt;enumerations}) {
</span><span class="lines">@@ -494,17 +509,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $object-&gt;IsEnumType($type) &amp;&amp; defined($cachedExternalEnumerations-&gt;{$type});
-}
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</ins><span class="cx"> 
</span><del>-sub ValidEnumValues
-{
-    my ($object, $type) = @_;
-
-    my $enumeration = $object-&gt;GetEnumByName($type);
-    die &quot;ValidEnumValues() was with a type that is not an enumeration: &quot; . $type unless defined($enumeration);
-
-    return $enumeration-&gt;values;
</del><ins>+    return $object-&gt;IsEnumType($type) &amp;&amp; defined($cachedExternalEnumerations-&gt;{$type-&gt;name});
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub HasEnumImplementationNameOverride
</span><span class="lines">@@ -511,7 +518,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if exists $enumTypeImplementationNameOverrides{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if exists $enumTypeImplementationNameOverrides{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -519,14 +528,21 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $enumTypeImplementationNameOverrides{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $enumTypeImplementationNameOverrides{$type-&gt;name};
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GetDictionaryByName
</del><ins>+sub GetDictionaryByType
</ins><span class="cx"> {
</span><del>-    my ($object, $name) = @_;
-    die &quot;GetDictionaryByName() was called with an undefined dictionary name&quot; unless defined($name);
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    my $name = $type-&gt;name;
+
+    die &quot;GetDictionaryByType() was called with an undefined dictionary name&quot; unless defined($name);
+
</ins><span class="cx">     for my $dictionary (@{$useDocument-&gt;dictionaries}) {
</span><span class="cx">         return $dictionary if $dictionary-&gt;name eq $name;
</span><span class="cx">     }
</span><span class="lines">@@ -560,7 +576,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $type =~ /^[A-Z]/ &amp;&amp; defined($object-&gt;GetDictionaryByName($type));
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $type-&gt;name =~ /^[A-Z]/ &amp;&amp; defined($object-&gt;GetDictionaryByType($type));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # A dictionary defined in its own IDL file.
</span><span class="lines">@@ -568,7 +586,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $object-&gt;IsDictionaryType($type) &amp;&amp; defined($cachedExternalDictionaries-&gt;{$type});
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $object-&gt;IsDictionaryType($type) &amp;&amp; defined($cachedExternalDictionaries-&gt;{$type-&gt;name});
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub HasDictionaryImplementationNameOverride
</span><span class="lines">@@ -575,7 +595,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if exists $dictionaryTypeImplementationNameOverrides{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if exists $dictionaryTypeImplementationNameOverrides{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -583,7 +605,9 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $dictionaryTypeImplementationNameOverrides{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $dictionaryTypeImplementationNameOverrides{$type-&gt;name};
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsNonPointerType
</span><span class="lines">@@ -590,68 +614,76 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return 1 if $nonPointerTypeHash{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $nonPointerTypeHash{$type-&gt;name};
</ins><span class="cx">     return 1 if $object-&gt;IsPrimitiveType($type);
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub IsSVGTypeNeedingTearOff
</del><ins>+sub IsSVGTypeNeedingTearOffForType
</ins><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return 1 if exists $svgTypeNeedingTearOff{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if exists $svgTypeNeedingTearOff{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub IsSVGTypeWithWritablePropertiesNeedingTearOff
</del><ins>+sub IsSVGTypeWithWritablePropertiesNeedingTearOffForType
</ins><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return 1 if $svgTypeWithWritablePropertiesNeedingTearOff{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $svgTypeWithWritablePropertiesNeedingTearOff{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsTypedArrayType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return 1 if $typedArrayTypes{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return 1 if $typedArrayTypes{$type-&gt;name};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsRefPtrType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
</ins><span class="cx">     return 0 if $object-&gt;IsPrimitiveType($type);
</span><span class="cx">     return 0 if $object-&gt;IsDictionaryType($type);
</span><span class="cx">     return 0 if $object-&gt;IsEnumType($type);
</span><span class="cx">     return 0 if $object-&gt;IsSequenceOrFrozenArrayType($type);
</span><del>-    return 0 if $type eq &quot;DOMString&quot; or $type eq &quot;USVString&quot;;
-    return 0 if $type eq &quot;any&quot;;
</del><ins>+    return 0 if $object-&gt;IsStringType($type);
+    return 0 if $type-&gt;name eq &quot;any&quot;;
</ins><span class="cx"> 
</span><span class="cx">     return 1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GetSVGTypeNeedingTearOff
</del><ins>+sub GetSVGTypeNeedingTearOffForType
</ins><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return $svgTypeNeedingTearOff{$type} if exists $svgTypeNeedingTearOff{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $svgTypeNeedingTearOff{$type-&gt;name} if exists $svgTypeNeedingTearOff{$type-&gt;name};
</ins><span class="cx">     return undef;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GetSVGWrappedTypeNeedingTearOff
</del><ins>+sub GetSVGWrappedTypeNeedingTearOffForType
</ins><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    my $svgTypeNeedingTearOff = $object-&gt;GetSVGTypeNeedingTearOff($type);
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    my $svgTypeNeedingTearOff = $object-&gt;GetSVGTypeNeedingTearOffForType($type);
</ins><span class="cx">     return $svgTypeNeedingTearOff if not $svgTypeNeedingTearOff;
</span><span class="cx"> 
</span><span class="cx">     if ($svgTypeNeedingTearOff =~ /SVGPropertyTearOff/) {
</span><span class="lines">@@ -668,64 +700,84 @@
</span><span class="cx">     return $svgTypeNeedingTearOff;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsSVGAnimatedTypeName
+{
+    my ($object, $typeName) = @_;
+
+    return $typeName =~ /^SVGAnimated/;
+}
+
</ins><span class="cx"> sub IsSVGAnimatedType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return $type =~ /^SVGAnimated/;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $object-&gt;IsSVGAnimatedTypeName($type-&gt;name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsConstructorType
+{
+    my ($object, $type) = @_;
+
+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $type-&gt;name =~ /Constructor$/;
+}
+
</ins><span class="cx"> sub IsSequenceType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return $type =~ /^sequence&lt;/;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $type-&gt;name eq &quot;sequence&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetSequenceInnerType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return $1 if $type =~ /^sequence&lt;([\w\d_\s]+)&gt;.*/;
-    return &quot;&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return @{$type-&gt;subtypes}[0];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsFrozenArrayType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return $type =~ /^FrozenArray&lt;/;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    # FIXME: Update parser to make this just 'FrozenArray'
+    return $type-&gt;name eq &quot;FrozenArray&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetFrozenArrayInnerType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return $1 if $type =~ /^FrozenArray&lt;([\w\d_\s]+)&gt;.*/;
-    return &quot;&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return @{$type-&gt;subtypes}[0];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsSequenceOrFrozenArrayType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
</ins><span class="cx">     return $object-&gt;IsSequenceType($type) || $object-&gt;IsFrozenArrayType($type);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetSequenceOrFrozenArrayInnerType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return $object-&gt;GetSequenceInnerType($type) if $object-&gt;IsSequenceType($type);
-    return $object-&gt;GetFrozenArrayInnerType($type) if $object-&gt;IsFrozenArrayType($type);
-    return &quot;&quot;;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return @{$type-&gt;subtypes}[0];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # These match WK_lcfirst and WK_ucfirst defined in builtins_generator.py.
</span><span class="lines">@@ -734,6 +786,7 @@
</span><span class="cx"> sub WK_ucfirst
</span><span class="cx"> {
</span><span class="cx">     my ($object, $param) = @_;
</span><ins>+
</ins><span class="cx">     my $ret = ucfirst($param);
</span><span class="cx">     $ret =~ s/Xml/XML/ if $ret =~ /^Xml[^a-z]/;
</span><span class="cx">     $ret =~ s/Svg/SVG/ if $ret =~ /^Svg/;
</span><span class="lines">@@ -746,6 +799,7 @@
</span><span class="cx"> sub WK_lcfirst
</span><span class="cx"> {
</span><span class="cx">     my ($object, $param) = @_;
</span><ins>+
</ins><span class="cx">     my $ret = lcfirst($param);
</span><span class="cx">     $ret =~ s/dOM/dom/ if $ret =~ /^dOM/;
</span><span class="cx">     $ret =~ s/hTML/html/ if $ret =~ /^hTML/;
</span><span class="lines">@@ -764,7 +818,8 @@
</span><span class="cx">     return $ret;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub slurp {
</del><ins>+sub slurp
+{
</ins><span class="cx">     my $file = shift;
</span><span class="cx"> 
</span><span class="cx">     open my $fh, '&lt;', $file or die;
</span><span class="lines">@@ -777,6 +832,7 @@
</span><span class="cx"> sub trim
</span><span class="cx"> {
</span><span class="cx">     my $string = shift;
</span><ins>+
</ins><span class="cx">     $string =~ s/^\s+|\s+$//g;
</span><span class="cx">     return $string;
</span><span class="cx"> }
</span><span class="lines">@@ -785,6 +841,7 @@
</span><span class="cx"> sub NamespaceForAttributeName
</span><span class="cx"> {
</span><span class="cx">     my ($object, $interfaceName, $attributeName) = @_;
</span><ins>+
</ins><span class="cx">     return &quot;SVGNames&quot; if $interfaceName =~ /^SVG/ &amp;&amp; !$svgAttributesInHTMLHash{$attributeName};
</span><span class="cx">     return &quot;HTMLNames&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -820,7 +877,7 @@
</span><span class="cx">     if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;}) {
</span><span class="cx">         $attributeName = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;};
</span><span class="cx">     }
</span><del>-    my $attributeType = $attribute-&gt;signature-&gt;type;
</del><ins>+    my $attributeType = $attribute-&gt;signature-&gt;idlType;
</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">@@ -854,16 +911,16 @@
</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;signature-&gt;idlType;
</ins><span class="cx"> 
</span><span class="cx">     my $functionName;
</span><span class="cx">     if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;URL&quot;}) {
</span><span class="cx">         $functionName = &quot;getURLAttribute&quot;;
</span><del>-    } elsif ($attributeType eq &quot;boolean&quot;) {
</del><ins>+    } elsif ($attributeType-&gt;name eq &quot;boolean&quot;) {
</ins><span class="cx">         $functionName = &quot;hasAttributeWithoutSynchronization&quot;;
</span><del>-    } elsif ($attributeType eq &quot;long&quot;) {
</del><ins>+    } elsif ($attributeType-&gt;name eq &quot;long&quot;) {
</ins><span class="cx">         $functionName = &quot;getIntegralAttribute&quot;;
</span><del>-    } elsif ($attributeType eq &quot;unsigned long&quot;) {
</del><ins>+    } elsif ($attributeType-&gt;name eq &quot;unsigned long&quot;) {
</ins><span class="cx">         $functionName = &quot;getUnsignedIntegralAttribute&quot;;
</span><span class="cx">     } else {
</span><span class="cx">         if ($contentAttributeName eq &quot;WebCore::HTMLNames::idAttr&quot;) {
</span><span class="lines">@@ -892,14 +949,14 @@
</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;signature-&gt;idlType;
</ins><span class="cx"> 
</span><span class="cx">     my $functionName;
</span><del>-    if ($attributeType eq &quot;boolean&quot;) {
</del><ins>+    if ($attributeType-&gt;name eq &quot;boolean&quot;) {
</ins><span class="cx">         $functionName = &quot;setBooleanAttribute&quot;;
</span><del>-    } elsif ($attributeType eq &quot;long&quot;) {
</del><ins>+    } elsif ($attributeType-&gt;name eq &quot;long&quot;) {
</ins><span class="cx">         $functionName = &quot;setIntegralAttribute&quot;;
</span><del>-    } elsif ($attributeType eq &quot;unsigned long&quot;) {
</del><ins>+    } elsif ($attributeType-&gt;name eq &quot;unsigned long&quot;) {
</ins><span class="cx">         $functionName = &quot;setUnsignedIntegralAttribute&quot;;
</span><span class="cx">     } elsif ($generator-&gt;IsSVGAnimatedType($attributeType)) {
</span><span class="cx">         $functionName = &quot;setAttribute&quot;;
</span><span class="lines">@@ -912,25 +969,25 @@
</span><span class="cx"> 
</span><span class="cx"> sub IsWrapperType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
</ins><span class="cx">     return 0 if !$object-&gt;IsRefPtrType($type);
</span><span class="cx">     return 0 if $object-&gt;IsTypedArrayType($type);
</span><del>-    return 0 if $type eq &quot;BufferSource&quot;;
-    return 0 if $type eq &quot;UNION&quot;;
-    return 0 if $webCoreTypeHash{$type};
</del><ins>+    return 0 if $type-&gt;name eq &quot;BufferSource&quot;;
+    return 0 if $type-&gt;name eq &quot;UNION&quot;;
+    return 0 if $webCoreTypeHash{$type-&gt;name};
</ins><span class="cx"> 
</span><span class="cx">     return 1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub getInterfaceExtendedAttributesFromName
</del><ins>+sub GetInterfaceExtendedAttributesFromName
</ins><span class="cx"> {
</span><span class="cx">     # FIXME: It's bad to have a function like this that opens another IDL file to answer a question.
</span><span class="cx">     # Overusing this kind of function can make things really slow. Lets avoid these if we can.
</span><span class="cx"> 
</span><del>-    my $object = shift;
-    my $interfaceName = shift;
</del><ins>+    my ($object, $interfaceName) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $idlFile = $object-&gt;IDLFileForInterface($interfaceName) or assert(&quot;Could NOT find IDL file for interface \&quot;$interfaceName\&quot;!\n&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -959,19 +1016,21 @@
</span><span class="cx"> 
</span><span class="cx"> sub ComputeIsCallbackInterface
</span><span class="cx"> {
</span><del>-  my $object = shift;
-  my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-  return 0 unless $object-&gt;IsWrapperType($type);
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</ins><span class="cx"> 
</span><del>-  my $idlFile = $object-&gt;IDLFileForInterface($type) or assert(&quot;Could NOT find IDL file for interface \&quot;$type\&quot;!\n&quot;);
</del><ins>+    return 0 unless $object-&gt;IsWrapperType($type);
</ins><span class="cx"> 
</span><del>-  open FILE, &quot;&lt;&quot;, $idlFile or die;
-  my @lines = &lt;FILE&gt;;
-  close FILE;
</del><ins>+    my $typeName = $type-&gt;name;
+    my $idlFile = $object-&gt;IDLFileForInterface($typeName) or assert(&quot;Could NOT find IDL file for interface \&quot;$typeName\&quot;!\n&quot;);
</ins><span class="cx"> 
</span><del>-  my $fileContents = join('', @lines);
-  return ($fileContents =~ /callback\s+interface\s+(\w+)/gs);
</del><ins>+    open FILE, &quot;&lt;&quot;, $idlFile or die;
+    my @lines = &lt;FILE&gt;;
+    close FILE;
+
+    my $fileContents = join('', @lines);
+    return ($fileContents =~ /callback\s+interface\s+(\w+)/gs);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> my %isCallbackInterface = ();
</span><span class="lines">@@ -984,9 +1043,11 @@
</span><span class="cx"> 
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $isCallbackInterface{$type} if exists $isCallbackInterface{$type};
-    my $result = ComputeIsCallbackInterface($object, $type);
-    $isCallbackInterface{$type} = $result;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $isCallbackInterface{$type-&gt;name} if exists $isCallbackInterface{$type-&gt;name};
+    my $result = $object-&gt;ComputeIsCallbackInterface($type);
+    $isCallbackInterface{$type-&gt;name} = $result;
</ins><span class="cx">     return $result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -995,32 +1056,34 @@
</span><span class="cx"> # https://heycam.github.io/webidl/#idl-callback-functions
</span><span class="cx"> sub ComputeIsFunctionOnlyCallbackInterface
</span><span class="cx"> {
</span><del>-  my $object = shift;
-  my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-  return 0 unless $object-&gt;IsCallbackInterface($type);
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</ins><span class="cx"> 
</span><del>-  my $idlFile = $object-&gt;IDLFileForInterface($type) or assert(&quot;Could NOT find IDL file for interface \&quot;$type\&quot;!\n&quot;);
</del><ins>+    return 0 unless $object-&gt;IsCallbackInterface($type);
</ins><span class="cx"> 
</span><del>-  open FILE, &quot;&lt;&quot;, $idlFile or die;
-  my @lines = &lt;FILE&gt;;
-  close FILE;
</del><ins>+    my $typeName = $type-&gt;name;
+    my $idlFile = $object-&gt;IDLFileForInterface($typeName) or assert(&quot;Could NOT find IDL file for interface \&quot;$typeName\&quot;!\n&quot;);
</ins><span class="cx"> 
</span><del>-  my $fileContents = join('', @lines);
-  if ($fileContents =~ /\[(.*)\]\s+callback\s+interface\s+(\w+)/gs) {
-      my @parts = split(',', $1);
-      foreach my $part (@parts) {
-          my @keyValue = split('=', $part);
-          my $key = trim($keyValue[0]);
-          next unless length($key);
-          my $value = &quot;VALUE_IS_MISSING&quot;;
-          $value = trim($keyValue[1]) if @keyValue &gt; 1;
</del><ins>+    open FILE, &quot;&lt;&quot;, $idlFile or die;
+    my @lines = &lt;FILE&gt;;
+    close FILE;
</ins><span class="cx"> 
</span><del>-          return 1 if ($key eq &quot;Callback&quot; &amp;&amp; $value eq &quot;FunctionOnly&quot;);
-      }
-  }
</del><ins>+    my $fileContents = join('', @lines);
+    if ($fileContents =~ /\[(.*)\]\s+callback\s+interface\s+(\w+)/gs) {
+        my @parts = split(',', $1);
+        foreach my $part (@parts) {
+            my @keyValue = split('=', $part);
+            my $key = trim($keyValue[0]);
+            next unless length($key);
+            my $value = &quot;VALUE_IS_MISSING&quot;;
+            $value = trim($keyValue[1]) if @keyValue &gt; 1;
</ins><span class="cx"> 
</span><del>-  return 0;
</del><ins>+            return 1 if ($key eq &quot;Callback&quot; &amp;&amp; $value eq &quot;FunctionOnly&quot;);
+        }
+    }
+
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> my %isFunctionOnlyCallbackInterface = ();
</span><span class="lines">@@ -1033,16 +1096,17 @@
</span><span class="cx"> 
</span><span class="cx">     my ($object, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $isFunctionOnlyCallbackInterface{$type} if exists $isFunctionOnlyCallbackInterface{$type};
-    my $result = ComputeIsFunctionOnlyCallbackInterface($object, $type);
-    $isFunctionOnlyCallbackInterface{$type} = $result;
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    return $isFunctionOnlyCallbackInterface{$type-&gt;name} if exists $isFunctionOnlyCallbackInterface{$type-&gt;name};
+    my $result = $object-&gt;ComputeIsFunctionOnlyCallbackInterface($type);
+    $isFunctionOnlyCallbackInterface{$type-&gt;name} = $result;
</ins><span class="cx">     return $result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateConditionalString
</span><span class="cx"> {
</span><del>-    my $generator = shift;
-    my $node = shift;
</del><ins>+    my ($generator, $node) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $conditional = $node-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;};
</span><span class="cx">     if ($conditional) {
</span><span class="lines">@@ -1054,8 +1118,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GenerateConditionalStringFromAttributeValue
</span><span class="cx"> {
</span><del>-    my $generator = shift;
-    my $conditional = shift;
</del><ins>+    my ($generator, $conditional) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my %disjunction;
</span><span class="cx">     map {
</span><span class="lines">@@ -1114,8 +1177,8 @@
</span><span class="cx"> # should use the real interface name in the IDL files and then use ImplementedAs to map this to the implementation name.
</span><span class="cx"> sub GetVisibleInterfaceName
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $interface = shift;
</del><ins>+    my ($object, $interface) = @_;
+
</ins><span class="cx">     my $interfaceName = $interface-&gt;extendedAttributes-&gt;{&quot;InterfaceName&quot;};
</span><span class="cx">     return $interfaceName ? $interfaceName : $interface-&gt;name;
</span><span class="cx"> }
</span><span class="lines">@@ -1122,12 +1185,11 @@
</span><span class="cx"> 
</span><span class="cx"> sub InheritsInterface
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $interface = shift;
-    my $interfaceName = shift;
-    my $found = 0;
</del><ins>+    my ($object, $interface, $interfaceName) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $interfaceName eq $interface-&gt;name;
</span><ins>+
+    my $found = 0;
</ins><span class="cx">     $object-&gt;ForAllParents($interface, sub {
</span><span class="cx">         my $currentInterface = shift;
</span><span class="cx">         if ($currentInterface-&gt;name eq $interfaceName) {
</span><span class="lines">@@ -1141,12 +1203,11 @@
</span><span class="cx"> 
</span><span class="cx"> sub InheritsExtendedAttribute
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $interface = shift;
-    my $extendedAttribute = shift;
-    my $found = 0;
</del><ins>+    my ($object, $interface, $extendedAttribute) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $interface-&gt;extendedAttributes-&gt;{$extendedAttribute};
</span><ins>+
+    my $found = 0;
</ins><span class="cx">     $object-&gt;ForAllParents($interface, sub {
</span><span class="cx">         my $currentInterface = shift;
</span><span class="cx">         if ($currentInterface-&gt;extendedAttributes-&gt;{$extendedAttribute}) {
</span><span class="lines">@@ -1160,14 +1221,12 @@
</span><span class="cx"> 
</span><span class="cx"> sub ShouldPassWrapperByReference
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $parameter = shift;
-    my $interface = shift;
</del><ins>+    my ($object, $parameter, $interface) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return 0 if $parameter-&gt;isVariadic;
</span><span class="cx">     return 0 if $parameter-&gt;isNullable;
</span><del>-    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 !$object-&gt;IsWrapperType($parameter-&gt;idlType) &amp;&amp; !$object-&gt;IsTypedArrayType($parameter-&gt;idlType);
+    return 0 if $object-&gt;IsSVGTypeNeedingTearOffForType($parameter-&gt;idlType);
</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 (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $enumeration) = @_;
</span><span class="cx"> 
</span><del>-    my $className = GetEnumerationClassName($enumeration-&gt;name);
</del><ins>+    my $className = GetEnumerationClassName($enumeration-&gt;type);
</ins><span class="cx">     $object-&gt;GenerateEnumerationHeader($enumeration, $className);
</span><span class="cx">     $object-&gt;GenerateEnumerationImplementation($enumeration, $className);
</span><span class="cx"> }
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $dictionary, $enumerations) = @_;
</span><span class="cx"> 
</span><del>-    my $className = GetDictionaryClassName($dictionary-&gt;name);
</del><ins>+    my $className = GetDictionaryClassName($dictionary-&gt;type);
</ins><span class="cx">     $object-&gt;GenerateDictionaryHeader($dictionary, $className, $enumerations);
</span><span class="cx">     $object-&gt;GenerateDictionaryImplementation($dictionary, $className, $enumerations);
</span><span class="cx"> }
</span><span class="lines">@@ -179,14 +179,13 @@
</span><span class="cx">         $extendedAttributeList-&gt;{ImplementedAs} = $attribute-&gt;signature-&gt;name;
</span><span class="cx">         $stringifier-&gt;signature-&gt;extendedAttributes($extendedAttributeList);
</span><span class="cx">         $stringifier-&gt;signature-&gt;name(&quot;toString&quot;);
</span><del>-        die &quot;stringifier can only be used on attributes of String types&quot; unless $codeGenerator-&gt;IsStringType($attribute-&gt;signature-&gt;type);
</del><ins>+        die &quot;stringifier can only be used on attributes of String types&quot; unless $codeGenerator-&gt;IsStringType($attribute-&gt;signature-&gt;idlType);
</ins><span class="cx">         
</span><span class="cx">         # FIXME: This should use IDLParser's cloneType.
</span><span class="cx">         my $type = domType-&gt;new();
</span><del>-        $type-&gt;name($attribute-&gt;signature-&gt;type);
</del><ins>+        $type-&gt;name($attribute-&gt;signature-&gt;idlType-&gt;name);
</ins><span class="cx"> 
</span><span class="cx">         $stringifier-&gt;signature-&gt;idlType($type);
</span><del>-        $stringifier-&gt;signature-&gt;type($type-&gt;name);
</del><span class="cx"> 
</span><span class="cx">         push(@{$interface-&gt;functions}, $stringifier);
</span><span class="cx">         last;
</span><span class="lines">@@ -210,7 +209,7 @@
</span><span class="cx"> 
</span><span class="cx">     return $interface-&gt;extendedAttributes-&gt;{JSLegacyParent} if $interface-&gt;extendedAttributes-&gt;{JSLegacyParent};
</span><span class="cx">     return &quot;JSDOMObject&quot; unless NeedsImplementationClass($interface);
</span><del>-    return &quot;JSDOMWrapper&lt;&quot; . GetImplClassName($interface-&gt;name) . &quot;&gt;&quot; unless $interface-&gt;parent;
</del><ins>+    return &quot;JSDOMWrapper&lt;&quot; . GetImplClassName($interface) . &quot;&gt;&quot; unless $interface-&gt;parent;
</ins><span class="cx">     return &quot;JS&quot; . $interface-&gt;parent;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -228,52 +227,35 @@
</span><span class="cx">     return $callbackInterface-&gt;extendedAttributes-&gt;{IsWeakCallback} ? &quot;JSCallbackDataWeak&quot; : &quot;JSCallbackDataStrong&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub AddIncludesForTypeInImpl
</del><ins>+sub GetExportMacroForJSClass
</ins><span class="cx"> {
</span><del>-    my $type = shift;
-    my $isCallback = @_ ? shift : 0;
-    
-    AddIncludesForType($type, $isCallback, \%implIncludes);
</del><ins>+    my $interface = shift;
+
+    return $interface-&gt;extendedAttributes-&gt;{ExportMacro} . &quot; &quot; if $interface-&gt;extendedAttributes-&gt;{ExportMacro};
+    return &quot;&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub AddIncludesForTypeInHeader
</del><ins>+sub AddIncludesForImplementationTypeInImpl
</ins><span class="cx"> {
</span><del>-    my $type = shift;
-    my $isCallback = @_ ? shift : 0;
</del><ins>+    my $implementationType = shift;
</ins><span class="cx">     
</span><del>-    AddIncludesForType($type, $isCallback, \%headerIncludes);
</del><ins>+    AddIncludesForImplementationType($implementationType, \%implIncludes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GetExportMacroForJSClass
</del><ins>+sub AddIncludesForImplementationTypeInHeader
</ins><span class="cx"> {
</span><del>-    my $interface = shift;
-
-    return $interface-&gt;extendedAttributes-&gt;{ExportMacro} . &quot; &quot; if $interface-&gt;extendedAttributes-&gt;{ExportMacro};
-    return &quot;&quot;;
</del><ins>+    my $implementationType = shift;
+    
+    AddIncludesForImplementationType($implementationType, \%headerIncludes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub AddIncludesForType
</del><ins>+sub AddIncludesForImplementationType
</ins><span class="cx"> {
</span><del>-    my $type = shift;
-    my $isCallback = shift;
-    my $includesRef = shift;
</del><ins>+    my ($implementationType, $includesRef) = @_;
</ins><span class="cx"> 
</span><del>-    return if $codeGenerator-&gt;SkipIncludeHeader($type);
-    
-    # When we're finished with the one-file-per-class reorganization, we won't need these special cases.
-    if ($isCallback &amp;&amp; $codeGenerator-&gt;IsWrapperType($type)) {
-        $includesRef-&gt;{&quot;JS${type}.h&quot;} = 1;
-    } elsif ($codeGenerator-&gt;IsSequenceOrFrozenArrayType($type)) {
-        my $innerType = $codeGenerator-&gt;GetSequenceOrFrozenArrayInnerType($type);
-        if ($codeGenerator-&gt;IsRefPtrType($innerType)) {
-            $includesRef-&gt;{&quot;JS${innerType}.h&quot;} = 1;
-            $includesRef-&gt;{&quot;${innerType}.h&quot;} = 1;
-        }
-        $includesRef-&gt;{&quot;&lt;runtime/JSArray.h&gt;&quot;} = 1;
-    } else {
-        # default, include the same named file
-        $includesRef-&gt;{&quot;${type}.h&quot;} = 1;
-    }
</del><ins>+    return if $codeGenerator-&gt;SkipIncludeHeader($implementationType);
+
+    $includesRef-&gt;{&quot;${implementationType}.h&quot;} = 1;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub AddToImplIncludesForIDLType
</span><span class="lines">@@ -292,20 +274,16 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ($codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType-&gt;name)) {
</del><ins>+    if ($codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType)) {
+        AddToImplIncludes(&quot;&lt;runtime/JSArray.h&gt;&quot;, $conditional);
</ins><span class="cx">         AddToImplIncludesForIDLType(@{$idlType-&gt;subtypes}[0], $conditional);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ($codeGenerator-&gt;IsExternalDictionaryType($idlType-&gt;name) || $codeGenerator-&gt;IsExternalEnumType($idlType-&gt;name)) {
</del><ins>+    if ($codeGenerator-&gt;IsWrapperType($idlType) || $codeGenerator-&gt;IsExternalDictionaryType($idlType) || $codeGenerator-&gt;IsExternalEnumType($idlType)) {
</ins><span class="cx">         AddToImplIncludes(&quot;JS&quot; . $idlType-&gt;name . &quot;.h&quot;, $conditional);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-
-    if ($codeGenerator-&gt;IsWrapperType($idlType-&gt;name)) {
-        AddToImplIncludes(&quot;JS&quot; . $idlType-&gt;name . &quot;.h&quot;, $conditional);
-        return;
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub AddToImplIncludes
</span><span class="lines">@@ -331,15 +309,14 @@
</span><span class="cx"> 
</span><span class="cx"> sub AddClassForwardIfNeeded
</span><span class="cx"> {
</span><del>-    my $interfaceName = shift;
</del><ins>+    my $type = shift;
</ins><span class="cx"> 
</span><span class="cx">     # SVGAnimatedLength/Number/etc. are not classes so they can't be forward declared as classes.
</span><del>-    return if $codeGenerator-&gt;IsSVGAnimatedType($interfaceName);
</del><ins>+    return if $codeGenerator-&gt;IsSVGAnimatedType($type);
+    return if $codeGenerator-&gt;IsTypedArrayType($type);
+    return if $type-&gt;name eq &quot;BufferSource&quot;;
</ins><span class="cx"> 
</span><del>-    return if $codeGenerator-&gt;IsTypedArrayType($interfaceName);
-    return if $interfaceName eq &quot;BufferSource&quot;;
-
-    push(@headerContent, &quot;class $interfaceName;\n\n&quot;);
</del><ins>+    push(@headerContent, &quot;class &quot; . $type-&gt;name . &quot;;\n\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetGenerateIsReachable
</span><span class="lines">@@ -399,7 +376,9 @@
</span><span class="cx"> 
</span><span class="cx">         # If the item function returns a string then we let the TreatReturnedNullStringAs handle the cases
</span><span class="cx">         # where the index is out of range.
</span><del>-        if ($indexedGetterFunction-&gt;signature-&gt;type eq &quot;DOMString&quot;) {
</del><ins>+        
+        # FIXME: Should this work for all string types?
+        if ($indexedGetterFunction-&gt;signature-&gt;idlType-&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">@@ -556,7 +535,7 @@
</span><span class="cx"> 
</span><span class="cx">     return $codeGenerator-&gt;WK_lcfirst($className) . &quot;Constructor&quot; . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) if $attribute-&gt;isStatic;
</span><span class="cx">     return GetJSBuiltinFunctionName($className, $attribute) if IsJSBuiltin($interface, $attribute);
</span><del>-    return &quot;js&quot; . $interface-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) . ($attribute-&gt;signature-&gt;type =~ /Constructor$/ ? &quot;Constructor&quot; : &quot;&quot;);
</del><ins>+    return &quot;js&quot; . $interface-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) . ($codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;idlType) ? &quot;Constructor&quot; : &quot;&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetAttributeSetterName
</span><span class="lines">@@ -565,7 +544,7 @@
</span><span class="cx"> 
</span><span class="cx">     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;
</span><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;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) . ($attribute-&gt;signature-&gt;type =~ /Constructor$/ ? &quot;Constructor&quot; : &quot;&quot;);
</del><ins>+    return &quot;setJS&quot; . $interface-&gt;name . $codeGenerator-&gt;WK_ucfirst($attribute-&gt;signature-&gt;name) . ($codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;idlType) ? &quot;Constructor&quot; : &quot;&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetFunctionName
</span><span class="lines">@@ -592,7 +571,7 @@
</span><span class="cx">         my $specials = $function-&gt;signature-&gt;specials;
</span><span class="cx">         my $specialExists = grep { $_ eq $special } @$specials;
</span><span class="cx">         my $parameters = $function-&gt;parameters;
</span><del>-        if ($specialExists and scalar(@$parameters) == $numberOfParameters and $parameters-&gt;[0]-&gt;type eq $firstParameterType) {
</del><ins>+        if ($specialExists and scalar(@$parameters) == $numberOfParameters and $parameters-&gt;[0]-&gt;idlType-&gt;name eq $firstParameterType) {
</ins><span class="cx">             return $function;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -635,7 +614,7 @@
</span><span class="cx">     return 0 if $attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledAtRuntime} &amp;&amp; !IsDOMGlobalObject($interface);
</span><span class="cx"> 
</span><span class="cx">     return 1 if InterfaceRequiresAttributesOnInstance($interface);
</span><del>-    return 1 if $attribute-&gt;signature-&gt;type =~ /Constructor$/;
</del><ins>+    return 1 if $codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;idlType);
</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">@@ -677,7 +656,7 @@
</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 $is_global_constructor = $attribute-&gt;signature-&gt;type =~ /Constructor$/;
</del><ins>+    my $is_global_constructor = $attribute-&gt;signature-&gt;idlType-&gt;name =~ /Constructor$/;
</ins><span class="cx">     push(@specials, &quot;DontEnum&quot;) if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{NotEnumerable} || $is_global_constructor);
</span><span class="cx">     push(@specials, &quot;ReadOnly&quot;) if IsReadonly($attribute);
</span><span class="cx">     push(@specials, &quot;CustomAccessor&quot;) unless $is_global_constructor or IsJSBuiltin($interface, $attribute);
</span><span class="lines">@@ -798,12 +777,12 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetImplClassName
</span><span class="cx"> {
</span><del>-    my $name = shift;
</del><ins>+    my $interface = shift;
</ins><span class="cx"> 
</span><del>-    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($name);
</del><ins>+    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interface);
</ins><span class="cx">     return $svgNativeType if $svgNativeType;
</span><span class="cx"> 
</span><del>-    return $name;
</del><ins>+    return $interface-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsClassNameWordBoundary
</span><span class="lines">@@ -835,7 +814,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $name) = @_;
</span><span class="cx"> 
</span><del>-    my $class = GetImplClassName($interface-&gt;name);
</del><ins>+    my $class = GetImplClassName($interface);
</ins><span class="cx">     my $member = $codeGenerator-&gt;WK_ucfirst($name);
</span><span class="cx"> 
</span><span class="cx">     # Since the enumeration name will be nested in the class name's namespace, remove any words
</span><span class="lines">@@ -855,13 +834,17 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetEnumerationClassName
</span><span class="cx"> {
</span><del>-    my ($name, $interface) = @_;
</del><ins>+    my ($type, $interface) = @_;
</ins><span class="cx"> 
</span><del>-    if ($codeGenerator-&gt;HasEnumImplementationNameOverride($name)) {
-        return $codeGenerator-&gt;GetEnumImplementationNameOverride($name);
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
+
+    if ($codeGenerator-&gt;HasEnumImplementationNameOverride($type)) {
+        return $codeGenerator-&gt;GetEnumImplementationNameOverride($type);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return $name if $codeGenerator-&gt;IsExternalEnumType($name);
</del><ins>+    my $name = $type-&gt;name;
+
+    return $name if $codeGenerator-&gt;IsExternalEnumType($type);
</ins><span class="cx">     return $name unless defined($interface);
</span><span class="cx"> 
</span><span class="cx">     return GetNestedClassName($interface, $name);
</span><span class="lines">@@ -999,9 +982,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $result = &quot;&quot;;
</span><span class="cx">     foreach my $enumeration (@$enumerations) {
</span><del>-        my $name = $enumeration-&gt;name;
-
-        my $className = GetEnumerationClassName($name, $interface);
</del><ins>+        my $className = GetEnumerationClassName($enumeration-&gt;type, $interface);
</ins><span class="cx">         my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($enumeration);
</span><span class="cx">         $result .= GenerateEnumerationImplementationContent($enumeration, $className, $interface, $conditionalString);
</span><span class="cx">     }
</span><span class="lines">@@ -1036,7 +1017,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $result = &quot;&quot;;
</span><span class="cx">     foreach my $enumeration (@$enumerations) {
</span><del>-        my $className = GetEnumerationClassName($enumeration-&gt;name, $interface);
</del><ins>+        my $className = GetEnumerationClassName($enumeration-&gt;type, $interface);
</ins><span class="cx">         my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($enumeration);
</span><span class="cx">         $result .= GenerateEnumerationHeaderContent($enumeration, $className, $conditionalString);
</span><span class="cx">     }
</span><span class="lines">@@ -1045,13 +1026,14 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetDictionaryClassName
</span><span class="cx"> {
</span><del>-    my ($name, $interface) = @_;
</del><ins>+    my ($type, $interface) = @_;
</ins><span class="cx"> 
</span><del>-    if ($codeGenerator-&gt;HasDictionaryImplementationNameOverride($name)) {
-        return $codeGenerator-&gt;GetDictionaryImplementationNameOverride($name);
</del><ins>+    if ($codeGenerator-&gt;HasDictionaryImplementationNameOverride($type)) {
+        return $codeGenerator-&gt;GetDictionaryImplementationNameOverride($type);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return $name if $codeGenerator-&gt;IsExternalDictionaryType($name);
</del><ins>+    my $name = $type-&gt;name;
+    return $name if $codeGenerator-&gt;IsExternalDictionaryType($type);
</ins><span class="cx">     return $name unless defined($interface);
</span><span class="cx">     return GetNestedClassName($interface, $name);
</span><span class="cx"> }
</span><span class="lines">@@ -1062,10 +1044,10 @@
</span><span class="cx"> 
</span><span class="cx">     my $defaultValue = $signature-&gt;default;
</span><span class="cx"> 
</span><del>-    if ($codeGenerator-&gt;IsEnumType($signature-&gt;type)) {
</del><ins>+    if ($codeGenerator-&gt;IsEnumType($signature-&gt;idlType)) {
</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($signature-&gt;idlType, $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="lines">@@ -1076,9 +1058,9 @@
</span><span class="cx">             my $IDLType = GetIDLType($interface, $signature-&gt;idlType);
</span><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 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 $signature-&gt;idlType-&gt;name eq &quot;any&quot;;
+        return &quot;nullptr&quot; if $codeGenerator-&gt;IsWrapperType($signature-&gt;idlType) || $codeGenerator-&gt;IsTypedArrayType($signature-&gt;idlType);
+        return &quot;String()&quot; if $codeGenerator-&gt;IsStringType($signature-&gt;idlType);
</ins><span class="cx">         return &quot;Nullopt&quot;;
</span><span class="cx">     }
</span><span class="cx">     if ($defaultValue eq &quot;[]&quot;) {
</span><span class="lines">@@ -1092,25 +1074,6 @@
</span><span class="cx">     return $defaultValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub ShouldAllowNonFiniteForFloatingPointType
-{
-    my $type = shift;
-
-    die &quot;Can only be called with floating point types&quot; unless $codeGenerator-&gt;IsFloatingPointType($type);
-    return $type eq &quot;unrestricted double&quot; || $type eq &quot;unrestricted float&quot;;
-}
-
-sub GenerateConversionRuleWithLeadingComma
-{
-    my ($interface, $member) = @_;
-
-    if ($codeGenerator-&gt;IsFloatingPointType($member-&gt;type)) {
-        return &quot;, &quot; . (ShouldAllowNonFiniteForFloatingPointType($member-&gt;type) ? &quot;ShouldAllowNonFinite::Yes&quot; : &quot;ShouldAllowNonFinite::No&quot;);
-    }
-    return &quot;, &quot; . GetIntegerConversionConfiguration($member) if $codeGenerator-&gt;IsIntegerType($member-&gt;type);
-    return &quot;&quot;;
-}
-
</del><span class="cx"> sub GenerateDictionaryHeaderContent
</span><span class="cx"> {
</span><span class="cx">     my ($dictionary, $className, $conditionalString) = @_;
</span><span class="lines">@@ -1133,7 +1096,7 @@
</span><span class="cx">     my $result = &quot;&quot;;
</span><span class="cx">     foreach my $dictionary (@$allDictionaries) {
</span><span class="cx">         $headerIncludes{$interface-&gt;name . &quot;.h&quot;} = 1;
</span><del>-        my $className = GetDictionaryClassName($dictionary-&gt;name, $interface);
</del><ins>+        my $className = GetDictionaryClassName($dictionary-&gt;type, $interface);
</ins><span class="cx">         my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($dictionary);
</span><span class="cx">         $result .= GenerateDictionaryHeaderContent($dictionary, $className, $conditionalString);
</span><span class="cx">     }
</span><span class="lines">@@ -1178,12 +1141,12 @@
</span><span class="cx">     # 4. Let dictionaries be a list consisting of D and all of D’s inherited dictionaries, in order from least to most derived.
</span><span class="cx">     my @dictionaries;
</span><span class="cx">     push(@dictionaries, $dictionary);
</span><del>-    my $parentName = $dictionary-&gt;parent;
-    while (defined($parentName)) {
-        my $parentDictionary = $codeGenerator-&gt;GetDictionaryByName($parentName);
-        assert(&quot;Unable to find definition for dictionary named '&quot; . $parentName . &quot;'!&quot;) unless defined($parentDictionary);
</del><ins>+    my $parentType = $dictionary-&gt;parentType;
+    while (defined($parentType)) {
+        my $parentDictionary = $codeGenerator-&gt;GetDictionaryByType($parentType);
+        assert(&quot;Unable to find definition for dictionary named '&quot; . $parentType-&gt;name . &quot;'!&quot;) unless defined($parentDictionary);
</ins><span class="cx">         unshift(@dictionaries, $parentDictionary);
</span><del>-        $parentName = $parentDictionary-&gt;parent;
</del><ins>+        $parentType = $parentDictionary-&gt;parentType;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     my $arguments = &quot;&quot;;
</span><span class="lines">@@ -1244,7 +1207,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $result = &quot;&quot;;
</span><span class="cx">     foreach my $dictionary (@$allDictionaries) {
</span><del>-        my $className = GetDictionaryClassName($dictionary-&gt;name, $interface);
</del><ins>+        my $className = GetDictionaryClassName($dictionary-&gt;type, $interface);
</ins><span class="cx">         my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($dictionary);
</span><span class="cx">         $result .= GenerateDictionaryImplementationContent($dictionary, $className, $interface, $conditionalString);
</span><span class="cx">     }
</span><span class="lines">@@ -1317,8 +1280,8 @@
</span><span class="cx"> 
</span><span class="cx">     $headerIncludes{&quot;SVGElement.h&quot;} = 1 if $className =~ /^JSSVG/;
</span><span class="cx"> 
</span><del>-    my $implType = GetImplClassName($interfaceName);
-    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName);
</del><ins>+    my $implType = GetImplClassName($interface);
+    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interface);
</ins><span class="cx">     my $svgPropertyOrListPropertyType;
</span><span class="cx">     $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType;
</span><span class="cx">     $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType;
</span><span class="lines">@@ -1329,16 +1292,16 @@
</span><span class="cx"> 
</span><span class="cx">     push(@headerContent, &quot;\nnamespace WebCore {\n\n&quot;);
</span><span class="cx"> 
</span><del>-    if ($codeGenerator-&gt;IsSVGAnimatedType($interfaceName)) {
</del><ins>+    if ($codeGenerator-&gt;IsSVGAnimatedType($interface-&gt;type)) {
</ins><span class="cx">         $headerIncludes{&quot;$interfaceName.h&quot;} = 1;
</span><span class="cx">     } else {
</span><span class="cx">         # Implementation class forward declaration
</span><span class="cx">         if (IsDOMGlobalObject($interface)) {
</span><del>-            AddClassForwardIfNeeded($interfaceName) unless $svgPropertyOrListPropertyType;
</del><ins>+            AddClassForwardIfNeeded($interface-&gt;type) unless $svgPropertyOrListPropertyType;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    AddClassForwardIfNeeded(&quot;JSDOMWindowShell&quot;) if $interfaceName eq &quot;DOMWindow&quot;;
</del><ins>+    push(@headerContent, &quot;class JSDOMWindowShell;\n\n&quot;) if $interfaceName eq &quot;DOMWindow&quot;;
</ins><span class="cx"> 
</span><span class="cx">     my $exportMacro = GetExportMacroForJSClass($interface);
</span><span class="cx"> 
</span><span class="lines">@@ -1367,7 +1330,7 @@
</span><span class="cx">         push(@headerContent, &quot;        return ptr;\n&quot;);
</span><span class="cx">         push(@headerContent, &quot;    }\n\n&quot;);
</span><span class="cx">     } elsif ($interface-&gt;extendedAttributes-&gt;{MasqueradesAsUndefined}) {
</span><del>-        AddIncludesForTypeInHeader($implType) unless $svgPropertyOrListPropertyType;
</del><ins>+        AddIncludesForImplementationTypeInHeader($implType) unless $svgPropertyOrListPropertyType;
</ins><span class="cx">         push(@headerContent, &quot;    static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&lt;$implType&gt;&amp;&amp; impl)\n&quot;);
</span><span class="cx">         push(@headerContent, &quot;    {\n&quot;);
</span><span class="cx">         push(@headerContent, &quot;        globalObject-&gt;masqueradesAsUndefinedWatchpoint()-&gt;fireAll(globalObject-&gt;vm(), \&quot;Allocated masquerading object\&quot;);\n&quot;);
</span><span class="lines">@@ -1383,7 +1346,7 @@
</span><span class="cx">         push(@headerContent, &quot;        return ptr;\n&quot;);
</span><span class="cx">         push(@headerContent, &quot;    }\n\n&quot;);  
</span><span class="cx">     } else {
</span><del>-        AddIncludesForTypeInHeader($implType) unless $svgPropertyOrListPropertyType;
</del><ins>+        AddIncludesForImplementationTypeInHeader($implType) unless $svgPropertyOrListPropertyType;
</ins><span class="cx">         push(@headerContent, &quot;    static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&lt;$implType&gt;&amp;&amp; impl)\n&quot;);
</span><span class="cx">         push(@headerContent, &quot;    {\n&quot;);
</span><span class="cx">         push(@headerContent, &quot;        $className* ptr = new (NotNull, JSC::allocateCell&lt;$className&gt;(globalObject-&gt;vm().heap)) $className(structure, *globalObject, WTFMove(impl));\n&quot;);
</span><span class="lines">@@ -1404,7 +1367,7 @@
</span><span class="cx"> 
</span><span class="cx">     # JSValue to implementation type
</span><span class="cx">     if (ShouldGenerateToWrapped($hasParent, $interface)) {
</span><del>-        my $nativeType = GetNativeType($interface, $implType);
</del><ins>+        my $nativeType = GetNativeType($interface, $interface-&gt;type);
</ins><span class="cx">         if ($interface-&gt;name eq &quot;XPathNSResolver&quot;) {
</span><span class="cx">             push(@headerContent, &quot;    static $nativeType toWrapped(JSC::ExecState&amp;, JSC::JSValue);\n&quot;);
</span><span class="cx">         } else {
</span><span class="lines">@@ -1818,12 +1781,12 @@
</span><span class="cx">             push(@ancestors, $currentInterface-&gt;name);
</span><span class="cx">         }, 0);
</span><span class="cx">         for my $dictionary (@$dictionaries) {
</span><del>-            my $parentName = $dictionary-&gt;parent;
-            while (defined($parentName)) {
-                push(@ancestors, $parentName) if $codeGenerator-&gt;IsExternalDictionaryType($parentName);
-                my $parentDictionary = $codeGenerator-&gt;GetDictionaryByName($parentName);
-                assert(&quot;Unable to find definition for dictionary named '&quot; . $parentName . &quot;'!&quot;) unless defined($parentDictionary);
-                $parentName = $parentDictionary-&gt;parent;
</del><ins>+            my $parentType = $dictionary-&gt;parentType;
+            while (defined($parentType)) {
+                push(@ancestors, $parentType-&gt;name) if $codeGenerator-&gt;IsExternalDictionaryType($parentType);
+                my $parentDictionary = $codeGenerator-&gt;GetDictionaryByType($parentType);
+                assert(&quot;Unable to find definition for dictionary named '&quot; . $parentType-&gt;name . &quot;'!&quot;) unless defined($parentDictionary);
+                $parentType = $parentDictionary-&gt;parentType;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         push(@depsContent, &quot;$className.h : &quot;, join(&quot; &quot;, map { &quot;$_.idl&quot; } @ancestors), &quot;\n&quot;);
</span><span class="lines">@@ -2032,7 +1995,7 @@
</span><span class="cx"> 
</span><span class="cx">     my $isDictionary = sub {
</span><span class="cx">         my $type = shift;
</span><del>-        return $type eq &quot;Dictionary&quot; || $codeGenerator-&gt;IsDictionaryType($type);
</del><ins>+        return $type-&gt;name eq &quot;Dictionary&quot; || $codeGenerator-&gt;IsDictionaryType($type);
</ins><span class="cx">     };
</span><span class="cx">     my $isCallbackFunctionOrDictionary = sub {
</span><span class="cx">         my $type = shift;
</span><span class="lines">@@ -2060,12 +2023,12 @@
</span><span class="cx"> 
</span><span class="cx">     return 0 if $idlTypeA-&gt;name eq $idlTypeB-&gt;name;
</span><span class="cx">     return 0 if $idlTypeA-&gt;name eq &quot;object&quot; or $idlTypeB-&gt;name eq &quot;object&quot;;
</span><del>-    return 0 if $codeGenerator-&gt;IsNumericType($idlTypeA-&gt;name) &amp;&amp; $codeGenerator-&gt;IsNumericType($idlTypeB-&gt;name);
-    return 0 if $codeGenerator-&gt;IsStringOrEnumType($idlTypeA-&gt;name) &amp;&amp; $codeGenerator-&gt;IsStringOrEnumType($idlTypeB-&gt;name);
-    return 0 if &amp;$isDictionary($idlTypeA-&gt;name) &amp;&amp; &amp;$isDictionary($idlTypeB-&gt;name);
-    return 0 if $codeGenerator-&gt;IsCallbackInterface($idlTypeA-&gt;name) &amp;&amp; $codeGenerator-&gt;IsCallbackInterface($idlTypeB-&gt;name);
-    return 0 if &amp;$isCallbackFunctionOrDictionary($idlTypeA-&gt;name) &amp;&amp; &amp;$isCallbackFunctionOrDictionary($idlTypeB-&gt;name);
-    return 0 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlTypeA-&gt;name) &amp;&amp; $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlTypeB-&gt;name);
</del><ins>+    return 0 if $codeGenerator-&gt;IsNumericType($idlTypeA) &amp;&amp; $codeGenerator-&gt;IsNumericType($idlTypeB);
+    return 0 if $codeGenerator-&gt;IsStringOrEnumType($idlTypeA) &amp;&amp; $codeGenerator-&gt;IsStringOrEnumType($idlTypeB);
+    return 0 if &amp;$isDictionary($idlTypeA) &amp;&amp; &amp;$isDictionary($idlTypeB);
+    return 0 if $codeGenerator-&gt;IsCallbackInterface($idlTypeA) &amp;&amp; $codeGenerator-&gt;IsCallbackInterface($idlTypeB);
+    return 0 if &amp;$isCallbackFunctionOrDictionary($idlTypeA) &amp;&amp; &amp;$isCallbackFunctionOrDictionary($idlTypeB);
+    return 0 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlTypeA) &amp;&amp; $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlTypeB);
</ins><span class="cx">     # FIXME: return 0 if $idlTypeA and $idlTypeB are both exception types.
</span><span class="cx">     return 1;
</span><span class="cx"> }
</span><span class="lines">@@ -2162,7 +2125,7 @@
</span><span class="cx">     };
</span><span class="cx">     my $isDictionaryParameter = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><del>-        return $idlType-&gt;name eq &quot;Dictionary&quot; || $codeGenerator-&gt;IsDictionaryType($idlType-&gt;name);
</del><ins>+        return $idlType-&gt;name eq &quot;Dictionary&quot; || $codeGenerator-&gt;IsDictionaryType($idlType);
</ins><span class="cx">     };
</span><span class="cx">     my $isNullableOrDictionaryParameterOrUnionContainingOne = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><span class="lines">@@ -2191,17 +2154,17 @@
</span><span class="cx">     };
</span><span class="cx">     my $isObjectOrCallbackFunctionParameter = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><del>-        return $idlType-&gt;name eq &quot;object&quot; || $codeGenerator-&gt;IsFunctionOnlyCallbackInterface($idlType-&gt;name);
</del><ins>+        return $idlType-&gt;name eq &quot;object&quot; || $codeGenerator-&gt;IsFunctionOnlyCallbackInterface($idlType);
</ins><span class="cx">     };
</span><span class="cx">     my $isSequenceOrFrozenArrayParameter = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><del>-        return $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType-&gt;name);
</del><ins>+        return $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType);
</ins><span class="cx">     };
</span><span class="cx">     my $isDictionaryOrObjectOrCallbackInterfaceParameter = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><span class="cx">         return 1 if &amp;$isDictionaryParameter($idlType, $optionality);
</span><span class="cx">         return 1 if $idlType-&gt;name eq &quot;object&quot;;
</span><del>-        return 1 if $codeGenerator-&gt;IsCallbackInterface($idlType-&gt;name) &amp;&amp; !$codeGenerator-&gt;IsFunctionOnlyCallbackInterface($idlType-&gt;name);
</del><ins>+        return 1 if $codeGenerator-&gt;IsCallbackInterface($idlType) &amp;&amp; !$codeGenerator-&gt;IsFunctionOnlyCallbackInterface($idlType);
</ins><span class="cx">         return 0;
</span><span class="cx">     };
</span><span class="cx">     my $isBooleanParameter = sub {
</span><span class="lines">@@ -2210,11 +2173,11 @@
</span><span class="cx">     };
</span><span class="cx">     my $isNumericParameter = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><del>-        return $codeGenerator-&gt;IsNumericType($idlType-&gt;name);
</del><ins>+        return $codeGenerator-&gt;IsNumericType($idlType);
</ins><span class="cx">     };
</span><span class="cx">     my $isStringOrEnumParameter = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><del>-        return $codeGenerator-&gt;IsStringOrEnumType($idlType-&gt;name);
</del><ins>+        return $codeGenerator-&gt;IsStringOrEnumType($idlType);
</ins><span class="cx">     };
</span><span class="cx">     my $isAnyParameter = sub {
</span><span class="cx">         my ($idlType, $optionality) = @_;
</span><span class="lines">@@ -2260,13 +2223,12 @@
</span><span class="cx"> 
</span><span class="cx">                 my @idlSubtypes = $idlType-&gt;isUnion ? GetFlattenedMemberTypes($idlType) : ( $idlType );
</span><span class="cx">                 for my $idlSubtype (@idlSubtypes) {
</span><del>-                    my $type = $idlSubtype-&gt;name;
-                    if ($codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsTypedArrayType($type)) {
-                        if ($type eq &quot;DOMWindow&quot;) {
</del><ins>+                    if ($codeGenerator-&gt;IsWrapperType($idlSubtype) || $codeGenerator-&gt;IsTypedArrayType($idlSubtype)) {
+                        if ($idlSubtype-&gt;name eq &quot;DOMWindow&quot;) {
</ins><span class="cx">                             AddToImplIncludes(&quot;JSDOMWindowShell.h&quot;);
</span><span class="cx">                             &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; (asObject(distinguishingArg)-&gt;inherits(JSDOMWindowShell::info()) || asObject(distinguishingArg)-&gt;inherits(JSDOMWindow::info()))&quot;);
</span><span class="cx">                         } else {
</span><del>-                            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JS${type}::info())&quot;);
</del><ins>+                            &amp;$generateOverloadCallIfNecessary($overload, &quot;distinguishingArg.isObject() &amp;&amp; asObject(distinguishingArg)-&gt;inherits(JS&quot; . $idlSubtype-&gt;name . &quot;::info())&quot;);
</ins><span class="cx">                         }
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="lines">@@ -2367,8 +2329,9 @@
</span><span class="cx"> sub GetNativeTypeForConversions
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><ins>+
</ins><span class="cx">     my $interfaceName = $interface-&gt;name;
</span><del>-    $interfaceName = $codeGenerator-&gt;GetSVGTypeNeedingTearOff($interfaceName) if $codeGenerator-&gt;IsSVGTypeNeedingTearOff($interfaceName);
</del><ins>+    $interfaceName = $codeGenerator-&gt;GetSVGTypeNeedingTearOffForType($interface-&gt;type) if $codeGenerator-&gt;IsSVGTypeNeedingTearOffForType($interface-&gt;type);
</ins><span class="cx">     return $interfaceName;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2531,7 +2494,9 @@
</span><span class="cx"> sub GetIndexedGetterExpression
</span><span class="cx"> {
</span><span class="cx">     my $indexedGetterFunction = shift;
</span><del>-    return &quot;jsStringOrUndefined(state, thisObject-&gt;wrapped().item(index))&quot; if $indexedGetterFunction-&gt;signature-&gt;type eq &quot;DOMString&quot;;
</del><ins>+    
+    # FIXME: Should this work for all string types?
+    return &quot;jsStringOrUndefined(state, thisObject-&gt;wrapped().item(index))&quot; if $indexedGetterFunction-&gt;signature-&gt;idlType-&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">@@ -2615,7 +2580,7 @@
</span><span class="cx">     $implIncludes{&quot;&lt;wtf/GetPtr.h&gt;&quot;} = 1;
</span><span class="cx">     $implIncludes{&quot;&lt;runtime/PropertyNameArray.h&gt;&quot;} = 1 if $indexedGetterFunction;
</span><span class="cx"> 
</span><del>-    my $implType = GetImplClassName($interfaceName);
</del><ins>+    my $implType = GetImplClassName($interface);
</ins><span class="cx"> 
</span><span class="cx">     AddJSBuiltinIncludesIfNeeded($interface);
</span><span class="cx"> 
</span><span class="lines">@@ -2922,7 +2887,7 @@
</span><span class="cx">     }
</span><span class="cx">     push(@implContent, &quot;, CREATE_METHOD_TABLE($className) };\n\n&quot;);
</span><span class="cx"> 
</span><del>-    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName);
</del><ins>+    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interface);
</ins><span class="cx">     my $svgPropertyOrListPropertyType;
</span><span class="cx">     $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType;
</span><span class="cx">     $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType;
</span><span class="lines">@@ -2929,13 +2894,13 @@
</span><span class="cx"> 
</span><span class="cx">     # Constructor
</span><span class="cx">     if ($interfaceName eq &quot;DOMWindow&quot;) {
</span><del>-        AddIncludesForTypeInImpl(&quot;JSDOMWindowShell&quot;);
</del><ins>+        AddIncludesForImplementationTypeInImpl(&quot;JSDOMWindowShell&quot;);
</ins><span class="cx">         push(@implContent, &quot;${className}::$className(VM&amp; vm, Structure* structure, Ref&lt;$implType&gt;&amp;&amp; impl, JSDOMWindowShell* shell)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    : $parentClassName(vm, structure, WTFMove(impl), shell)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">     } elsif ($codeGenerator-&gt;InheritsInterface($interface, &quot;WorkerGlobalScope&quot;)) {
</span><del>-        AddIncludesForTypeInImpl($interfaceName);
</del><ins>+        AddIncludesForImplementationTypeInImpl($interfaceName);
</ins><span class="cx">         push(@implContent, &quot;${className}::$className(VM&amp; vm, Structure* structure, Ref&lt;$implType&gt;&amp;&amp; impl)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    : $parentClassName(vm, structure, WTFMove(impl))\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><span class="lines">@@ -3079,7 +3044,8 @@
</span><span class="cx">             };
</span><span class="cx"> 
</span><span class="cx">             if ($indexedGetterFunction) {
</span><del>-                if ($indexedGetterFunction-&gt;signature-&gt;type eq &quot;DOMString&quot;) {
</del><ins>+                # FIXME: Should this work for all string types?
+                if ($indexedGetterFunction-&gt;signature-&gt;idlType-&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">@@ -3158,7 +3124,7 @@
</span><span class="cx">             next if IsJSBuiltin($interface, $attribute);
</span><span class="cx"> 
</span><span class="cx">             my $name = $attribute-&gt;signature-&gt;name;
</span><del>-            my $type = $attribute-&gt;signature-&gt;type;
</del><ins>+            my $idlType = $attribute-&gt;signature-&gt;idlType;
</ins><span class="cx">             my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx">             my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $name);
</span><span class="cx">             my $getterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{GetterMayThrowLegacyException};
</span><span class="lines">@@ -3168,7 +3134,7 @@
</span><span class="cx">             my $attributeConditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
</span><span class="cx">             push(@implContent, &quot;#if ${attributeConditionalString}\n&quot;) if $attributeConditionalString;
</span><span class="cx"> 
</span><del>-            if (!$attribute-&gt;isStatic || $attribute-&gt;signature-&gt;type =~ /Constructor$/) {
</del><ins>+            if (!$attribute-&gt;isStatic || $codeGenerator-&gt;IsConstructorType($idlType)) {
</ins><span class="cx">                 my $templateParameters = &quot;${getFunctionName}Getter&quot;;
</span><span class="cx">                 if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{LenientThis}) {
</span><span class="cx">                     $templateParameters .= &quot;, CastedThisErrorBehavior::ReturnEarly&quot;;
</span><span class="lines">@@ -3207,7 +3173,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             # Global constructors can be disabled at runtime.
</span><del>-            if ($attribute-&gt;signature-&gt;type =~ /Constructor$/) {
</del><ins>+            if ($codeGenerator-&gt;IsConstructorType($idlType)) {
</ins><span class="cx">                 if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{EnabledBySetting}) {
</span><span class="cx">                     AddToImplIncludes(&quot;Frame.h&quot;);
</span><span class="cx">                     AddToImplIncludes(&quot;Settings.h&quot;);
</span><span class="lines">@@ -3242,8 +3208,8 @@
</span><span class="cx">                 push(@implContent, &quot;    JSGlobalObject* globalObject = state.lexicalGlobalObject();\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    InputCursor&amp; cursor = globalObject-&gt;inputCursor();\n&quot;);
</span><span class="cx"> 
</span><del>-                my $nativeType = GetNativeType($interface, $type);
-                my $memoizedType = GetNativeTypeForMemoization($interface, $type);
</del><ins>+                my $nativeType = GetNativeType($interface, $idlType);
+                my $memoizedType = GetNativeTypeForMemoization($interface, $idlType);
</ins><span class="cx">                 my $exceptionCode = $getterMayThrowLegacyException ? &quot;ec&quot; : &quot;0&quot;;
</span><span class="cx">                 push(@implContent, &quot;    static NeverDestroyed&lt;const AtomicString&gt; bindingName(\&quot;$interfaceName.$name\&quot;, AtomicString::ConstructFromLiteral);\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    if (cursor.isCapturing()) {\n&quot;);
</span><span class="lines">@@ -3273,7 +3239,7 @@
</span><span class="cx">                 $implIncludes{&quot;JSDOMBinding.h&quot;} = 1;
</span><span class="cx">                 push(@implContent, &quot;    auto&amp; impl = thisObject.wrapped();\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;    return shouldAllowAccessToNode(&amp;state, impl.&quot; . $attribute-&gt;signature-&gt;name . &quot;()) ? &quot; . NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;impl.$implGetterFunctionName()&quot;, &quot;thisObject&quot;) . &quot; : jsNull();\n&quot;);
</span><del>-            } elsif ($type eq &quot;EventHandler&quot;) {
</del><ins>+            } elsif ($idlType-&gt;name eq &quot;EventHandler&quot;) {
</ins><span class="cx">                 $implIncludes{&quot;EventNames.h&quot;} = 1;
</span><span class="cx">                 my $getter = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{WindowEventHandler} ? &quot;windowEventHandlerAttribute&quot;
</span><span class="cx">                     : $attribute-&gt;signature-&gt;extendedAttributes-&gt;{DocumentEventHandler} ? &quot;documentEventHandlerAttribute&quot;
</span><span class="lines">@@ -3280,8 +3246,8 @@
</span><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 ($attribute-&gt;signature-&gt;type =~ /Constructor$/) {
-                my $constructorType = $attribute-&gt;signature-&gt;type;
</del><ins>+            } elsif ($codeGenerator-&gt;IsConstructorType($attribute-&gt;signature-&gt;idlType)) {
+                my $constructorType = $attribute-&gt;signature-&gt;idlType-&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">@@ -3330,7 +3296,7 @@
</span><span class="cx">                     unshift(@arguments, @callWithArgs);
</span><span class="cx">                     my $jsType = NativeToJSValueUsingReferences($attribute-&gt;signature, 0, $interface, &quot;${functionName}(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;thisObject&quot;);
</span><span class="cx">                     push(@implContent, &quot;    auto&amp; impl = thisObject.wrapped();\n&quot;) if !$attribute-&gt;isStatic;
</span><del>-                    if ($codeGenerator-&gt;IsSVGAnimatedType($type)) {
</del><ins>+                    if ($codeGenerator-&gt;IsSVGAnimatedType($idlType)) {
</ins><span class="cx">                         push(@implContent, &quot;    auto obj = $jsType;\n&quot;);
</span><span class="cx">                         push(@implContent, &quot;    JSValue result = toJS(&amp;state, thisObject.globalObject(), obj.get());\n&quot;);
</span><span class="cx">                     } else {
</span><span class="lines">@@ -3478,7 +3444,7 @@
</span><span class="cx">             next if IsJSBuiltin($interface, $attribute);
</span><span class="cx"> 
</span><span class="cx">             my $name = $attribute-&gt;signature-&gt;name;
</span><del>-            my $type = $attribute-&gt;signature-&gt;type;
</del><ins>+            my $idlType = $attribute-&gt;signature-&gt;idlType;
</ins><span class="cx">             my $putFunctionName = GetAttributeSetterName($interface, $className, $attribute);
</span><span class="cx">             my $implSetterFunctionName = $codeGenerator-&gt;WK_ucfirst($name);
</span><span class="cx">             my $setterMayThrowLegacyException = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{SetterMayThrowLegacyException};
</span><span class="lines">@@ -3532,7 +3498,7 @@
</span><span class="cx">             if (HasCustomSetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</span><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><del>-            } elsif ($type eq &quot;EventHandler&quot;) {
</del><ins>+            } elsif ($idlType-&gt;name eq &quot;EventHandler&quot;) {
</ins><span class="cx">                 $implIncludes{&quot;JSEventListener.h&quot;} = 1;
</span><span class="cx">                 my $eventName = EventHandlerAttributeEventName($attribute);
</span><span class="cx">                 # FIXME: Find a way to do this special case without hardcoding the class and attribute names here.
</span><span class="lines">@@ -3547,8 +3513,8 @@
</span><span class="cx">                     push(@implContent, &quot;    $setter(state, thisObject, thisObject.wrapped(), $eventName, value);\n&quot;);
</span><span class="cx">                 }
</span><span class="cx">                 push(@implContent, &quot;    return true;\n&quot;);
</span><del>-            } elsif ($type =~ /Constructor$/) {
-                my $constructorType = $type;
</del><ins>+            } elsif ($codeGenerator-&gt;IsConstructorType($idlType)) {
+                my $constructorType = $idlType-&gt;name;
</ins><span class="cx">                 $constructorType =~ s/Constructor$//;
</span><span class="cx">                 # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
</span><span class="cx">                 # We do not generate the header file for NamedConstructor of class XXXX,
</span><span class="lines">@@ -3570,7 +3536,7 @@
</span><span class="cx">                     my $putForwards = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{PutForwards};
</span><span class="cx">                     if ($putForwards) {
</span><span class="cx">                         my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{ImplementedAs} || $name);
</span><del>-                        my $forwardedAttribute = $codeGenerator-&gt;GetAttributeFromInterface($interface, $type, $putForwards);
</del><ins>+                        my $forwardedAttribute = $codeGenerator-&gt;GetAttributeFromInterface($interface, $idlType-&gt;name, $putForwards);
</ins><span class="cx"> 
</span><span class="cx">                         if ($forwardedAttribute-&gt;signature-&gt;extendedAttributes-&gt;{CEReactions}) {
</span><span class="cx">                             push(@implContent, &quot;#if ENABLE(CUSTOM_ELEMENTS)\n&quot;);
</span><span class="lines">@@ -3579,18 +3545,19 @@
</span><span class="cx">                             $implIncludes{&quot;CustomElementReactionQueue.h&quot;} = 1;
</span><span class="cx">                         }
</span><span class="cx"> 
</span><ins>+                        my $typeName = $idlType-&gt;name;
</ins><span class="cx">                         if ($attribute-&gt;signature-&gt;isNullable) {
</span><del>-                            push(@implContent, &quot;    RefPtr&lt;${type}&gt; forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n&quot;);
</del><ins>+                            push(@implContent, &quot;    RefPtr&lt;${typeName}&gt; forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n&quot;);
</ins><span class="cx">                             push(@implContent, &quot;    if (!forwardedImpl)\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;    auto&amp; impl = *forwardedImpl;\n&quot;);
</span><span class="cx">                         } else {
</span><span class="cx">                             # Attribute is not nullable, the implementation is expected to return a reference.
</span><del>-                            push(@implContent, &quot;    Ref&lt;${type}&gt; forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n&quot;);
</del><ins>+                            push(@implContent, &quot;    Ref&lt;${typeName}&gt; forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n&quot;);
</ins><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>+                        $idlType = $attribute-&gt;signature-&gt;idlType;
</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">@@ -3601,7 +3568,7 @@
</span><span class="cx">                 my $shouldPassByReference = ShouldPassWrapperByReference($attribute-&gt;signature, $interface);
</span><span class="cx"> 
</span><span class="cx">                 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;);
</span><del>-                if (!$shouldPassByReference &amp;&amp; ($codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsTypedArrayType($type))) {
</del><ins>+                if (!$shouldPassByReference &amp;&amp; ($codeGenerator-&gt;IsWrapperType($idlType) || $codeGenerator-&gt;IsTypedArrayType($idlType))) {
</ins><span class="cx">                     $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx">                     push(@implContent, &quot;    &quot; . GetNativeTypeFromSignature($interface, $attribute-&gt;signature) . &quot; nativeValue = nullptr;\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    if (!value.isUndefinedOrNull()) {\n&quot;);
</span><span class="lines">@@ -3608,7 +3575,7 @@
</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="cx">                     push(@implContent, &quot;        if (UNLIKELY(!nativeValue)) {\n&quot;);
</span><del>-                    push(@implContent, &quot;            throwAttributeTypeError(state, throwScope, \&quot;$visibleInterfaceName\&quot;, \&quot;$name\&quot;, \&quot;$type\&quot;);\n&quot;);
</del><ins>+                    push(@implContent, &quot;            throwAttributeTypeError(state, throwScope, \&quot;$visibleInterfaceName\&quot;, \&quot;$name\&quot;, \&quot;&quot; . $idlType-&gt;name . &quot;\&quot;);\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;            return false;\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;        }\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    }\n&quot;);
</span><span class="lines">@@ -3617,7 +3584,7 @@
</span><span class="cx">                     push(@implContent, &quot;    RETURN_IF_EXCEPTION(throwScope, false);\n&quot;) if $mayThrowException;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ($codeGenerator-&gt;IsEnumType($type)) {
</del><ins>+                if ($codeGenerator-&gt;IsEnumType($idlType)) {
</ins><span class="cx">                     push (@implContent, &quot;    if (UNLIKELY(!nativeValue))\n&quot;);
</span><span class="cx">                     push (@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                 }
</span><span class="lines">@@ -3624,7 +3591,7 @@
</span><span class="cx"> 
</span><span class="cx">                 if ($shouldPassByReference) {
</span><span class="cx">                     push(@implContent, &quot;    if (UNLIKELY(!nativeValue)) {\n&quot;);
</span><del>-                    push(@implContent, &quot;        throwAttributeTypeError(state, throwScope, \&quot;$visibleInterfaceName\&quot;, \&quot;$name\&quot;, \&quot;$type\&quot;);\n&quot;);
</del><ins>+                    push(@implContent, &quot;        throwAttributeTypeError(state, throwScope, \&quot;$visibleInterfaceName\&quot;, \&quot;$name\&quot;, \&quot;&quot; . $idlType-&gt;name . &quot;\&quot;);\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    }\n&quot;);
</span><span class="cx">                 }
</span><span class="lines">@@ -3660,9 +3627,9 @@
</span><span class="cx">                 } else {
</span><span class="cx">                     my ($functionName, @arguments) = $codeGenerator-&gt;SetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><span class="cx"> 
</span><del>-                    if ($codeGenerator-&gt;IsTypedArrayType($type) and not $type eq &quot;ArrayBuffer&quot;) {
</del><ins>+                    if ($codeGenerator-&gt;IsTypedArrayType($idlType) and not $idlType-&gt;name eq &quot;ArrayBuffer&quot;) {
</ins><span class="cx">                         push(@arguments, &quot;nativeValue.get()&quot;);
</span><del>-                    } elsif ($codeGenerator-&gt;IsEnumType($type)) {
</del><ins>+                    } elsif ($codeGenerator-&gt;IsEnumType($idlType)) {
</ins><span class="cx">                         push(@arguments, &quot;nativeValue.value()&quot;);
</span><span class="cx">                     } else {
</span><span class="cx">                         push(@arguments, $shouldPassByReference ? &quot;*nativeValue&quot; : &quot;WTFMove(nativeValue)&quot;);
</span><span class="lines">@@ -3751,7 +3718,7 @@
</span><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>-            AddIncludesForTypeInImpl($function-&gt;signature-&gt;type) unless $isCustom or IsReturningPromise($function);
</del><ins>+            AddToImplIncludesForIDLType($function-&gt;signature-&gt;idlType) unless $isCustom or IsReturningPromise($function);
</ins><span class="cx"> 
</span><span class="cx">             my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="cx"> 
</span><span class="lines">@@ -3949,7 +3916,8 @@
</span><span class="cx">     # die &quot;Can't generate binding for class with cached attribute and custom mark.&quot; if $numCachedAttributes &gt; 0 and $interface-&gt;extendedAttributes-&gt;{JSCustomMarkFunction};
</span><span class="cx"> 
</span><span class="cx">     if ($indexedGetterFunction) {
</span><del>-        $implIncludes{&quot;URL.h&quot;} = 1 if $indexedGetterFunction-&gt;signature-&gt;type eq &quot;DOMString&quot;;
</del><ins>+        # FIXME: Should this work for all string types.
+        $implIncludes{&quot;URL.h&quot;} = 1 if $indexedGetterFunction-&gt;signature-&gt;idlType-&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">@@ -4300,10 +4268,9 @@
</span><span class="cx"> 
</span><span class="cx"> sub WillConvertUndefinedToDefaultParameterValue
</span><span class="cx"> {
</span><del>-    my $parameterType = shift;
-    my $defaultValue = shift;
</del><ins>+    my ($parameterType, $defaultValue) = @_;
</ins><span class="cx"> 
</span><del>-    my $automaticallyGeneratedDefaultValue = $automaticallyGeneratedDefaultValues{$parameterType};
</del><ins>+    my $automaticallyGeneratedDefaultValue = $automaticallyGeneratedDefaultValues{$parameterType-&gt;name};
</ins><span class="cx">     return 1 if defined $automaticallyGeneratedDefaultValue &amp;&amp; $automaticallyGeneratedDefaultValue eq $defaultValue;
</span><span class="cx"> 
</span><span class="cx">     return 1 if $defaultValue eq &quot;null&quot; &amp;&amp; $codeGenerator-&gt;IsWrapperType($parameterType);
</span><span class="lines">@@ -4349,21 +4316,20 @@
</span><span class="cx"> 
</span><span class="cx">     my $argumentIndex = 0;
</span><span class="cx">     foreach my $parameter (@{$function-&gt;parameters}) {
</span><del>-        my $type = $parameter-&gt;type;
</del><span class="cx">         my $idlType = $parameter-&gt;idlType;
</span><span class="cx"> 
</span><del>-        die &quot;Optional parameters of non-nullable wrapper types are not supported&quot; if $parameter-&gt;isOptional &amp;&amp; !$parameter-&gt;isNullable &amp;&amp; $codeGenerator-&gt;IsWrapperType($type);
</del><ins>+        die &quot;Optional parameters of non-nullable wrapper types are not supported&quot; if $parameter-&gt;isOptional &amp;&amp; !$parameter-&gt;isNullable &amp;&amp; $codeGenerator-&gt;IsWrapperType($idlType);
</ins><span class="cx">         die &quot;Optional parameters preceding variadic parameters are not supported&quot; if ($parameter-&gt;isOptional &amp;&amp;  @{$function-&gt;parameters}[$numParameters - 1]-&gt;isVariadic);
</span><span class="cx"> 
</span><span class="cx">         if ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
</span><span class="cx">             # As per Web IDL, optional dictionary parameters are always considered to have a default value of an empty dictionary, unless otherwise specified.
</span><del>-            $parameter-&gt;default(&quot;[]&quot;) if $type eq &quot;Dictionary&quot; or $codeGenerator-&gt;IsDictionaryType($type);
</del><ins>+            $parameter-&gt;default(&quot;[]&quot;) if $idlType-&gt;name eq &quot;Dictionary&quot; or $codeGenerator-&gt;IsDictionaryType($idlType);
</ins><span class="cx"> 
</span><span class="cx">             # We use undefined as default value for optional parameters of type 'any' unless specified otherwise.
</span><del>-            $parameter-&gt;default(&quot;undefined&quot;) if $type eq &quot;any&quot;;
</del><ins>+            $parameter-&gt;default(&quot;undefined&quot;) if $idlType-&gt;name eq &quot;any&quot;;
</ins><span class="cx"> 
</span><span class="cx">             # We use the null string as default value for parameters of type DOMString unless specified otherwise.
</span><del>-            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsStringType($type);
</del><ins>+            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsStringType($idlType);
</ins><span class="cx"> 
</span><span class="cx">             # As per Web IDL, passing undefined for a nullable parameter is treated as null. Therefore, use null as
</span><span class="cx">             # default value for nullable parameters unless otherwise specified.
</span><span class="lines">@@ -4370,19 +4336,20 @@
</span><span class="cx">             $parameter-&gt;default(&quot;null&quot;) if $parameter-&gt;isNullable;
</span><span class="cx"> 
</span><span class="cx">             # For callback parameters, the generated bindings treat undefined as null, so use null as implicit default value.
</span><del>-            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($type);
</del><ins>+            $parameter-&gt;default(&quot;null&quot;) if $codeGenerator-&gt;IsCallbackInterface($idlType);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         my $name = $parameter-&gt;name;
</span><span class="cx">         my $value = $name;
</span><span class="cx"> 
</span><del>-        if ($codeGenerator-&gt;IsCallbackInterface($type)) {
-            my $callbackClassName = GetCallbackClassName($type);
</del><ins>+        if ($codeGenerator-&gt;IsCallbackInterface($idlType)) {
+            my $callbackClassName = GetCallbackClassName($idlType-&gt;name);
+            my $typeName = $idlType-&gt;name;
</ins><span class="cx">             $implIncludes{&quot;$callbackClassName.h&quot;} = 1;
</span><span class="cx">             if ($parameter-&gt;isOptional) {
</span><del>-                push(@$outputArray, &quot;    RefPtr&lt;$type&gt; $name;\n&quot;);
</del><ins>+                push(@$outputArray, &quot;    RefPtr&lt;$typeName&gt; $name;\n&quot;);
</ins><span class="cx">                 push(@$outputArray, &quot;    if (!state-&gt;argument($argumentIndex).isUndefinedOrNull()) {\n&quot;);
</span><del>-                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
</del><ins>+                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($idlType)) {
</ins><span class="cx">                     push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argumentIndex).isFunction())\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@$outputArray, &quot;        if (!state-&gt;uncheckedArgument($argumentIndex).isObject())\n&quot;);
</span><span class="lines">@@ -4397,7 +4364,7 @@
</span><span class="cx">                 push(@$outputArray, &quot;    }\n&quot;);
</span><span class="cx">             } else {
</span><span class="cx">                 die &quot;CallbackInterface does not support Variadic parameter&quot; if $parameter-&gt;isVariadic;
</span><del>-                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($type)) {
</del><ins>+                if ($codeGenerator-&gt;IsFunctionOnlyCallbackInterface($idlType)) {
</ins><span class="cx">                     push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;uncheckedArgument($argumentIndex).isFunction()))\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@$outputArray, &quot;    if (UNLIKELY(!state-&gt;uncheckedArgument($argumentIndex).isObject()))\n&quot;);
</span><span class="lines">@@ -4421,8 +4388,8 @@
</span><span class="cx"> 
</span><span class="cx">             $value = &quot;WTFMove($name.arguments.value())&quot;;
</span><span class="cx"> 
</span><del>-        } elsif ($codeGenerator-&gt;IsEnumType($type)) {
-            my $className = GetEnumerationClassName($type, $interface);
</del><ins>+        } elsif ($codeGenerator-&gt;IsEnumType($idlType)) {
+            my $className = GetEnumerationClassName($idlType, $interface);
</ins><span class="cx"> 
</span><span class="cx">             $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx"> 
</span><span class="lines">@@ -4454,7 +4421,7 @@
</span><span class="cx">                 $indent = &quot;    &quot;;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            $implIncludes{&quot;JS$className.h&quot;} = 1 if $codeGenerator-&gt;IsExternalEnumType($type);
</del><ins>+            $implIncludes{&quot;JS$className.h&quot;} = 1 if $codeGenerator-&gt;IsExternalEnumType($idlType);
</ins><span class="cx">             push(@$outputArray, &quot;$indent    $defineOptionalValue = parseEnumeration&lt;$className&gt;(*state, ${name}Value);\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;$indent    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;$indent    if (UNLIKELY(!$optionalValue))\n&quot;);
</span><span class="lines">@@ -4466,13 +4433,13 @@
</span><span class="cx">             my $outer;
</span><span class="cx">             my $inner;
</span><span class="cx">             my $nativeType = GetNativeTypeFromSignature($interface, $parameter);
</span><del>-            my $isTearOff = $codeGenerator-&gt;IsSVGTypeNeedingTearOff($type) &amp;&amp; $interfaceName !~ /List$/;
</del><ins>+            my $isTearOff = $codeGenerator-&gt;IsSVGTypeNeedingTearOffForType($idlType) &amp;&amp; $interfaceName !~ /List$/;
</ins><span class="cx">             my $shouldPassByReference = $isTearOff || ShouldPassWrapperByReference($parameter, $interface);
</span><span class="cx"> 
</span><span class="cx">             die &quot;Variadic parameter is already handled here&quot; if $parameter-&gt;isVariadic;
</span><span class="cx">             my $argumentLookupMethod = $parameter-&gt;isOptional ? &quot;argument&quot; : &quot;uncheckedArgument&quot;;
</span><span class="cx"> 
</span><del>-            if (!$shouldPassByReference &amp;&amp; ($codeGenerator-&gt;IsWrapperType($type) || $codeGenerator-&gt;IsTypedArrayType($type))) {
</del><ins>+            if (!$shouldPassByReference &amp;&amp; ($codeGenerator-&gt;IsWrapperType($idlType) || $codeGenerator-&gt;IsTypedArrayType($idlType))) {
</ins><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><span class="lines">@@ -4482,15 +4449,15 @@
</span><span class="cx">                 push(@$outputArray, &quot;        $name = $nativeValue;\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n&quot;) if $mayThrowException;
</span><span class="cx">                 push(@$outputArray, &quot;        if (UNLIKELY(!$name))\n&quot;);
</span><del>-                push(@$outputArray, &quot;            return throwArgumentTypeError(*state, throwScope, $argumentIndex, \&quot;$name\&quot;, \&quot;$visibleInterfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;            return throwArgumentTypeError(*state, throwScope, $argumentIndex, \&quot;$name\&quot;, \&quot;$visibleInterfaceName\&quot;, $quotedFunctionName, \&quot;&quot; . $idlType-&gt;name . &quot;\&quot;);\n&quot;);
</ins><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)) {
</del><ins>+                if ($parameter-&gt;isOptional &amp;&amp; defined($parameter-&gt;default) &amp;&amp; !WillConvertUndefinedToDefaultParameterValue($idlType, $parameter-&gt;default)) {
</ins><span class="cx">                     my $defaultValue = $parameter-&gt;default;
</span><span class="cx"> 
</span><span class="cx">                     # String-related optimizations.
</span><del>-                    if ($codeGenerator-&gt;IsStringType($type)) {
</del><ins>+                    if ($codeGenerator-&gt;IsStringType($idlType)) {
</ins><span class="cx">                         my $useAtomicString = $parameter-&gt;extendedAttributes-&gt;{AtomicString};
</span><span class="cx">                         if ($defaultValue eq &quot;null&quot;) {
</span><span class="cx">                             $defaultValue = $useAtomicString ? &quot;nullAtom&quot; : &quot;String()&quot;;
</span><span class="lines">@@ -4522,13 +4489,13 @@
</span><span class="cx"> 
</span><span class="cx">             if ($shouldPassByReference) {
</span><span class="cx">                 push(@$outputArray, &quot;    if (UNLIKELY(!$name))\n&quot;);
</span><del>-                push(@$outputArray, &quot;        return throwArgumentTypeError(*state, throwScope, $argumentIndex, \&quot;$name\&quot;, \&quot;$visibleInterfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;        return throwArgumentTypeError(*state, throwScope, $argumentIndex, \&quot;$name\&quot;, \&quot;$visibleInterfaceName\&quot;, $quotedFunctionName, \&quot;&quot; . $idlType-&gt;name . &quot;\&quot;);\n&quot;);
</ins><span class="cx">                 $value = $isTearOff ? &quot;$name-&gt;propertyReference()&quot; : &quot;*$name&quot;;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if ($codeGenerator-&gt;IsTypedArrayType($type) and $parameter-&gt;type ne &quot;ArrayBuffer&quot;) {
</del><ins>+            if ($codeGenerator-&gt;IsTypedArrayType($idlType) and $idlType-&gt;name ne &quot;ArrayBuffer&quot;) {
</ins><span class="cx">                $value = $shouldPassByReference ? &quot;$name.releaseNonNull()&quot; : &quot;WTFMove($name)&quot;;
</span><del>-            } elsif ($codeGenerator-&gt;IsDictionaryType($type)) {
</del><ins>+            } elsif ($codeGenerator-&gt;IsDictionaryType($idlType)) {
</ins><span class="cx">                 $value = &quot;WTFMove($name)&quot;;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -4539,7 +4506,7 @@
</span><span class="cx"> 
</span><span class="cx">     push @arguments, GenerateReturnParameters($function);
</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 $function-&gt;signature-&gt;type &amp;&amp; $function-&gt;signature-&gt;type eq &quot;void&quot; &amp;&amp; $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowException};
</del><ins>+    $functionString = &quot;propagateException(*state, throwScope, $functionString)&quot; if $function-&gt;signature-&gt;idlType &amp;&amp; $function-&gt;signature-&gt;idlType-&gt;name eq &quot;void&quot; &amp;&amp; $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowException};
</ins><span class="cx"> 
</span><span class="cx">     return ($functionString, scalar @arguments);
</span><span class="cx"> }
</span><span class="lines">@@ -4558,8 +4525,6 @@
</span><span class="cx"> {
</span><span class="cx">     my ($object, $dictionary, $className, $enumerations) = @_;
</span><span class="cx"> 
</span><del>-    my $dictionaryName = $dictionary-&gt;name;
-
</del><span class="cx">     # - Add default header template and header protection.
</span><span class="cx">     push(@headerContentHeader, GenerateHeaderContentHeader($dictionary));
</span><span class="cx"> 
</span><span class="lines">@@ -4577,12 +4542,12 @@
</span><span class="cx">     # - Generate dependencies.
</span><span class="cx">     if ($writeDependencies) {
</span><span class="cx">         my @ancestors;
</span><del>-        my $parentName = $dictionary-&gt;parent;
-        while (defined($parentName)) {
-            push(@ancestors, $parentName) if $codeGenerator-&gt;IsExternalDictionaryType($parentName);
-            my $parentDictionary = $codeGenerator-&gt;GetDictionaryByName($parentName);
-            assert(&quot;Unable to find definition for dictionary named '&quot; . $parentName . &quot;'!&quot;) unless $parentDictionary;
-            $parentName = $parentDictionary-&gt;parent;
</del><ins>+        my $parentType = $dictionary-&gt;parentType;
+        while (defined($parentType)) {
+            push(@ancestors, $parentType-&gt;name) if $codeGenerator-&gt;IsExternalDictionaryType($parentType);
+            my $parentDictionary = $codeGenerator-&gt;GetDictionaryByType($parentType);
+            assert(&quot;Unable to find definition for dictionary named '&quot; . $parentType-&gt;name . &quot;'!&quot;) unless $parentDictionary;
+            $parentType = $parentDictionary-&gt;parentType;
</ins><span class="cx">         }
</span><span class="cx">         push(@depsContent, &quot;$className.h : &quot;, join(&quot; &quot;, map { &quot;$_.idl&quot; } @ancestors), &quot;\n&quot;);
</span><span class="cx">         push(@depsContent, map { &quot;$_.idl :\n&quot; } @ancestors);
</span><span class="lines">@@ -4648,9 +4613,9 @@
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             my @arguments = ();
</span><span class="cx">             foreach my $parameter (@{$function-&gt;parameters}) {
</span><del>-                push(@arguments, GetNativeTypeForCallbacks($interface, $parameter-&gt;type) . &quot; &quot; . $parameter-&gt;name);
</del><ins>+                push(@arguments, GetNativeTypeForCallbacks($interface, $parameter-&gt;idlType) . &quot; &quot; . $parameter-&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;signature-&gt;idlType) . &quot; &quot; . $function-&gt;signature-&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">@@ -4780,20 +4745,20 @@
</span><span class="cx">         push(@implContent, &quot;\n// Functions\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             my @params = @{$function-&gt;parameters};
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{Custom} || GetNativeType($interface, $function-&gt;signature-&gt;type) ne &quot;bool&quot;) {
</del><ins>+            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{Custom} || GetNativeType($interface, $function-&gt;signature-&gt;idlType) ne &quot;bool&quot;) {
</ins><span class="cx">                 next;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            AddIncludesForTypeInImpl($function-&gt;signature-&gt;type);
</del><ins>+            AddToImplIncludesForIDLType($function-&gt;signature-&gt;idlType);
</ins><span class="cx">             my $functionName = $function-&gt;signature-&gt;name;
</span><del>-            push(@implContent, &quot;\n&quot; . GetNativeTypeForCallbacks($interface, $function-&gt;signature-&gt;type) . &quot; ${className}::${functionName}(&quot;);
</del><ins>+            push(@implContent, &quot;\n&quot; . GetNativeTypeForCallbacks($interface, $function-&gt;signature-&gt;idlType) . &quot; ${className}::${functionName}(&quot;);
</ins><span class="cx"> 
</span><span class="cx">             my @args = ();
</span><span class="cx">             my @argsCheck = ();
</span><span class="cx">             foreach my $param (@params) {
</span><span class="cx">                 my $paramName = $param-&gt;name;
</span><del>-                AddIncludesForTypeInImpl($param-&gt;type, 1);
-                push(@args, GetNativeTypeForCallbacks($interface, $param-&gt;type) . &quot; &quot; . $paramName);
</del><ins>+                AddToImplIncludesForIDLType($param-&gt;idlType, 1);
+                push(@args, GetNativeTypeForCallbacks($interface, $param-&gt;idlType) . &quot; &quot; . $paramName);
</ins><span class="cx">             }
</span><span class="cx">             push(@implContent, join(&quot;, &quot;, @args));
</span><span class="cx">             push(@implContent, &quot;)\n&quot;);
</span><span class="lines">@@ -4861,7 +4826,7 @@
</span><span class="cx">     my $nondeterministic = $function-&gt;signature-&gt;extendedAttributes-&gt;{Nondeterministic};
</span><span class="cx">     my $mayThrowLegacyException = $function-&gt;signature-&gt;extendedAttributes-&gt;{MayThrowLegacyException};
</span><span class="cx"> 
</span><del>-    if ($function-&gt;signature-&gt;type eq &quot;void&quot; || IsReturningPromise($function)) {
</del><ins>+    if ($function-&gt;signature-&gt;idlType-&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">@@ -4897,7 +4862,7 @@
</span><span class="cx">             AddToImplIncludes(&quot;&lt;wtf/NeverDestroyed.h&gt;&quot;, &quot;WEB_REPLAY&quot;);
</span><span class="cx"> 
</span><span class="cx">             my $nativeType = GetNativeTypeFromSignature($interface, $function-&gt;signature);
</span><del>-            my $memoizedType = GetNativeTypeForMemoization($interface, $function-&gt;signature-&gt;type);
</del><ins>+            my $memoizedType = GetNativeTypeForMemoization($interface, $function-&gt;signature-&gt;idlType);
</ins><span class="cx">             my $bindingName = $interface-&gt;name . &quot;.&quot; . $function-&gt;signature-&gt;name;
</span><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="lines">@@ -5052,7 +5017,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $signature) = @_;
</span><span class="cx"> 
</span><del>-    return GetNativeType($interface, $signature-&gt;type);
</del><ins>+    return GetNativeType($interface, $signature-&gt;idlType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> my %nativeType = (
</span><span class="lines">@@ -5081,7 +5046,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetNativeVectorType
</span><span class="cx"> {
</span><del>-    my ($interface, $type) = @_;
</del><ins>+    my ($type) = @_;
</ins><span class="cx"> 
</span><span class="cx">     die &quot;This should only be called for sequence or array types&quot; unless $codeGenerator-&gt;IsSequenceOrFrozenArrayType($type);
</span><span class="cx"> 
</span><span class="lines">@@ -5169,10 +5134,10 @@
</span><span class="cx">     );
</span><span class="cx"> 
</span><span class="cx">     return $IDLTypes{$idlType-&gt;name} if exists $IDLTypes{$idlType-&gt;name};
</span><del>-    return &quot;IDLEnumeration&lt;&quot; . GetEnumerationClassName($idlType-&gt;name, $interface) . &quot;&gt;&quot; if $codeGenerator-&gt;IsEnumType($idlType-&gt;name);
-    return &quot;IDLDictionary&lt;&quot; . GetDictionaryClassName($idlType-&gt;name, $interface) . &quot;&gt;&quot; if $codeGenerator-&gt;IsDictionaryType($idlType-&gt;name);
-    return &quot;IDLSequence&lt;&quot; . GetIDLType($interface, @{$idlType-&gt;subtypes}[0]) . &quot;&gt;&quot; if $codeGenerator-&gt;IsSequenceType($idlType-&gt;name);
-    return &quot;IDLFrozenArray&lt;&quot; . GetIDLType($interface, @{$idlType-&gt;subtypes}[0]) . &quot;&gt;&quot; if $codeGenerator-&gt;IsFrozenArrayType($idlType-&gt;name);
</del><ins>+    return &quot;IDLEnumeration&lt;&quot; . GetEnumerationClassName($idlType, $interface) . &quot;&gt;&quot; if $codeGenerator-&gt;IsEnumType($idlType);
+    return &quot;IDLDictionary&lt;&quot; . GetDictionaryClassName($idlType, $interface) . &quot;&gt;&quot; if $codeGenerator-&gt;IsDictionaryType($idlType);
+    return &quot;IDLSequence&lt;&quot; . GetIDLType($interface, @{$idlType-&gt;subtypes}[0]) . &quot;&gt;&quot; if $codeGenerator-&gt;IsSequenceType($idlType);
+    return &quot;IDLFrozenArray&lt;&quot; . GetIDLType($interface, @{$idlType-&gt;subtypes}[0]) . &quot;&gt;&quot; if $codeGenerator-&gt;IsFrozenArrayType($idlType);
</ins><span class="cx">     return &quot;IDLUnion&lt;&quot; . join(&quot;, &quot;, GetIDLUnionMemberTypes($interface, $idlType)) . &quot;&gt;&quot; if $idlType-&gt;isUnion;
</span><span class="cx">     return &quot;IDLInterface&lt;&quot; . $idlType-&gt;name . &quot;&gt;&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -5190,27 +5155,28 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $type) = @_;
</span><span class="cx"> 
</span><del>-    return $nativeType{$type} if exists $nativeType{$type};
</del><ins>+    assert(&quot;Not a type&quot;) if ref($type) ne &quot;domType&quot;;
</ins><span class="cx"> 
</span><ins>+    my $typeName = $type-&gt;name;
+
+    return $nativeType{$typeName} if exists $nativeType{$typeName};
+
</ins><span class="cx">     return GetEnumerationClassName($type, $interface) if $codeGenerator-&gt;IsEnumType($type);
</span><span class="cx">     return GetDictionaryClassName($type, $interface) if $codeGenerator-&gt;IsDictionaryType($type);
</span><ins>+    return GetNativeVectorType($type) if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($type);
</ins><span class="cx"> 
</span><del>-    my $tearOffType = $codeGenerator-&gt;GetSVGTypeNeedingTearOff($type);
</del><ins>+    my $tearOffType = $codeGenerator-&gt;GetSVGTypeNeedingTearOffForType($type);
</ins><span class="cx">     return &quot;${tearOffType}*&quot; if $tearOffType;
</span><span class="cx"> 
</span><del>-    return &quot;RefPtr&lt;${type}&gt;&quot; if $codeGenerator-&gt;IsTypedArrayType($type) and $type ne &quot;ArrayBuffer&quot;;
-
-    return GetNativeVectorType($interface, $type) if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($type);
-
-    return &quot;${type}*&quot;;
</del><ins>+    return &quot;RefPtr&lt;${typeName}&gt;&quot; if $codeGenerator-&gt;IsTypedArrayType($type) and $typeName ne &quot;ArrayBuffer&quot;;
+    return &quot;${typeName}*&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub ShouldPassWrapperByReference
</span><span class="cx"> {
</span><del>-    my $parameter = shift;
-    my $interface = shift;
</del><ins>+    my ($parameter, $interface) = @_;
</ins><span class="cx"> 
</span><del>-    my $nativeType = GetNativeType($interface, $parameter-&gt;type);
</del><ins>+    my $nativeType = GetNativeType($interface, $parameter-&gt;idlType);
</ins><span class="cx">     return $codeGenerator-&gt;ShouldPassWrapperByReference($parameter, $interface) &amp;&amp; (substr($nativeType, -1) eq '*' || $nativeType =~ /^RefPtr/);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5218,8 +5184,10 @@
</span><span class="cx"> {
</span><span class="cx">     my $innerType = shift;
</span><span class="cx"> 
</span><del>-    return $nativeType{$innerType} if exists $nativeType{$innerType};
-    return &quot;RefPtr&lt;$innerType&gt;&quot;;
</del><ins>+    my $innerTypeName = $innerType-&gt;name;
+
+    return $nativeType{$innerTypeName} if exists $nativeType{$innerTypeName};
+    return &quot;RefPtr&lt;$innerTypeName&gt;&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetNativeTypeForCallbacks
</span><span class="lines">@@ -5226,7 +5194,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $type) = @_;
</span><span class="cx"> 
</span><del>-    return &quot;RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;&quot; if $type eq &quot;SerializedScriptValue&quot;;
</del><ins>+    return &quot;RefPtr&lt;SerializedScriptValue&gt;&amp;&amp;&quot; if $type-&gt;name eq &quot;SerializedScriptValue&quot;;
</ins><span class="cx">     return &quot;const String&amp;&quot; if $codeGenerator-&gt;IsStringType($type);
</span><span class="cx">     return GetNativeType($interface, $type);
</span><span class="cx"> }
</span><span class="lines">@@ -5240,18 +5208,20 @@
</span><span class="cx"> 
</span><span class="cx"> sub GetSVGPropertyTypes
</span><span class="cx"> {
</span><del>-    my $implType = shift;
</del><ins>+    my $interface = shift;
</ins><span class="cx"> 
</span><ins>+    my $interfaceName = $interface-&gt;name;
+
</ins><span class="cx">     my $svgPropertyType;
</span><span class="cx">     my $svgListPropertyType;
</span><span class="cx">     my $svgNativeType;
</span><span class="cx"> 
</span><del>-    return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $implType =~ /SVG/;
</del><ins>+    return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $interfaceName =~ /SVG/;
</ins><span class="cx"> 
</span><del>-    $svgNativeType = $codeGenerator-&gt;GetSVGTypeNeedingTearOff($implType);
</del><ins>+    $svgNativeType = $codeGenerator-&gt;GetSVGTypeNeedingTearOffForType($interface-&gt;type);
</ins><span class="cx">     return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
</span><span class="cx"> 
</span><del>-    my $svgWrappedNativeType = $codeGenerator-&gt;GetSVGWrappedTypeNeedingTearOff($implType);
</del><ins>+    my $svgWrappedNativeType = $codeGenerator-&gt;GetSVGWrappedTypeNeedingTearOffForType($interface-&gt;type);
</ins><span class="cx">     if ($svgNativeType =~ /SVGPropertyTearOff/) {
</span><span class="cx">         $svgPropertyType = $svgWrappedNativeType;
</span><span class="cx">         $headerIncludes{&quot;$svgWrappedNativeType.h&quot;} = 1;
</span><span class="lines">@@ -5278,7 +5248,8 @@
</span><span class="cx"> sub IsNativeType
</span><span class="cx"> {
</span><span class="cx">     my $type = shift;
</span><del>-    return exists $nativeType{$type};
</del><ins>+
+    return exists $nativeType{$type-&gt;name};
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GetIntegerConversionConfiguration
</span><span class="lines">@@ -5309,11 +5280,11 @@
</span><span class="cx">     return 1 if $idlType-&gt;name eq &quot;boolean&quot;;
</span><span class="cx">     return 1 if $idlType-&gt;name eq &quot;Date&quot;;
</span><span class="cx">     return 1 if $idlType-&gt;name eq &quot;BufferSource&quot;;
</span><del>-    return 1 if $codeGenerator-&gt;IsIntegerType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsFloatingPointType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsDictionaryType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsStringType($idlType-&gt;name);
</del><ins>+    return 1 if $codeGenerator-&gt;IsIntegerType($idlType);
+    return 1 if $codeGenerator-&gt;IsFloatingPointType($idlType);
+    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType);
+    return 1 if $codeGenerator-&gt;IsDictionaryType($idlType);
+    return 1 if $codeGenerator-&gt;IsStringType($idlType);
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5323,7 +5294,6 @@
</span><span class="cx"> {
</span><span class="cx">     my ($interface, $signature, $value, $conditional, $statePointer, $stateReference, $thisObjectReference) = @_;
</span><span class="cx"> 
</span><del>-    my $type = $signature-&gt;type;
</del><span class="cx">     my $idlType = $signature-&gt;idlType;
</span><span class="cx"> 
</span><span class="cx">     # FIXME: Remove these 3 variables when all JSValueToNative use references.
</span><span class="lines">@@ -5340,43 +5310,39 @@
</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($signature)) if $codeGenerator-&gt;IsIntegerType($idlType);
+        push(@conversionArguments, GetStringConversionConfiguration($signature)) if $codeGenerator-&gt;IsStringType($idlType);
</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><del>-    if ($type eq &quot;DOMString&quot;) {
</del><ins>+    if ($idlType-&gt;name eq &quot;DOMString&quot;) {
</ins><span class="cx">         return (&quot;AtomicString($value.toString($statePointer)-&gt;toExistingAtomicString($statePointer))&quot;, 1) if $signature-&gt;extendedAttributes-&gt;{RequiresExistingAtomicString};
</span><span class="cx">         return (&quot;$value.toString($statePointer)-&gt;toAtomicString($statePointer)&quot;, 1) if $signature-&gt;extendedAttributes-&gt;{AtomicString};
</span><span class="cx">         assert(&quot;Unhandled string conversion.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ($type eq &quot;SerializedScriptValue&quot;) {
</del><ins>+    if ($idlType-&gt;name eq &quot;SerializedScriptValue&quot;) {
</ins><span class="cx">         AddToImplIncludes(&quot;SerializedScriptValue.h&quot;, $conditional);
</span><span class="cx">         return (&quot;SerializedScriptValue::create($stateReference, $value)&quot;, 1);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ($type eq &quot;Dictionary&quot;) {
</del><ins>+    if ($idlType-&gt;name eq &quot;Dictionary&quot;) {
</ins><span class="cx">         AddToImplIncludes(&quot;Dictionary.h&quot;, $conditional);
</span><span class="cx">         return (&quot;Dictionary($statePointer, $value)&quot;, 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return (&quot;to$type($value)&quot;, 1) if $codeGenerator-&gt;IsTypedArrayType($type);
-    
-    if ($codeGenerator-&gt;IsEnumType($type)) {
-        AddToImplIncludes(&quot;JS$type.h&quot;, $conditional) if $codeGenerator-&gt;IsExternalEnumType($type);
-        return (&quot;parseEnumeration&lt;&quot; . GetEnumerationClassName($type, $interface) . &quot;&gt;($stateReference, $value)&quot;, 1);
-    }
-    
-    AddToImplIncludes(&quot;JS$type.h&quot;, $conditional);
</del><ins>+    AddToImplIncludesForIDLType($idlType, $conditional);
</ins><span class="cx"> 
</span><ins>+    return (&quot;to@{[$idlType-&gt;name]}($value)&quot;, 1) if $codeGenerator-&gt;IsTypedArrayType($idlType);
+    return (&quot;parseEnumeration&lt;&quot; . GetEnumerationClassName($idlType, $interface) . &quot;&gt;($stateReference, $value)&quot;, 1) if $codeGenerator-&gt;IsEnumType($idlType);
+
</ins><span class="cx">     # FIXME: EventListener should be a callback interface.
</span><del>-    return &quot;JSEventListener::create($value, $thisObjectReference, false, currentWorld($statePointer))&quot; if $type eq &quot;EventListener&quot;;
</del><ins>+    return &quot;JSEventListener::create($value, $thisObjectReference, false, currentWorld($statePointer))&quot; if $idlType-&gt;name eq &quot;EventListener&quot;;
</ins><span class="cx"> 
</span><del>-    my $extendedAttributes = $codeGenerator-&gt;getInterfaceExtendedAttributesFromName($type);
-    return (&quot;JS${type}::toWrapped($stateReference, $value)&quot;, 1) if $type eq &quot;XPathNSResolver&quot;;
-    return (&quot;JS${type}::toWrapped($value)&quot;, 0);
</del><ins>+    my $extendedAttributes = $codeGenerator-&gt;GetInterfaceExtendedAttributesFromName($idlType-&gt;name);
+    return (&quot;JS&quot; . $idlType-&gt;name . &quot;::toWrapped($stateReference, $value)&quot;, 1) if $idlType-&gt;name eq &quot;XPathNSResolver&quot;;
+    return (&quot;JS&quot; . $idlType-&gt;name . &quot;::toWrapped($value)&quot;, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub NativeToJSValueIsHandledByDOMConvert
</span><span class="lines">@@ -5386,12 +5352,12 @@
</span><span class="cx">     return 1 if $idlType-&gt;name eq &quot;any&quot;;
</span><span class="cx">     return 1 if $idlType-&gt;name eq &quot;boolean&quot;;
</span><span class="cx">     return 1 if $idlType-&gt;name eq &quot;Date&quot;;
</span><del>-    return 1 if $codeGenerator-&gt;IsIntegerType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsFloatingPointType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsStringType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsEnumType($idlType-&gt;name);
</del><ins>+    return 1 if $codeGenerator-&gt;IsIntegerType($idlType);
+    return 1 if $codeGenerator-&gt;IsFloatingPointType($idlType);
+    return 1 if $codeGenerator-&gt;IsStringType($idlType);
+    return 1 if $codeGenerator-&gt;IsEnumType($idlType);
+    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType);
</ins><span class="cx">     return 1 if $idlType-&gt;isUnion;
</span><del>-    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType-&gt;name);
</del><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -5402,9 +5368,9 @@
</span><span class="cx">     
</span><span class="cx">     # FIXME: This should actually check if all the sub-objects of the union need the state.
</span><span class="cx">     return 1 if $idlType-&gt;isUnion;
</span><del>-    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsStringType($idlType-&gt;name);
-    return 1 if $codeGenerator-&gt;IsEnumType($idlType-&gt;name);
</del><ins>+    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType);
+    return 1 if $codeGenerator-&gt;IsStringType($idlType);
+    return 1 if $codeGenerator-&gt;IsEnumType($idlType);
</ins><span class="cx">     return 1 if $idlType-&gt;name eq &quot;Date&quot;;
</span><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="lines">@@ -5416,7 +5382,7 @@
</span><span class="cx">     
</span><span class="cx">     # FIXME: This should actually check if all the sub-objects of the union need the global object.
</span><span class="cx">     return 1 if $idlType-&gt;isUnion;
</span><del>-    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType-&gt;name);
</del><ins>+    return 1 if $codeGenerator-&gt;IsSequenceOrFrozenArrayType($idlType);
</ins><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -5449,7 +5415,6 @@
</span><span class="cx">     my ($signature, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject) = @_;
</span><span class="cx"> 
</span><span class="cx">     my $conditional = $signature-&gt;extendedAttributes-&gt;{Conditional};
</span><del>-    my $type = $signature-&gt;type;
</del><span class="cx">     my $idlType = $signature-&gt;idlType;
</span><span class="cx">     my $isNullable = $signature-&gt;isNullable;
</span><span class="cx">     my $mayThrowException = $signature-&gt;extendedAttributes-&gt;{GetterMayThrowException} || $signature-&gt;extendedAttributes-&gt;{MayThrowException};
</span><span class="lines">@@ -5456,12 +5421,12 @@
</span><span class="cx"> 
</span><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 eq &quot;unsigned long&quot; or $type eq &quot;unsigned short&quot;)) {
</del><ins>+    if ($signature-&gt;extendedAttributes-&gt;{Reflect} and ($idlType-&gt;name eq &quot;unsigned long&quot; or $idlType-&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><del>-    if ($type eq &quot;any&quot;) {
</del><ins>+    if ($idlType-&gt;name eq &quot;any&quot;) {
</ins><span class="cx">         my $returnType = $signature-&gt;extendedAttributes-&gt;{ImplementationReturnType};
</span><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="lines">@@ -5484,26 +5449,26 @@
</span><span class="cx">         return &quot;toJS&lt;$IDLType&gt;(&quot; . join(&quot;, &quot;, @conversionArguments) . &quot;)&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if ($type eq &quot;SerializedScriptValue&quot;) {
</del><ins>+    if ($idlType-&gt;name eq &quot;SerializedScriptValue&quot;) {
</ins><span class="cx">         AddToImplIncludes(&quot;SerializedScriptValue.h&quot;, $conditional);
</span><span class="cx">         return &quot;$value ? $value-&gt;deserialize($stateReference, $globalObject) : jsNull()&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    AddToImplIncludes(&quot;StyleProperties.h&quot;, $conditional) if $type eq &quot;CSSStyleDeclaration&quot;;
-    AddToImplIncludes(&quot;NameNodeList.h&quot;, $conditional) if $type eq &quot;NodeList&quot;;
-    AddToImplIncludes(&quot;JS$type.h&quot;, $conditional) if !$codeGenerator-&gt;IsTypedArrayType($type);
</del><ins>+    AddToImplIncludes(&quot;StyleProperties.h&quot;, $conditional) if $idlType-&gt;name eq &quot;CSSStyleDeclaration&quot;;
+    AddToImplIncludes(&quot;NameNodeList.h&quot;, $conditional) if $idlType-&gt;name eq &quot;NodeList&quot;;
+    AddToImplIncludes(&quot;JS&quot; . $idlType-&gt;name . &quot;.h&quot;, $conditional) if !$codeGenerator-&gt;IsTypedArrayType($idlType);
</ins><span class="cx"> 
</span><del>-    return $value if $codeGenerator-&gt;IsSVGAnimatedType($type);
</del><ins>+    return $value if $codeGenerator-&gt;IsSVGAnimatedType($idlType);
</ins><span class="cx"> 
</span><del>-    if ($codeGenerator-&gt;IsSVGAnimatedType($interface-&gt;name) or ($interface-&gt;name eq &quot;SVGViewSpec&quot; and $type eq &quot;SVGTransformList&quot;)) {
</del><ins>+    if ($codeGenerator-&gt;IsSVGAnimatedType($interface-&gt;type) or ($interface-&gt;name eq &quot;SVGViewSpec&quot; and $idlType-&gt;name eq &quot;SVGTransformList&quot;)) {
</ins><span class="cx">         # Convert from abstract RefPtr&lt;ListProperty&gt; to real type, so the right toJS() method can be invoked.
</span><del>-        $value = &quot;static_cast&lt;&quot; . GetNativeType($interface, $type) . &quot;&gt;($value.get())&quot;;
</del><ins>+        $value = &quot;static_cast&lt;&quot; . GetNativeType($interface, $idlType) . &quot;&gt;($value.get())&quot;;
</ins><span class="cx">     } elsif ($interface-&gt;name eq &quot;SVGViewSpec&quot;) {
</span><span class="cx">         # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
</span><del>-        $value = &quot;static_cast&lt;&quot; . GetNativeType($interface, $type) . &quot;&gt;($value)&quot;;
-    } elsif ($codeGenerator-&gt;IsSVGTypeNeedingTearOff($type) and not $interface-&gt;name =~ /List$/) {
-        my $tearOffType = $codeGenerator-&gt;GetSVGTypeNeedingTearOff($type);
-        if ($codeGenerator-&gt;IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and !$inFunctionCall and not defined $signature-&gt;extendedAttributes-&gt;{Immutable}) {
</del><ins>+        $value = &quot;static_cast&lt;&quot; . GetNativeType($interface, $idlType) . &quot;&gt;($value)&quot;;
+    } elsif ($codeGenerator-&gt;IsSVGTypeNeedingTearOffForType($idlType) and not $interface-&gt;type-&gt;name =~ /List$/) {
+        my $tearOffType = $codeGenerator-&gt;GetSVGTypeNeedingTearOffForType($idlType);
+        if ($codeGenerator-&gt;IsSVGTypeWithWritablePropertiesNeedingTearOffForType($idlType) and !$inFunctionCall and not defined $signature-&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">@@ -5510,7 +5475,7 @@
</span><span class="cx">             $getter =~ s/\(\)//;
</span><span class="cx">             my $updateMethod = &quot;&amp;&quot; . $interface-&gt;name . &quot;::update&quot; . $codeGenerator-&gt;WK_ucfirst($getter);
</span><span class="cx"> 
</span><del>-            my $selfIsTearOffType = $codeGenerator-&gt;IsSVGTypeNeedingTearOff($interface-&gt;name);
</del><ins>+            my $selfIsTearOffType = $codeGenerator-&gt;IsSVGTypeNeedingTearOffForType($interface-&gt;type);
</ins><span class="cx">             if ($selfIsTearOffType) {
</span><span class="cx">                 # FIXME: Why SVGMatrix specifically?
</span><span class="cx">                 AddToImplIncludes(&quot;SVGMatrixTearOff.h&quot;, $conditional);
</span><span class="lines">@@ -5727,7 +5692,7 @@
</span><span class="cx"> 
</span><span class="cx">         my $checkType = $include;
</span><span class="cx">         $checkType =~ s/\.h//;
</span><del>-        next if $codeGenerator-&gt;IsSVGAnimatedType($checkType);
</del><ins>+        next if $codeGenerator-&gt;IsSVGAnimatedTypeName($checkType);
</ins><span class="cx"> 
</span><span class="cx">         $include = &quot;\&quot;$include\&quot;&quot; unless $include =~ /^[&quot;&lt;]/; # &quot;
</span><span class="cx"> 
</span><span class="lines">@@ -6057,7 +6022,7 @@
</span><span class="cx">     # FIXME: IDL does not allow an interface without [NoInterfaceObject] to inherit one that is marked as [NoInterfaceObject]
</span><span class="cx">     # so we should be able to use our parent's interface object no matter what. However, some of our IDL files (e.g. CanvasRenderingContext2D)
</span><span class="cx">     # are not valid so we need this check for now.
</span><del>-    if ($interface-&gt;parent &amp;&amp; !$codeGenerator-&gt;getInterfaceExtendedAttributesFromName($interface-&gt;parent)-&gt;{NoInterfaceObject}) {
</del><ins>+    if ($interface-&gt;parent &amp;&amp; !$codeGenerator-&gt;GetInterfaceExtendedAttributesFromName($interface-&gt;parent)-&gt;{NoInterfaceObject}) {
</ins><span class="cx">         my $parentClassName = &quot;JS&quot; . $interface-&gt;parent;
</span><span class="cx">         push(@$outputArray, &quot;    return ${parentClassName}::getConstructor(vm, &amp;globalObject);\n&quot;);
</span><span class="cx">     } elsif ($interface-&gt;isCallback) {
</span><span class="lines">@@ -6137,7 +6102,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 eq &quot;Promise&quot;;
</del><ins>+    return $function-&gt;signature-&gt;idlType &amp;&amp; $function-&gt;signature-&gt;idlType-&gt;name eq &quot;Promise&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsConstructable
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -54,8 +54,9 @@
</span><span class="cx"> # Used to represent 'interface' blocks
</span><span class="cx"> struct( domInterface =&gt; {
</span><span class="cx">     name =&gt; '$',      # Class identifier
</span><ins>+    type =&gt; '$',      # Class type
</ins><span class="cx">     parent =&gt; '$',      # Parent class identifier
</span><del>-    parents =&gt; '@',      # Parent class identifiers (Kept for compatibility with ObjC bindings)
</del><ins>+    parentType =&gt; '$',      # Parent class type
</ins><span class="cx">     constants =&gt; '@',    # List of 'domConstant'
</span><span class="cx">     functions =&gt; '@',    # List of 'domFunction'
</span><span class="cx">     anonymousFunctions =&gt; '@', # List of 'domFunction'
</span><span class="lines">@@ -90,7 +91,6 @@
</span><span class="cx"> struct( domSignature =&gt; {
</span><span class="cx">     direction =&gt; '$',   # Variable direction (in or out)
</span><span class="cx">     name =&gt; '$',        # Variable name
</span><del>-    type =&gt; '$',        # Variable type name (DEPRECATED - please use idlType)
</del><span class="cx">     idlType =&gt; '$',     # Variable type
</span><span class="cx">     specials =&gt; '@',    # Specials
</span><span class="cx">     extendedAttributes =&gt; '$', # Extended attributes
</span><span class="lines">@@ -122,9 +122,9 @@
</span><span class="cx"> 
</span><span class="cx"> # Used to represent string constants
</span><span class="cx"> struct( domConstant =&gt; {
</span><del>-    name =&gt; '$',        # DOM Constant identifier
-    type =&gt; '$',        # Type of data
-    value =&gt; '$',       # Constant value
</del><ins>+    name =&gt; '$', # DOM Constant identifier
+    type =&gt; '$', # Type name of data
+    value =&gt; '$', # Constant value
</ins><span class="cx">     extendedAttributes =&gt; '$', # Extended attributes
</span><span class="cx"> });
</span><span class="cx"> 
</span><span class="lines">@@ -131,13 +131,16 @@
</span><span class="cx"> # Used to represent 'enum' definitions
</span><span class="cx"> struct( domEnum =&gt; {
</span><span class="cx">     name =&gt; '$', # Enumeration identifier
</span><ins>+    type =&gt; '$', # Enumeration type
</ins><span class="cx">     values =&gt; '@', # Enumeration values (list of unique strings)
</span><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> struct( domDictionary =&gt; {
</span><del>-    parent =&gt; '$',  # Parent class identifier
-    name =&gt; '$',
</del><ins>+    name =&gt; '$', # Dictionary identifier
+    type =&gt; '$', # Dictionary type
+    parent =&gt; '$',  # Parent identifier
+    parentType =&gt; '$',  # Parent type identifier
</ins><span class="cx">     members =&gt; '@', # List of 'domSignature'
</span><span class="cx">     extendedAttributes =&gt; '$',
</span><span class="cx"> });
</span><span class="lines">@@ -363,6 +366,16 @@
</span><span class="cx">     return $type;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub makeSimpleType
+{
+    my $typeName = shift;
+
+    my $type = domType-&gt;new();
+    $type-&gt;name($typeName);
+    
+    return $type;
+}
+
</ins><span class="cx"> my $nextAttribute_1 = '^(attribute|inherit|readonly)$';
</span><span class="cx"> my $nextPrimitiveType_1 = '^(int|long|short|unsigned)$';
</span><span class="cx"> my $nextPrimitiveType_2 = '^(double|float|unrestricted)$';
</span><span class="lines">@@ -477,8 +490,6 @@
</span><span class="cx">     # FIXME: This should be recursive.
</span><span class="cx">     my $numberOfSubtypes = scalar @{$signature-&gt;idlType-&gt;subtypes};
</span><span class="cx">     if ($numberOfSubtypes) {
</span><del>-        my $typeUpdated = 0;
-    
</del><span class="cx">         for my $i (0..$numberOfSubtypes - 1) {
</span><span class="cx">             my $subtype = @{$signature-&gt;idlType-&gt;subtypes}[$i];
</span><span class="cx">             my $subtypeName = $subtype-&gt;name;
</span><span class="lines">@@ -492,25 +503,8 @@
</span><span class="cx">                 $clonedType-&gt;isNullable($subtype-&gt;isNullable);
</span><span class="cx">                 
</span><span class="cx">                 @{$signature-&gt;idlType-&gt;subtypes}[$i] = $clonedType;
</span><del>-                
-                $typeUpdated = 1;
</del><span class="cx">             }
</span><span class="cx">         }
</span><del>-
-        # FIXME: This can be removed when we use domTypes in the CodeGenerators everywhere.
-        if ($typeUpdated) {
-            my $subtype = @{$signature-&gt;idlType-&gt;subtypes}[0];
-            my $subtypeName = $subtype-&gt;name;
-
-            if ($signature-&gt;idlType-&gt;name =~ /^sequence&lt;/) {
-                $signature-&gt;idlType-&gt;name(&quot;sequence&lt;${subtypeName}&gt;&quot;);
-                $signature-&gt;type($signature-&gt;idlType-&gt;name);
-            }
-            if ($signature-&gt;idlType-&gt;name =~ /^FrozenArray&lt;/) {
-                $signature-&gt;idlType-&gt;name(&quot;FrozenArray&lt;${subtypeName}&gt;&quot;);
-                $signature-&gt;type($signature-&gt;idlType-&gt;name);
-            }
-        }
</del><span class="cx">     
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -524,7 +518,6 @@
</span><span class="cx">         $clonedType-&gt;isNullable($signature-&gt;idlType-&gt;isNullable);
</span><span class="cx"> 
</span><span class="cx">         $signature-&gt;idlType($clonedType);
</span><del>-        $signature-&gt;type($clonedType-&gt;name);
</del><span class="cx">         $signature-&gt;isNullable($clonedType-&gt;isNullable);
</span><span class="cx"> 
</span><span class="cx">         copyExtendedAttributes($signature-&gt;extendedAttributes, $typedef-&gt;extendedAttributes);
</span><span class="lines">@@ -605,10 +598,18 @@
</span><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><del>-        $interface-&gt;name(identifierRemoveNullablePrefix($interfaceNameToken-&gt;value()));
-        my $parents = $self-&gt;parseInheritance();
-        $interface-&gt;parents($parents);
-        $interface-&gt;parent($parents-&gt;[0]);
</del><ins>+        
+        my $name = identifierRemoveNullablePrefix($interfaceNameToken-&gt;value());
+        $interface-&gt;name($name);
+        $interface-&gt;type(makeSimpleType($name));
+
+        $next = $self-&gt;nextToken();
+        if ($next-&gt;value() eq &quot;:&quot;) {
+            my $parent = $self-&gt;parseInheritance();
+            $interface-&gt;parent($parent);
+            $interface-&gt;parentType(makeSimpleType($parent));
+        }
+
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;{&quot;, __LINE__);
</span><span class="cx">         my $interfaceMembers = $self-&gt;parseInterfaceMembers();
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;}&quot;, __LINE__);
</span><span class="lines">@@ -715,11 +716,21 @@
</span><span class="cx">         my $dictionary = domDictionary-&gt;new();
</span><span class="cx">         $dictionary-&gt;extendedAttributes($extendedAttributeList);
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;dictionary&quot;, __LINE__);
</span><ins>+
</ins><span class="cx">         my $nameToken = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($nameToken, IdentifierToken);
</span><del>-        $dictionary-&gt;name($nameToken-&gt;value());
-        my $parents = $self-&gt;parseInheritance();
-        $dictionary-&gt;parent($parents-&gt;[0]);
</del><ins>+
+        my $name = $nameToken-&gt;value();
+        $dictionary-&gt;name($name);
+        $dictionary-&gt;type(makeSimpleType($name));
+
+        $next = $self-&gt;nextToken();
+        if ($next-&gt;value() eq &quot;:&quot;) {
+            my $parent = $self-&gt;parseInheritance();
+            $dictionary-&gt;parent($parent);
+            $dictionary-&gt;parentType(makeSimpleType($parent));
+        }
+        
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;{&quot;, __LINE__);
</span><span class="cx">         $dictionary-&gt;members($self-&gt;parseDictionaryMembers());
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;}&quot;, __LINE__);
</span><span class="lines">@@ -766,7 +777,6 @@
</span><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><span class="cx">         $member-&gt;idlType($type);
</span><del>-        $member-&gt;type($type-&gt;name);
</del><span class="cx">         $member-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx"> 
</span><span class="cx">         my $nameToken = $self-&gt;getToken();
</span><span class="lines">@@ -835,11 +845,19 @@
</span><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><del>-        $interface-&gt;name(identifierRemoveNullablePrefix($exceptionNameToken-&gt;value()));
</del><ins>+
+        my $name = identifierRemoveNullablePrefix($exceptionNameToken-&gt;value());
+        $interface-&gt;name($name);
+        $interface-&gt;type(makeSimpleType($name));
</ins><span class="cx">         $interface-&gt;isException(1);
</span><del>-        my $parents = $self-&gt;parseInheritance();
-        $interface-&gt;parents($parents);
-        $interface-&gt;parent($parents-&gt;[0]);
</del><ins>+
+        $next = $self-&gt;nextToken();
+        if ($next-&gt;value() eq &quot;:&quot;) {
+            my $parent = $self-&gt;parseInheritance();
+            $interface-&gt;parent($parent);
+            $interface-&gt;parentType(makeSimpleType($parent));
+        }
+        
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;{&quot;, __LINE__);
</span><span class="cx">         my $exceptionMembers = $self-&gt;parseExceptionMembers();
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;}&quot;, __LINE__);
</span><span class="lines">@@ -875,18 +893,13 @@
</span><span class="cx"> sub parseInheritance
</span><span class="cx"> {
</span><span class="cx">     my $self = shift;
</span><del>-    my @parent = ();
</del><span class="cx"> 
</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 $name = $self-&gt;parseName();
-        push(@parent, $name);
-
-        # FIXME: Remove. Was needed for needed for ObjC bindings.
-        push(@parent, @{$self-&gt;parseIdentifiers()});
</del><ins>+        return $self-&gt;parseName();
</ins><span class="cx">     }
</span><del>-    return \@parent;
</del><ins>+    $self-&gt;assertUnexpectedToken($next-&gt;value(), __LINE__);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub parseEnum
</span><span class="lines">@@ -900,7 +913,9 @@
</span><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><del>-        $enum-&gt;name(identifierRemoveNullablePrefix($enumNameToken-&gt;value()));
</del><ins>+        my $name = identifierRemoveNullablePrefix($enumNameToken-&gt;value());
+        $enum-&gt;name($name);
+        $enum-&gt;type(makeSimpleType($name));
</ins><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;{&quot;, __LINE__);
</span><span class="cx">         push(@{$enum-&gt;values}, @{$self-&gt;parseEnumValueList()});
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;}&quot;, __LINE__);
</span><span class="lines">@@ -1015,10 +1030,8 @@
</span><span class="cx">     if ($next-&gt;value() eq &quot;const&quot;) {
</span><span class="cx">         my $newDataNode = domConstant-&gt;new();
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;const&quot;, __LINE__);
</span><del>-        
</del><span class="cx">         my $type = $self-&gt;parseConstType();
</span><del>-        $newDataNode-&gt;type($type-&gt;name);
-
</del><ins>+        $newDataNode-&gt;type($type);
</ins><span class="cx">         my $constNameToken = $self-&gt;getToken();
</span><span class="cx">         $self-&gt;assertTokenType($constNameToken, IdentifierToken);
</span><span class="cx">         $newDataNode-&gt;name(identifierRemoveNullablePrefix($constNameToken-&gt;value()));
</span><span class="lines">@@ -1286,7 +1299,6 @@
</span><span class="cx">         my $interface = $self-&gt;parseOperationRest($extendedAttributeList);
</span><span class="cx">         if (defined ($interface)) {
</span><span class="cx">             $interface-&gt;signature-&gt;idlType($returnType);
</span><del>-            $interface-&gt;signature-&gt;type($returnType-&gt;name);
</del><span class="cx">             $interface-&gt;signature-&gt;isNullable($returnType-&gt;isNullable);
</span><span class="cx">         }
</span><span class="cx">         return $interface;
</span><span class="lines">@@ -1326,7 +1338,6 @@
</span><span class="cx">         
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><span class="cx">         $newDataNode-&gt;signature-&gt;idlType($type);
</span><del>-        $newDataNode-&gt;signature-&gt;type($type-&gt;name);
</del><span class="cx">         $newDataNode-&gt;signature-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx"> 
</span><span class="cx">         my $token = $self-&gt;getToken();
</span><span class="lines">@@ -1384,7 +1395,6 @@
</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><span class="cx">             $operation-&gt;signature-&gt;idlType($returnType);
</span><del>-            $operation-&gt;signature-&gt;type($returnType-&gt;name);
</del><span class="cx">             $operation-&gt;signature-&gt;isNullable($returnType-&gt;isNullable);
</span><span class="cx"> 
</span><span class="cx">             return $operation;
</span><span class="lines">@@ -1406,7 +1416,6 @@
</span><span class="cx">         my $interface = $self-&gt;parseOperationRest($extendedAttributeList);
</span><span class="cx">         if (defined ($interface)) {
</span><span class="cx">             $interface-&gt;signature-&gt;idlType($returnType);
</span><del>-            $interface-&gt;signature-&gt;type($returnType-&gt;name);
</del><span class="cx">             $interface-&gt;signature-&gt;isNullable($returnType-&gt;isNullable);
</span><span class="cx">             $interface-&gt;signature-&gt;specials(\@specials);
</span><span class="cx">         }
</span><span class="lines">@@ -1504,7 +1513,7 @@
</span><span class="cx">     $forEachFunction-&gt;signature-&gt;name(&quot;forEach&quot;);
</span><span class="cx">     my $forEachArgument = domSignature-&gt;new();
</span><span class="cx">     $forEachArgument-&gt;name(&quot;callback&quot;);
</span><del>-    $forEachArgument-&gt;type(&quot;any&quot;);
</del><ins>+    $forEachArgument-&gt;idlType(makeSimpleType(&quot;any&quot;));
</ins><span class="cx">     push(@{$forEachFunction-&gt;parameters}, ($forEachArgument));
</span><span class="cx"> 
</span><span class="cx">     my $newDataNode = domIterable-&gt;new();
</span><span class="lines">@@ -1627,7 +1636,6 @@
</span><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><span class="cx">         $paramDataNode-&gt;idlType($type);
</span><del>-        $paramDataNode-&gt;type(identifierRemoveNullablePrefix($type-&gt;name));
</del><span class="cx">         $paramDataNode-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx">         $paramDataNode-&gt;isOptional(1);
</span><span class="cx">         $paramDataNode-&gt;name($self-&gt;parseArgumentName());
</span><span class="lines">@@ -1637,7 +1645,6 @@
</span><span class="cx">     if ($next-&gt;type() == IdentifierToken || $next-&gt;value() =~ /$nextExceptionField_1/) {
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><span class="cx">         $paramDataNode-&gt;idlType($type);
</span><del>-        $paramDataNode-&gt;type($type-&gt;name);
</del><span class="cx">         $paramDataNode-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx">         $paramDataNode-&gt;isOptional(0);
</span><span class="cx">         $paramDataNode-&gt;isVariadic($self-&gt;parseEllipsis());
</span><span class="lines">@@ -1700,7 +1707,6 @@
</span><span class="cx"> 
</span><span class="cx">         my $type = $self-&gt;parseType();
</span><span class="cx">         $newDataNode-&gt;signature-&gt;idlType($type);
</span><del>-        $newDataNode-&gt;signature-&gt;type($type-&gt;name);
</del><span class="cx">         $newDataNode-&gt;signature-&gt;isNullable($type-&gt;isNullable);
</span><span class="cx">         
</span><span class="cx">         my $token = $self-&gt;getToken();
</span><span class="lines">@@ -2116,8 +2122,7 @@
</span><span class="cx"> 
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;&gt;&quot;, __LINE__);
</span><span class="cx"> 
</span><del>-        # FIXME: This should just be &quot;sequence&quot; when we start using domTypes in the CodeGenerators
-        $type-&gt;name(&quot;sequence&lt;${subtypeName}&gt;&quot;);
</del><ins>+        $type-&gt;name(&quot;sequence&quot;);
</ins><span class="cx">         push(@{$type-&gt;subtypes}, $subtype);
</span><span class="cx"> 
</span><span class="cx">         return $type;
</span><span class="lines">@@ -2131,8 +2136,7 @@
</span><span class="cx"> 
</span><span class="cx">         $self-&gt;assertTokenValue($self-&gt;getToken(), &quot;&gt;&quot;, __LINE__);
</span><span class="cx"> 
</span><del>-        # FIXME: This should just be &quot;FrozenArray&quot; when we start using domTypes in the CodeGenerators
-        $type-&gt;name(&quot;FrozenArray&lt;${subtypeName}&gt;&quot;);
</del><ins>+        $type-&gt;name(&quot;FrozenArray&quot;);
</ins><span class="cx">         push(@{$type-&gt;subtypes}, $subtype);
</span><span class="cx"> 
</span><span class="cx">         return $type;
</span><span class="lines">@@ -2349,7 +2353,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 =~ /$serializable_types/;
</del><ins>+    return $attribute-&gt;signature-&gt;idlType-&gt;name =~ /$serializable_types/;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub applyMemberList
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><span class="cx"> #include &quot;JSDOMConvert.h&quot;
</span><span class="cx"> #include &quot;JSNode.h&quot;
</span><del>-#include &quot;Node.h&quot;
</del><span class="cx"> #include &quot;wtf/text/AtomicString.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/PropertyNameArray.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><span class="cx"> #include &quot;JSDOMConvert.h&quot;
</span><del>-#include &quot;TestObj.h&quot;
</del><ins>+#include &quot;JSTestObj.h&quot;
</ins><span class="cx"> #include &quot;TestSupplemental.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/FunctionPrototype.h&gt;
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition22) || ENABLE(Condition23)
</span><span class="cx"> #include &quot;JSNode.h&quot;
</span><del>-#include &quot;JSTestObj.h&quot;
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -22,10 +22,8 @@
</span><span class="cx"> #include &quot;JSTestObj.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CallbackFunction.h&quot;
</span><del>-#include &quot;DOMStringList.h&quot;
</del><span class="cx"> #include &quot;Dictionary.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;Element.h&quot;
</del><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="lines">@@ -56,8 +54,6 @@
</span><span class="cx"> #include &quot;JSTestSubObj.h&quot;
</span><span class="cx"> #include &quot;JSXPathNSResolver.h&quot;
</span><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><del>-#include &quot;SVGDocument.h&quot;
-#include &quot;SVGPoint.h&quot;
</del><span class="cx"> #include &quot;SVGStaticPropertyTearOff.h&quot;
</span><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;JSDOMConvert.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/FunctionPrototype.h&gt;
</span><ins>+#include &lt;runtime/JSArray.h&gt;
</ins><span class="cx"> #include &lt;wtf/GetPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><span class="cx"> #include &quot;JSDOMConvert.h&quot;
</span><span class="cx"> #include &quot;JSNode.h&quot;
</span><del>-#include &quot;Node.h&quot;
</del><span class="cx"> #include &quot;wtf/text/AtomicString.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/FunctionPrototype.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;JSMessagePort.h&quot;
</span><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><span class="cx"> #include &lt;runtime/FunctionPrototype.h&gt;
</span><ins>+#include &lt;runtime/JSArray.h&gt;
</ins><span class="cx"> #include &lt;wtf/GetPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include &quot;JSTestCallback.h&quot;
</span><span class="cx"> #include &quot;JSTestEventTarget.h&quot;
</span><span class="cx"> #include &quot;JSTestSubObj.h&quot;
</span><del>-#include &quot;SVGPoint.h&quot;
</del><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="cx"> #include &lt;runtime/FunctionPrototype.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLEmbedElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLEmbedElement.idl (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLEmbedElement.idl        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.idl        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -23,13 +23,13 @@
</span><span class="cx">     JSCustomGetOwnPropertySlotAndDescriptor,
</span><span class="cx">     CustomCall,
</span><span class="cx"> ] interface HTMLEmbedElement : HTMLElement {
</span><del>-[Reflect] attribute DOMString align;
-[Reflect] attribute DOMString height;
-[Reflect] attribute DOMString name;
-[Reflect, URL] attribute USVString src;
-[Reflect] attribute DOMString type;
-[Reflect] attribute DOMString width;
</del><ins>+    [Reflect] attribute DOMString align;
+    [Reflect] attribute DOMString height;
+    [Reflect] attribute DOMString name;
+    [Reflect, URL] attribute USVString src;
+    [Reflect] attribute DOMString type;
+    [Reflect] attribute DOMString width;
</ins><span class="cx"> 
</span><del>-[CheckSecurityForNode, MayThrowLegacyException] SVGDocument getSVGDocument();
</del><ins>+    [CheckSecurityForNode, MayThrowLegacyException] Document getSVGDocument();
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFrameElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFrameElement.idl (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFrameElement.idl        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/html/HTMLFrameElement.idl        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">     // Extensions
</span><span class="cx">     readonly attribute DOMWindow contentWindow;
</span><span class="cx"> 
</span><del>-    [CheckSecurityForNode, MayThrowLegacyException] SVGDocument getSVGDocument();
</del><ins>+    [CheckSecurityForNode, MayThrowLegacyException] Document getSVGDocument();
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: No other browser has this attribute.
</span><span class="cx">     [CustomSetter] attribute DOMString location;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFrameOwnerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">     return m_contentFrame &amp;&amp; HTMLElement::isKeyboardFocusable(event);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SVGDocument* HTMLFrameOwnerElement::getSVGDocument(ExceptionCode&amp; ec) const
</del><ins>+Document* HTMLFrameOwnerElement::getSVGDocument(ExceptionCode&amp; ec) const
</ins><span class="cx"> {
</span><span class="cx">     Document* document = contentDocument();
</span><span class="cx">     if (is&lt;SVGDocument&gt;(document))
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFrameOwnerElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFrameOwnerElement.h (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFrameOwnerElement.h        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/html/HTMLFrameOwnerElement.h        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     // RenderElement when using fallback content.
</span><span class="cx">     RenderWidget* renderWidget() const;
</span><span class="cx"> 
</span><del>-    SVGDocument* getSVGDocument(ExceptionCode&amp;) const;
</del><ins>+    Document* getSVGDocument(ExceptionCode&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     virtual ScrollbarMode scrollingMode() const { return ScrollbarAuto; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLIFrameElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLIFrameElement.idl (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLIFrameElement.idl        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/html/HTMLIFrameElement.idl        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -41,6 +41,6 @@
</span><span class="cx">     // Extensions
</span><span class="cx">     readonly attribute DOMWindow contentWindow;
</span><span class="cx"> 
</span><del>-    [CheckSecurityForNode, MayThrowLegacyException] SVGDocument getSVGDocument();
</del><ins>+    [CheckSecurityForNode, MayThrowLegacyException] Document getSVGDocument();
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.idl (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.idl        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Source/WebCore/html/HTMLObjectElement.idl        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -50,6 +50,6 @@
</span><span class="cx">     // Introduced in DOM Level 2:
</span><span class="cx">     [CheckSecurityForNode] readonly attribute Document contentDocument;
</span><span class="cx"> 
</span><del>-    [CheckSecurityForNode, MayThrowLegacyException] SVGDocument getSVGDocument();
</del><ins>+    [CheckSecurityForNode, MayThrowLegacyException] Document getSVGDocument();
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Tools/ChangeLog        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-10-27  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
+        https://bugs.webkit.org/show_bug.cgi?id=164089
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
+        * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+        Update for the removal of domSignature::type, and new signatures of helper predicates.
+
</ins><span class="cx"> 2016-10-27  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r207992.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeBindingsCodeGeneratorDumpRenderTreepm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> sub _classRefGetter
</span><span class="cx"> {
</span><span class="cx">     my ($self, $idlType) = @_;
</span><ins>+
</ins><span class="cx">     return $$self{codeGenerator}-&gt;WK_lcfirst(_implementationClassName($idlType)) . &quot;Class&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -141,7 +142,7 @@
</span><span class="cx"> 
</span><span class="cx">     my @contents = ();
</span><span class="cx"> 
</span><del>-    my $idlType = $interface-&gt;name;
</del><ins>+    my $idlType = $interface-&gt;type;
</ins><span class="cx">     my $className = _className($idlType);
</span><span class="cx">     my $implementationClassName = _implementationClassName($idlType);
</span><span class="cx">     my $filename = $className . &quot;.h&quot;;
</span><span class="lines">@@ -208,7 +209,7 @@
</span><span class="cx">     my %contentsIncludes = ();
</span><span class="cx">     my @contents = ();
</span><span class="cx"> 
</span><del>-    my $idlType = $interface-&gt;name;
</del><ins>+    my $idlType = $interface-&gt;type;
</ins><span class="cx">     my $className = _className($idlType);
</span><span class="cx">     my $implementationClassName = _implementationClassName($idlType);
</span><span class="cx">     my $filename = $className . &quot;.cpp&quot;;
</span><span class="lines">@@ -283,7 +284,7 @@
</span><span class="cx">                 my @parameters = ();
</span><span class="cx">                 my @specifiedParameters = @{$function-&gt;parameters};
</span><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;signature-&gt;idlType, $function-&gt;signature);
</ins><span class="cx"> 
</span><span class="cx">                 if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;PassContext&quot;}) {
</span><span class="cx">                     push(@parameters, &quot;context&quot;);
</span><span class="lines">@@ -302,7 +303,7 @@
</span><span class="cx">                 $functionCall = &quot;impl-&gt;&quot; . $function-&gt;signature-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @parameters) . &quot;)&quot;;
</span><span class="cx">             }
</span><span class="cx">             
</span><del>-            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;signature-&gt;type eq &quot;void&quot;;
</del><ins>+            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;signature-&gt;idlType-&gt;name eq &quot;void&quot;;
</ins><span class="cx">             push(@contents, &quot;    return &quot; . $self-&gt;_returnExpression($function-&gt;signature, $functionCall) . &quot;;\n}\n&quot;);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -310,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;signature-&gt;idlType, $attribute-&gt;signature);
</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">@@ -367,10 +368,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    my $signature = $attribute-&gt;signature;
-    my $name = $signature-&gt;name;
-
-    return $name;
</del><ins>+    return $attribute-&gt;signature-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _includeHeaders
</span><span class="lines">@@ -378,8 +376,8 @@
</span><span class="cx">     my ($self, $headers, $idlType, $signature) = @_;
</span><span class="cx"> 
</span><span class="cx">     return unless defined $idlType;
</span><del>-    return if $idlType eq &quot;boolean&quot;;
-    return if $idlType eq &quot;object&quot;;
</del><ins>+    return if $idlType-&gt;name eq &quot;boolean&quot;;
+    return if $idlType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return if $$self{codeGenerator}-&gt;IsNonPointerType($idlType);
</span><span class="cx">     return if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="cx"> 
</span><span class="lines">@@ -391,7 +389,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($idlType) = @_;
</span><span class="cx"> 
</span><del>-    return $idlType;
</del><ins>+    return $idlType-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _parentClassName
</span><span class="lines">@@ -413,7 +411,7 @@
</span><span class="cx"> sub _parentInterface
</span><span class="cx"> {
</span><span class="cx">     my ($interface) = @_;
</span><del>-    return $interface-&gt;parent;
</del><ins>+    return $interface-&gt;parentType;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _platformType
</span><span class="lines">@@ -422,8 +420,8 @@
</span><span class="cx"> 
</span><span class="cx">     return undef unless defined $idlType;
</span><span class="cx"> 
</span><del>-    return &quot;bool&quot; if $idlType eq &quot;boolean&quot;;
-    return &quot;JSValueRef&quot; if $idlType eq &quot;object&quot;;
</del><ins>+    return &quot;bool&quot; if $idlType-&gt;name eq &quot;boolean&quot;;
+    return &quot;JSValueRef&quot; if $idlType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return &quot;JSRetainPtr&lt;JSStringRef&gt;&quot; if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="cx">     return &quot;double&quot; if $$self{codeGenerator}-&gt;IsNonPointerType($idlType);
</span><span class="cx">     return _implementationClassName($idlType);
</span><span class="lines">@@ -433,10 +431,10 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $signature, $argumentName) = @_;
</span><span class="cx"> 
</span><del>-    my $idlType = $signature-&gt;type;
</del><ins>+    my $idlType = $signature-&gt;idlType;
</ins><span class="cx"> 
</span><span class="cx">     return &quot;JSValueToBoolean(context, $argumentName)&quot; if $idlType eq &quot;boolean&quot;;
</span><del>-    return &quot;$argumentName&quot; if $idlType eq &quot;object&quot;;
</del><ins>+    return &quot;$argumentName&quot; if $idlType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return &quot;JSRetainPtr&lt;JSStringRef&gt;(Adopt, JSValueToStringCopy(context, $argumentName, 0))&quot; if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="cx">     return &quot;JSValueToNumber(context, $argumentName, 0)&quot; if $$self{codeGenerator}-&gt;IsNonPointerType($idlType);
</span><span class="cx">     return &quot;to&quot; . _implementationClassName($idlType) . &quot;(context, $argumentName)&quot;;
</span><span class="lines">@@ -446,7 +444,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $signature, $variableName, $argumentName, $condition) = @_;
</span><span class="cx"> 
</span><del>-    my $platformType = $self-&gt;_platformType($signature-&gt;type, $signature);
</del><ins>+    my $platformType = $self-&gt;_platformType($signature-&gt;idlType, $signature);
</ins><span class="cx">     my $constructor = $self-&gt;_platformTypeConstructor($signature, $argumentName);
</span><span class="cx"> 
</span><span class="cx">     my %nonPointerTypes = (
</span><span class="lines">@@ -474,11 +472,11 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $signature, $expression) = @_;
</span><span class="cx"> 
</span><del>-    my $returnIDLType = $signature-&gt;type;
</del><ins>+    my $returnIDLType = $signature-&gt;idlType;
</ins><span class="cx"> 
</span><del>-    return &quot;JSValueMakeUndefined(context)&quot; if $returnIDLType eq &quot;void&quot;;
-    return &quot;JSValueMakeBoolean(context, ${expression})&quot; if $returnIDLType eq &quot;boolean&quot;;
-    return &quot;${expression}&quot; if $returnIDLType eq &quot;object&quot;;
</del><ins>+    return &quot;JSValueMakeUndefined(context)&quot; if $returnIDLType-&gt;name eq &quot;void&quot;;
+    return &quot;JSValueMakeBoolean(context, ${expression})&quot; if $returnIDLType-&gt;name eq &quot;boolean&quot;;
+    return &quot;${expression}&quot; if $returnIDLType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return &quot;JSValueMakeNumber(context, ${expression})&quot; if $$self{codeGenerator}-&gt;IsNonPointerType($returnIDLType);
</span><span class="cx">     return &quot;JSValueMakeStringOrNull(context, ${expression}.get())&quot; if $$self{codeGenerator}-&gt;IsStringType($returnIDLType);
</span><span class="cx">     return &quot;toJS(context, WTF::getPtr(${expression}))&quot;;
</span><span class="lines">@@ -488,7 +486,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $parameter) = @_;
</span><span class="cx"> 
</span><del>-    my $idlType = $parameter-&gt;type;
</del><ins>+    my $idlType = $parameter-&gt;idlType;
</ins><span class="cx">     my $name = $parameter-&gt;name;
</span><span class="cx"> 
</span><span class="cx">     return &quot;${name}.get()&quot; if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="lines">@@ -523,7 +521,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $interface, $functionOrValue, $arrayTerminator, $mapFunction, $functionsOrAttributes) = @_;
</span><span class="cx"> 
</span><del>-    my $className = _className($interface-&gt;name);
</del><ins>+    my $className = _className($interface-&gt;type);
</ins><span class="cx">     my $uppercaseFunctionOrValue = $$self{codeGenerator}-&gt;WK_ucfirst($functionOrValue);
</span><span class="cx"> 
</span><span class="cx">     my $result = &lt;&lt;EOF;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsCodeGeneratorTestRunnerpm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm (208022 => 208023)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm        2016-10-28 01:45:11 UTC (rev 208022)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm        2016-10-28 02:03:05 UTC (rev 208023)
</span><span class="lines">@@ -28,6 +28,19 @@
</span><span class="cx"> 
</span><span class="cx"> package CodeGeneratorTestRunner;
</span><span class="cx"> 
</span><ins>+use Carp qw&lt;longmess&gt;;
+use Data::Dumper;
+
+sub assert
+{
+    my $message = shift;
+    
+    my $mess = longmess();
+    print Dumper($mess);
+
+    die $message;
+}
+
</ins><span class="cx"> sub new
</span><span class="cx"> {
</span><span class="cx">     my ($class, $codeGenerator, $writeDependencies, $verbose, $idlFilePath) = @_;
</span><span class="lines">@@ -58,6 +71,8 @@
</span><span class="cx"> {
</span><span class="cx">     my ($idlType) = @_;
</span><span class="cx"> 
</span><ins>+    assert(&quot;Not a type&quot;) if ref($idlType) ne &quot;domType&quot;;
+
</ins><span class="cx">     return &quot;JS&quot; . _implementationClassName($idlType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -142,7 +157,7 @@
</span><span class="cx"> 
</span><span class="cx">     my @contents = ();
</span><span class="cx"> 
</span><del>-    my $idlType = $interface-&gt;name;
</del><ins>+    my $idlType = $interface-&gt;type;
</ins><span class="cx">     my $className = _className($idlType);
</span><span class="cx">     my $implementationClassName = _implementationClassName($idlType);
</span><span class="cx">     my $filename = $className . &quot;.h&quot;;
</span><span class="lines">@@ -209,7 +224,7 @@
</span><span class="cx">     my %contentsIncludes = ();
</span><span class="cx">     my @contents = ();
</span><span class="cx"> 
</span><del>-    my $idlType = $interface-&gt;name;
</del><ins>+    my $idlType = $interface-&gt;type;
</ins><span class="cx">     my $className = _className($idlType);
</span><span class="cx">     my $implementationClassName = _implementationClassName($idlType);
</span><span class="cx">     my $filename = $className . &quot;.cpp&quot;;
</span><span class="lines">@@ -244,7 +259,7 @@
</span><span class="cx">     static JSClassRef jsClass;
</span><span class="cx">     if (!jsClass) {
</span><span class="cx">         JSClassDefinition definition = kJSClassDefinitionEmpty;
</span><del>-        definition.className = &quot;${idlType}&quot;;
</del><ins>+        definition.className = &quot;@{[$idlType-&gt;name]}&quot;;
</ins><span class="cx">         definition.parentClass = @{[$self-&gt;_parentClassRefGetterExpression($interface)]};
</span><span class="cx">         definition.staticValues = staticValues();
</span><span class="cx">         definition.staticFunctions = staticFunctions();
</span><span class="lines">@@ -284,7 +299,7 @@
</span><span class="cx">                 my @parameters = ();
</span><span class="cx">                 my @specifiedParameters = @{$function-&gt;parameters};
</span><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;signature-&gt;idlType, $function-&gt;signature);
</ins><span class="cx"> 
</span><span class="cx">                 if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;PassContext&quot;}) {
</span><span class="cx">                     push(@parameters, &quot;context&quot;);
</span><span class="lines">@@ -303,7 +318,7 @@
</span><span class="cx">                 $functionCall = &quot;impl-&gt;&quot; . $function-&gt;signature-&gt;name . &quot;(&quot; . join(&quot;, &quot;, @parameters) . &quot;)&quot;;
</span><span class="cx">             }
</span><span class="cx">             
</span><del>-            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;signature-&gt;type eq &quot;void&quot;;
</del><ins>+            push(@contents, &quot;    ${functionCall};\n\n&quot;) if $function-&gt;signature-&gt;idlType-&gt;name eq &quot;void&quot;;
</ins><span class="cx">             push(@contents, &quot;    return &quot; . $self-&gt;_returnExpression($function-&gt;signature, $functionCall) . &quot;;\n}\n&quot;);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -311,7 +326,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;signature-&gt;idlType, $attribute-&gt;signature);
</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">@@ -368,10 +383,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $attribute) = @_;
</span><span class="cx"> 
</span><del>-    my $signature = $attribute-&gt;signature;
-    my $name = $signature-&gt;name;
-
-    return $name;
</del><ins>+    return $attribute-&gt;signature-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _includeHeaders
</span><span class="lines">@@ -379,8 +391,8 @@
</span><span class="cx">     my ($self, $headers, $idlType, $signature) = @_;
</span><span class="cx"> 
</span><span class="cx">     return unless defined $idlType;
</span><del>-    return if $idlType eq &quot;boolean&quot;;
-    return if $idlType eq &quot;object&quot;;
</del><ins>+    return if $idlType-&gt;name eq &quot;boolean&quot;;
+    return if $idlType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return if $$self{codeGenerator}-&gt;IsNonPointerType($idlType);
</span><span class="cx">     return if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="cx"> 
</span><span class="lines">@@ -392,7 +404,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($idlType) = @_;
</span><span class="cx"> 
</span><del>-    return $idlType;
</del><ins>+    return $idlType-&gt;name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _parentClassName
</span><span class="lines">@@ -414,7 +426,7 @@
</span><span class="cx"> sub _parentInterface
</span><span class="cx"> {
</span><span class="cx">     my ($interface) = @_;
</span><del>-    return $interface-&gt;parent;
</del><ins>+    return $interface-&gt;parentType;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub _platformType
</span><span class="lines">@@ -423,8 +435,8 @@
</span><span class="cx"> 
</span><span class="cx">     return undef unless defined $idlType;
</span><span class="cx"> 
</span><del>-    return &quot;bool&quot; if $idlType eq &quot;boolean&quot;;
-    return &quot;JSValueRef&quot; if $idlType eq &quot;object&quot;;
</del><ins>+    return &quot;bool&quot; if $idlType-&gt;name eq &quot;boolean&quot;;
+    return &quot;JSValueRef&quot; if $idlType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return &quot;JSRetainPtr&lt;JSStringRef&gt;&quot; if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="cx">     return &quot;double&quot; if $$self{codeGenerator}-&gt;IsNonPointerType($idlType);
</span><span class="cx">     return _implementationClassName($idlType);
</span><span class="lines">@@ -434,10 +446,10 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $signature, $argumentName) = @_;
</span><span class="cx"> 
</span><del>-    my $idlType = $signature-&gt;type;
</del><ins>+    my $idlType = $signature-&gt;idlType;
</ins><span class="cx"> 
</span><del>-    return &quot;JSValueToBoolean(context, $argumentName)&quot; if $idlType eq &quot;boolean&quot;;
-    return &quot;$argumentName&quot; if $idlType eq &quot;object&quot;;
</del><ins>+    return &quot;JSValueToBoolean(context, $argumentName)&quot; if $idlType-&gt;name eq &quot;boolean&quot;;
+    return &quot;$argumentName&quot; if $idlType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return &quot;JSRetainPtr&lt;JSStringRef&gt;(Adopt, JSValueToStringCopy(context, $argumentName, 0))&quot; if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="cx">     return &quot;JSValueToNumber(context, $argumentName, 0)&quot; if $$self{codeGenerator}-&gt;IsNonPointerType($idlType);
</span><span class="cx">     return &quot;to&quot; . _implementationClassName($idlType) . &quot;(context, $argumentName)&quot;;
</span><span class="lines">@@ -447,7 +459,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $signature, $variableName, $argumentName, $condition) = @_;
</span><span class="cx"> 
</span><del>-    my $platformType = $self-&gt;_platformType($signature-&gt;type, $signature);
</del><ins>+    my $platformType = $self-&gt;_platformType($signature-&gt;idlType, $signature);
</ins><span class="cx">     my $constructor = $self-&gt;_platformTypeConstructor($signature, $argumentName);
</span><span class="cx"> 
</span><span class="cx">     my %nonPointerTypes = (
</span><span class="lines">@@ -475,11 +487,11 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $signature, $expression) = @_;
</span><span class="cx"> 
</span><del>-    my $returnIDLType = $signature-&gt;type;
</del><ins>+    my $returnIDLType = $signature-&gt;idlType;
</ins><span class="cx"> 
</span><del>-    return &quot;JSValueMakeUndefined(context)&quot; if $returnIDLType eq &quot;void&quot;;
-    return &quot;JSValueMakeBoolean(context, ${expression})&quot; if $returnIDLType eq &quot;boolean&quot;;
-    return &quot;${expression}&quot; if $returnIDLType eq &quot;object&quot;;
</del><ins>+    return &quot;JSValueMakeUndefined(context)&quot; if $returnIDLType-&gt;name eq &quot;void&quot;;
+    return &quot;JSValueMakeBoolean(context, ${expression})&quot; if $returnIDLType-&gt;name eq &quot;boolean&quot;;
+    return &quot;${expression}&quot; if $returnIDLType-&gt;name eq &quot;object&quot;;
</ins><span class="cx">     return &quot;JSValueMakeNumber(context, ${expression})&quot; if $$self{codeGenerator}-&gt;IsNonPointerType($returnIDLType);
</span><span class="cx">     return &quot;JSValueMakeStringOrNull(context, ${expression}.get())&quot; if $$self{codeGenerator}-&gt;IsStringType($returnIDLType);
</span><span class="cx">     return &quot;toJS(context, WTF::getPtr(${expression}))&quot;;
</span><span class="lines">@@ -489,7 +501,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $parameter) = @_;
</span><span class="cx"> 
</span><del>-    my $idlType = $parameter-&gt;type;
</del><ins>+    my $idlType = $parameter-&gt;idlType;
</ins><span class="cx">     my $name = $parameter-&gt;name;
</span><span class="cx"> 
</span><span class="cx">     return &quot;${name}.get()&quot; if $$self{codeGenerator}-&gt;IsStringType($idlType);
</span><span class="lines">@@ -524,7 +536,7 @@
</span><span class="cx"> {
</span><span class="cx">     my ($self, $interface, $functionOrValue, $arrayTerminator, $mapFunction, $functionsOrAttributes) = @_;
</span><span class="cx"> 
</span><del>-    my $className = _className($interface-&gt;name);
</del><ins>+    my $className = _className($interface-&gt;type);
</ins><span class="cx">     my $uppercaseFunctionOrValue = $$self{codeGenerator}-&gt;WK_ucfirst($functionOrValue);
</span><span class="cx"> 
</span><span class="cx">     my $result = &lt;&lt;EOF;
</span></span></pre>
</div>
</div>

</body>
</html>