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

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

<h3>Log Message</h3>
<pre>Make JavaScript binding get and set legacy event listener attributes directly
https://bugs.webkit.org/show_bug.cgi?id=142282

Reviewed by Sam Weinig.

Test: fast/dom/legacy-event-handler-attributes.html

This patch changes the JavaScript getters and setters for these attributes
to work directly without requiring any functions in the C++ DOM implementation.
A subsequent patch will remove the now-unused C++ DOM implementation.

* bindings/js/JSEventListener.cpp:
(WebCore::legacyEventListenerAttribute): Added.
(WebCore::createEventListenerForLegacyAttribute): Added.
(WebCore::setLegacyEventListenerAttribute): Added.
(WebCore::legacyWindowEventListenerAttribute): Added.
(WebCore::setLegacyWindowEventListenerAttribute): Added.

* bindings/js/JSEventListener.h:
(WebCore::createJSEventListenerForAttribute): Deleted.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeEventListenerCall): Deleted.
(LegacyEventListenerAttributeEventName): Added.
(LegacyEventListenerAttributePrefix): Added.
(GenerateImplementation): Use &quot;auto&quot; in lots of places to simplify the code
generation. Replaced the old inlined code to deal with legacy event listener
attributes with code that simply calls the new functions from JSEventLister.h.
(GenerateCallWith): Use &quot;auto&quot;.
(GenerateConstructorDefinition): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenercpp">trunk/Source/WebCore/bindings/js/JSEventListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenerh">trunk/Source/WebCore/bindings/js/JSEventListener.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181000 => 181001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-04 16:41:31 UTC (rev 181000)
+++ trunk/Source/WebCore/ChangeLog        2015-03-04 17:30:32 UTC (rev 181001)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-03-04  Darin Adler  &lt;darin@apple.com&gt;
+
+        Make JavaScript binding get and set legacy event listener attributes directly
+        https://bugs.webkit.org/show_bug.cgi?id=142282
+
+        Reviewed by Sam Weinig.
+
+        Test: fast/dom/legacy-event-handler-attributes.html
+
+        This patch changes the JavaScript getters and setters for these attributes
+        to work directly without requiring any functions in the C++ DOM implementation.
+        A subsequent patch will remove the now-unused C++ DOM implementation.
+
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::legacyEventListenerAttribute): Added.
+        (WebCore::createEventListenerForLegacyAttribute): Added.
+        (WebCore::setLegacyEventListenerAttribute): Added.
+        (WebCore::legacyWindowEventListenerAttribute): Added.
+        (WebCore::setLegacyWindowEventListenerAttribute): Added.
+
+        * bindings/js/JSEventListener.h:
+        (WebCore::createJSEventListenerForAttribute): Deleted.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateAttributeEventListenerCall): Deleted.
+        (LegacyEventListenerAttributeEventName): Added.
+        (LegacyEventListenerAttributePrefix): Added.
+        (GenerateImplementation): Use &quot;auto&quot; in lots of places to simplify the code
+        generation. Replaced the old inlined code to deal with legacy event listener
+        attributes with code that simply calls the new functions from JSEventLister.h.
+        (GenerateCallWith): Use &quot;auto&quot;.
+        (GenerateConstructorDefinition): Ditto.
+
</ins><span class="cx"> 2015-03-03  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Extensions] Split parsing and compiling of content extensions into their own files
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (181000 => 181001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2015-03-04 16:41:31 UTC (rev 181000)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2015-03-04 17:30:32 UTC (rev 181001)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> #include &quot;BeforeUnloadEvent.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;JSEvent.h&quot;
</span><span class="cx"> #include &quot;JSEventTarget.h&quot;
</span><span class="cx"> #include &quot;JSMainThreadExecState.h&quot;
</span><span class="lines">@@ -170,4 +171,49 @@
</span><span class="cx">     return JSEventListener::create(&amp;listener, &amp;wrapper, false, currentWorld(&amp;state));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline JSC::JSValue eventHandlerAttribute(EventListener* abstractListener, ScriptExecutionContext&amp; context)
+{
+    if (!abstractListener)
+        return jsNull();
+
+    auto* listener = JSEventListener::cast(abstractListener);
+    if (!listener)
+        return jsNull();
+
+    auto* function = listener-&gt;jsFunction(&amp;context);
+    if (!function)
+        return jsNull();
+
+    return function;
+}
+
+static inline RefPtr&lt;JSEventListener&gt; createEventListenerForEventHandlerAttribute(JSC::ExecState&amp; state, JSC::JSValue listener, JSC::JSObject&amp; wrapper)
+{
+    if (!listener.isObject())
+        return nullptr;
+    return JSEventListener::create(asObject(listener), &amp;wrapper, true, currentWorld(&amp;state));
+}
+
+JSC::JSValue eventHandlerAttribute(EventTarget&amp; target, const AtomicString&amp; eventType)
+{
+    return eventHandlerAttribute(target.getAttributeEventListener(eventType), *target.scriptExecutionContext());
+}
+
+void setEventHandlerAttribute(JSC::ExecState&amp; state, JSC::JSObject&amp; wrapper, EventTarget&amp; target, const AtomicString&amp; eventType, JSC::JSValue value)
+{
+    target.setAttributeEventListener(eventType, createEventListenerForEventHandlerAttribute(state, value, wrapper));
+}
+
+JSC::JSValue windowForwardedEventHandlerAttribute(HTMLElement&amp; element, const AtomicString&amp; eventType)
+{
+    auto&amp; document = element.document();
+    return eventHandlerAttribute(document.getWindowAttributeEventListener(eventType), document);
+}
+
+void setWindowForwardedEventHandlerAttribute(JSC::ExecState&amp; state, JSC::JSObject&amp; wrapper, HTMLElement&amp; element, const AtomicString&amp; eventType, JSC::JSValue value)
+{
+    ASSERT(wrapper.globalObject());
+    element.document().setWindowAttributeEventListener(eventType, createEventListenerForEventHandlerAttribute(state, value, *wrapper.globalObject()));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.h (181000 => 181001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.h        2015-03-04 16:41:31 UTC (rev 181000)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.h        2015-03-04 17:30:32 UTC (rev 181001)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+    class EventTarget;
+    class HTMLElement;
</ins><span class="cx">     class JSDOMGlobalObject;
</span><span class="cx"> 
</span><span class="cx">     class JSEventListener : public EventListener {
</span><span class="lines">@@ -75,9 +77,14 @@
</span><span class="cx">         RefPtr&lt;DOMWrapperWorld&gt; m_isolatedWorld;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    // For &quot;onXXX&quot; event attributes.
-    RefPtr&lt;JSEventListener&gt; createJSEventListenerForAttribute(JSC::ExecState&amp;, JSC::JSValue listener, JSC::JSObject&amp; wrapper);
</del><ins>+    // For &quot;onxxx&quot; attributes that automatically set up JavaScript event listeners.
+    JSC::JSValue eventHandlerAttribute(EventTarget&amp;, const AtomicString&amp; eventType);
+    void setEventHandlerAttribute(JSC::ExecState&amp;, JSC::JSObject&amp;, EventTarget&amp;, const AtomicString&amp; eventType, JSC::JSValue);
</ins><span class="cx"> 
</span><ins>+    // Like the functions above, but for attributes that forward event handlers to the window object rather than setting them on the target.
+    JSC::JSValue windowForwardedEventHandlerAttribute(HTMLElement&amp;, const AtomicString&amp; eventType);
+    void setWindowForwardedEventHandlerAttribute(JSC::ExecState&amp;, JSC::JSObject&amp;, HTMLElement&amp;, const AtomicString&amp; eventType, JSC::JSValue);
+
</ins><span class="cx">     Ref&lt;JSEventListener&gt; createJSEventListenerForAdd(JSC::ExecState&amp;, JSC::JSObject&amp; listener, JSC::JSObject&amp; wrapper);
</span><span class="cx">     Ref&lt;JSEventListener&gt; createJSEventListenerForRemove(JSC::ExecState&amp;, JSC::JSObject&amp; listener, JSC::JSObject&amp; wrapper);
</span><span class="cx"> 
</span><span class="lines">@@ -112,13 +119,6 @@
</span><span class="cx">         return m_jsFunction.get();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    inline RefPtr&lt;JSEventListener&gt; createJSEventListenerForAttribute(JSC::ExecState&amp; state, JSC::JSValue listener, JSC::JSObject&amp; wrapper)
-    {
-        if (!listener.isObject())
-            return nullptr;
-        return JSEventListener::create(asObject(listener), &amp;wrapper, true, currentWorld(&amp;state));
-    }
-
</del><span class="cx">     inline Ref&lt;JSEventListener&gt; createJSEventListenerForRemove(JSC::ExecState&amp; state, JSC::JSObject&amp; listener, JSC::JSObject&amp; wrapper)
</span><span class="cx">     {
</span><span class="cx">         return createJSEventListenerForAdd(state, listener, wrapper);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (181000 => 181001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-03-04 16:41:31 UTC (rev 181000)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-03-04 17:30:32 UTC (rev 181001)
</span><span class="lines">@@ -140,16 +140,21 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GenerateAttributeEventListenerCall
</del><ins>+sub EventHandlerAttributeEventName
</ins><span class="cx"> {
</span><del>-    my $implSetterFunctionName = shift;
-    my $windowEventListener = shift;
</del><ins>+    my $attribute = shift;
</ins><span class="cx"> 
</span><del>-    my $wrapperObject = $windowEventListener ? &quot;globalObject&quot; : &quot;castedThis&quot;;
-    my @GenerateEventListenerImpl = ();
</del><ins>+    # Remove the &quot;on&quot; prefix.
+    my $eventType = substr($attribute-&gt;signature-&gt;name, 2);
</ins><span class="cx"> 
</span><del>-    push(@GenerateEventListenerImpl, &quot;    impl.set$implSetterFunctionName(createJSEventListenerForAttribute(*exec, value, *$wrapperObject));\n&quot;);
-    return @GenerateEventListenerImpl;
</del><ins>+    # FIXME: Consider adding a property in the IDL file instead of hard coding these four event names.
+    # Note: This same hard coded list of property names exists in HTMLElement.cpp.
+    $eventType = &quot;webkitAnimationEnd&quot; if $eventType eq &quot;webkitanimationend&quot;;
+    $eventType = &quot;webkitAnimationIteration&quot; if $eventType eq &quot;webkitanimationiteration&quot;;
+    $eventType = &quot;webkitAnimationStart&quot; if $eventType eq &quot;webkitanimationstart&quot;;
+    $eventType = &quot;webkitTransitionEnd&quot; if $eventType eq &quot;webkittransitionend&quot;;
+
+    return &quot;eventNames().${eventType}Event&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateEventListenerCall
</span><span class="lines">@@ -1969,7 +1974,7 @@
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    VM&amp; vm = exec-&gt;vm();\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    UNUSED_PARAM(vm);\n&quot;);
</span><del>-            push(@implContent, &quot;    ${className}Prototype* thisObject = jsCast&lt;${className}Prototype*&gt;(object);\n&quot;);
</del><ins>+            push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}Prototype*&gt;(object);\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">             if ($numConstants eq 0 &amp;&amp; $numFunctions eq 0 &amp;&amp; $numPrototypeAttributes eq 0) {
</span><span class="cx">                 push(@implContent, &quot;    return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);\n&quot;);        
</span><span class="lines">@@ -2012,7 +2017,7 @@
</span><span class="cx">     if ($interface-&gt;extendedAttributes-&gt;{&quot;JSCustomNamedGetterOnPrototype&quot;}) {
</span><span class="cx">         push(@implContent, &quot;void ${className}Prototype::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&amp; slot)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><del>-        push(@implContent, &quot;    ${className}Prototype* thisObject = jsCast&lt;${className}Prototype*&gt;(cell);\n&quot;);
</del><ins>+        push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}Prototype*&gt;(cell);\n&quot;);
</ins><span class="cx">         push(@implContent, &quot;    if (thisObject-&gt;putDelegate(exec, propertyName, value, slot))\n&quot;);
</span><span class="cx">         push(@implContent, &quot;        return;\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    Base::put(thisObject, exec, propertyName, value, slot);\n&quot;);
</span><span class="lines">@@ -2106,7 +2111,7 @@
</span><span class="cx">         if (!$interface-&gt;extendedAttributes-&gt;{&quot;CustomGetOwnPropertySlot&quot;}) {
</span><span class="cx">             push(@implContent, &quot;bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)\n&quot;);
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><del>-            push(@implContent, &quot;    ${className}* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</del><ins>+            push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><span class="cx">             push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceAttributes &gt; 0, 0));
</span><span class="cx">             push(@implContent, &quot;}\n\n&quot;);
</span><span class="lines">@@ -2117,7 +2122,7 @@
</span><span class="cx">                 || $interface-&gt;extendedAttributes-&gt;{&quot;JSCustomGetOwnPropertySlotAndDescriptor&quot;}) {
</span><span class="cx">             push(@implContent, &quot;bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot&amp; slot)\n&quot;);
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><del>-            push(@implContent, &quot;    ${className}* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</del><ins>+            push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             # Sink the int-to-string conversion that happens when we create a PropertyName
</span><span class="lines">@@ -2190,9 +2195,9 @@
</span><span class="cx">             push(@implContent, &quot;    UNUSED_PARAM(thisValue);\n&quot;);
</span><span class="cx">             if (!$attribute-&gt;isStatic || $attribute-&gt;signature-&gt;type =~ /Constructor$/) {
</span><span class="cx">                 if ($interface-&gt;extendedAttributes-&gt;{&quot;CustomProxyToJSObject&quot;}) {
</span><del>-                    push(@implContent, &quot;    ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n&quot;);
</del><ins>+                    push(@implContent, &quot;    auto* castedThis = to${className}(JSValue::decode(thisValue));\n&quot;);
</ins><span class="cx">                 } elsif (AttributeShouldBeOnInstance($interface, $attribute)) {
</span><del>-                    push(@implContent, &quot;    ${className}* castedThis = jsCast&lt;JS${interfaceName}*&gt;(slotBase);\n&quot;);
</del><ins>+                    push(@implContent, &quot;    auto* castedThis = jsCast&lt;JS${interfaceName}*&gt;(slotBase);\n&quot;);
</ins><span class="cx">                     if (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) {
</span><span class="cx">                         push(@implContent, &quot;    ${className}* castedThisObject = &quot; . GetCastingHelperForThisObject($interface) . &quot;(JSValue::decode(thisValue));\n&quot;);
</span><span class="cx">                         push(@implContent, &quot;    if (UNLIKELY(!castedThisObject))\n&quot;);
</span><span class="lines">@@ -2283,23 +2288,13 @@
</span><span class="cx">                 push(@implContent, &quot;    return JSValue::encode(castedThis-&gt;$implGetterFunctionName(exec));\n&quot;);
</span><span class="cx">             } elsif ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CheckSecurityForNode&quot;}) {
</span><span class="cx">                 $implIncludes{&quot;JSDOMBinding.h&quot;} = 1;
</span><del>-                push(@implContent, &quot;    $implType&amp; impl = castedThis-&gt;impl();\n&quot;);
</del><ins>+                push(@implContent, &quot;    auto&amp; impl = castedThis-&gt;impl();\n&quot;);
</ins><span class="cx">                 push(@implContent, &quot;    return JSValue::encode(shouldAllowAccessToNode(exec, impl.&quot; . $attribute-&gt;signature-&gt;name . &quot;()) ? &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;impl.$implGetterFunctionName()&quot;, &quot;castedThis&quot;) . &quot; : jsNull());\n&quot;);
</span><span class="cx">             } elsif ($type eq &quot;EventListener&quot;) {
</span><del>-                $implIncludes{&quot;EventListener.h&quot;} = 1;
</del><ins>+                my $getter = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSWindowEventListener&quot;} ? &quot;windowForwardedEventHandlerAttribute&quot; : &quot;eventHandlerAttribute&quot;;
+                my $eventName = EventHandlerAttributeEventName($attribute);
</ins><span class="cx">                 push(@implContent, &quot;    UNUSED_PARAM(exec);\n&quot;);
</span><del>-                push(@implContent, &quot;    $implType&amp; impl = castedThis-&gt;impl();\n&quot;);
-                push(@implContent, &quot;    if (EventListener* listener = impl.$implGetterFunctionName()) {\n&quot;);
-                push(@implContent, &quot;        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n&quot;);
-                if ($interfaceName eq &quot;Document&quot; || $codeGenerator-&gt;InheritsInterface($interface, &quot;WorkerGlobalScope&quot;)) {
-                    push(@implContent, &quot;            if (JSObject* jsFunction = jsListener-&gt;jsFunction(&amp;impl))\n&quot;);
-                } else {
-                    push(@implContent, &quot;            if (JSObject* jsFunction = jsListener-&gt;jsFunction(impl.scriptExecutionContext()))\n&quot;);
-                }
-                push(@implContent, &quot;                return JSValue::encode(jsFunction);\n&quot;);
-                push(@implContent, &quot;        }\n&quot;);
-                push(@implContent, &quot;    }\n&quot;);
-                push(@implContent, &quot;    return JSValue::encode(jsNull());\n&quot;);
</del><ins>+                push(@implContent, &quot;    return JSValue::encode($getter(castedThis-&gt;impl(), $eventName));\n&quot;);
</ins><span class="cx">             } elsif ($attribute-&gt;signature-&gt;type =~ /Constructor$/) {
</span><span class="cx">                 my $constructorType = $attribute-&gt;signature-&gt;type;
</span><span class="cx">                 $constructorType =~ s/Constructor$//;
</span><span class="lines">@@ -2352,7 +2347,7 @@
</span><span class="cx"> 
</span><span class="cx">                     unshift(@arguments, @callWithArgs);
</span><span class="cx">                     my $jsType = NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;${functionName}(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;castedThis&quot;);
</span><del>-                    push(@implContent, &quot;    $implType&amp; impl = castedThis-&gt;impl();\n&quot;) if !$attribute-&gt;isStatic;
</del><ins>+                    push(@implContent, &quot;    auto&amp; impl = castedThis-&gt;impl();\n&quot;) if !$attribute-&gt;isStatic;
</ins><span class="cx">                     if ($codeGenerator-&gt;IsSVGAnimatedType($type)) {
</span><span class="cx">                         push(@implContent, &quot;    RefPtr&lt;$type&gt; obj = $jsType;\n&quot;);
</span><span class="cx">                         push(@implContent, &quot;    JSValue result = toJS(exec, castedThis-&gt;globalObject(), obj.get());\n&quot;);
</span><span class="lines">@@ -2381,7 +2376,7 @@
</span><span class="cx">                     push(@implContent, &quot;    $svgPropertyOrListPropertyType impl(*castedThis-&gt;impl());\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
</span><span class="cx">                 } else {
</span><del>-                    push(@implContent, &quot;    $implType&amp; impl = castedThis-&gt;impl();\n&quot;);
</del><ins>+                    push(@implContent, &quot;    auto&amp; impl = castedThis-&gt;impl();\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;    JSValue result = &quot; . NativeToJSValue($attribute-&gt;signature, 0, $interfaceName, &quot;impl.$implGetterFunctionName(&quot; . join(&quot;, &quot;, @arguments) . &quot;)&quot;, &quot;castedThis&quot;) . &quot;;\n&quot;);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -2472,7 +2467,7 @@
</span><span class="cx">         if (!$interface-&gt;extendedAttributes-&gt;{&quot;CustomPutFunction&quot;}) {
</span><span class="cx">             push(@implContent, &quot;void ${className}::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&amp; slot)\n&quot;);
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><del>-            push(@implContent, &quot;    ${className}* thisObject = jsCast&lt;${className}*&gt;(cell);\n&quot;);
</del><ins>+            push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(cell);\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><span class="cx">             if ($interface-&gt;extendedAttributes-&gt;{&quot;CustomIndexedSetter&quot;}) {
</span><span class="cx">                 push(@implContent, &quot;    unsigned index = propertyName.asIndex();\n&quot;);
</span><span class="lines">@@ -2492,7 +2487,7 @@
</span><span class="cx">             if ($interface-&gt;extendedAttributes-&gt;{&quot;CustomIndexedSetter&quot;} || $interface-&gt;extendedAttributes-&gt;{&quot;CustomNamedSetter&quot;}) {
</span><span class="cx">                 push(@implContent, &quot;void ${className}::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;{\n&quot;);
</span><del>-                push(@implContent, &quot;    ${className}* thisObject = jsCast&lt;${className}*&gt;(cell);\n&quot;);
</del><ins>+                push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(cell);\n&quot;);
</ins><span class="cx">                 push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><span class="cx"> 
</span><span class="cx">                 if ($interface-&gt;extendedAttributes-&gt;{&quot;CustomIndexedSetter&quot;}) {
</span><span class="lines">@@ -2548,7 +2543,7 @@
</span><span class="cx">                         push(@implContent, &quot;    ${className}* castedThis = to${className}(JSValue::decode(thisValue));\n&quot;);
</span><span class="cx">                     } elsif (AttributeShouldBeOnInstance($interface, $attribute)) {
</span><span class="cx">                         push(@implContent, &quot;    UNUSED_PARAM(thisValue);\n&quot;);
</span><del>-                        push(@implContent, &quot;    ${className}* castedThis = jsCast&lt;JS${interfaceName}*&gt;(baseObject);\n&quot;);
</del><ins>+                        push(@implContent, &quot;    auto* castedThis = jsCast&lt;JS${interfaceName}*&gt;(baseObject);\n&quot;);
</ins><span class="cx">                         if (InterfaceRequiresAttributesOnInstanceForCompatibility($interface)) {
</span><span class="cx">                             push(@implContent, &quot;    ${className}* castedThisObject = &quot; . GetCastingHelperForThisObject($interface) . &quot;(JSValue::decode(thisValue));\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;    if (UNLIKELY(!castedThisObject))\n&quot;);
</span><span class="lines">@@ -2580,18 +2575,15 @@
</span><span class="cx">                 if (HasCustomSetter($attribute-&gt;signature-&gt;extendedAttributes)) {
</span><span class="cx">                     push(@implContent, &quot;    castedThis-&gt;set$implSetterFunctionName(exec, value);\n&quot;);
</span><span class="cx">                 } elsif ($type eq &quot;EventListener&quot;) {
</span><del>-                    $implIncludes{&quot;JSEventListener.h&quot;} = 1;
-                    push(@implContent, &quot;    UNUSED_PARAM(exec);\n&quot;);
-                    my $windowEventListener = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSWindowEventListener&quot;};
-                    if ($windowEventListener) {
-                        push(@implContent, &quot;    JSDOMGlobalObject* globalObject = castedThis-&gt;globalObject();\n&quot;);
-                    }
-                    push(@implContent, &quot;    $implType&amp; impl = castedThis-&gt;impl();\n&quot;);
</del><ins>+                    my $eventName = EventHandlerAttributeEventName($attribute);
+                    # FIXME: Find a way to do this special case without hardcoding the class and attribute names here.
</ins><span class="cx">                     if ((($interfaceName eq &quot;DOMWindow&quot;) or ($interfaceName eq &quot;WorkerGlobalScope&quot;)) and $name eq &quot;onerror&quot;) {
</span><span class="cx">                         $implIncludes{&quot;JSErrorHandler.h&quot;} = 1;
</span><del>-                        push(@implContent, &quot;    impl.set$implSetterFunctionName(createJSErrorHandler(exec, value, castedThis));\n&quot;);
</del><ins>+                        push(@implContent, &quot;    castedThis-&gt;impl().setAttributeEventListener($eventName, createJSErrorHandler(exec, value, castedThis));\n&quot;);
</ins><span class="cx">                     } else {
</span><del>-                        push(@implContent, GenerateAttributeEventListenerCall($implSetterFunctionName, $windowEventListener));
</del><ins>+                        $implIncludes{&quot;JSEventListener.h&quot;} = 1;
+                        my $setter = $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;JSWindowEventListener&quot;} ? &quot;setWindowForwardedEventHandlerAttribute&quot; : &quot;setEventHandlerAttribute&quot;;
+                        push(@implContent, &quot;    $setter(*exec, *castedThis, castedThis-&gt;impl(), $eventName, value);\n&quot;);
</ins><span class="cx">                     }
</span><span class="cx">                 } elsif ($attribute-&gt;signature-&gt;type =~ /Constructor$/) {
</span><span class="cx">                     my $constructorType = $attribute-&gt;signature-&gt;type;
</span><span class="lines">@@ -2602,14 +2594,14 @@
</span><span class="cx">                     if ($constructorType ne &quot;any&quot; and $constructorType !~ /Named$/) {
</span><span class="cx">                         AddToImplIncludes(&quot;JS&quot; . $constructorType . &quot;.h&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;});
</span><span class="cx">                     }
</span><del>-                    push(@implContent, &quot;    // Shadowing a built-in constructor\n&quot;);
</del><ins>+                    push(@implContent, &quot;    // Shadowing a built-in constructor.\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;    castedThis-&gt;putDirect(exec-&gt;vm(), Identifier(exec, \&quot;$name\&quot;), value);\n&quot;);
</span><span class="cx">                 } elsif ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Replaceable&quot;}) {
</span><del>-                    push(@implContent, &quot;    // Shadowing a built-in object\n&quot;);
</del><ins>+                    push(@implContent, &quot;    // Shadowing a built-in object.\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;    castedThis-&gt;putDirect(exec-&gt;vm(), Identifier(exec, \&quot;$name\&quot;), value);\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     if (!$attribute-&gt;isStatic) {
</span><del>-                        push(@implContent, &quot;    $implType&amp; impl = castedThis-&gt;impl();\n&quot;);
</del><ins>+                        push(@implContent, &quot;    auto&amp; impl = castedThis-&gt;impl();\n&quot;);
</ins><span class="cx">                     }
</span><span class="cx">                     push(@implContent, &quot;    ExceptionCode ec = 0;\n&quot;) if $setterRaisesException;
</span><span class="cx"> 
</span><span class="lines">@@ -2712,7 +2704,7 @@
</span><span class="cx">     if ($indexedGetterFunction &amp;&amp; !$interface-&gt;extendedAttributes-&gt;{&quot;CustomEnumerateProperty&quot;}) {
</span><span class="cx">         push(@implContent, &quot;void ${className}::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray&amp; propertyNames, EnumerationMode mode)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><del>-        push(@implContent, &quot;    ${className}* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</del><ins>+        push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</ins><span class="cx">         push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    for (unsigned i = 0, count = thisObject-&gt;impl().length(); i &lt; count; ++i)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;        propertyNames.add(Identifier::from(exec, i));\n&quot;);
</span><span class="lines">@@ -2819,7 +2811,7 @@
</span><span class="cx">                 if ($isCustom) {
</span><span class="cx">                     push(@implContent, &quot;    return JSValue::encode(castedThis-&gt;&quot; . $functionImplementationName . &quot;(exec));\n&quot;);
</span><span class="cx">                 } else {
</span><del>-                    push(@implContent, &quot;    $implType&amp; impl = castedThis-&gt;impl();\n&quot;);
</del><ins>+                    push(@implContent, &quot;    auto&amp; impl = castedThis-&gt;impl();\n&quot;);
</ins><span class="cx">                     if ($svgPropertyType) {
</span><span class="cx">                         push(@implContent, &quot;    if (impl.isReadOnly()) {\n&quot;);
</span><span class="cx">                         push(@implContent, &quot;        setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n&quot;);
</span><span class="lines">@@ -2869,7 +2861,7 @@
</span><span class="cx">     if ($needsVisitChildren) {
</span><span class="cx">         push(@implContent, &quot;void ${className}::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><del>-        push(@implContent, &quot;    ${className}* thisObject = jsCast&lt;${className}*&gt;(cell);\n&quot;);
</del><ins>+        push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(cell);\n&quot;);
</ins><span class="cx">         push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    Base::visitChildren(thisObject, visitor);\n&quot;);
</span><span class="cx">         if ($interface-&gt;extendedAttributes-&gt;{&quot;EventTarget&quot;} || $interface-&gt;name eq &quot;EventTarget&quot;) {
</span><span class="lines">@@ -2913,8 +2905,8 @@
</span><span class="cx">             push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">             push(@implContent, &quot;EncodedJSValue ${className}::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)\n&quot;);
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><del>-            push(@implContent, &quot;    ${className}* thisObj = jsCast&lt;$className*&gt;(slotBase);\n&quot;);
-            push(@implContent, &quot;    return JSValue::encode(toJS(exec, thisObj-&gt;globalObject(), thisObj-&gt;impl().namedItem(propertyNameToAtomicString(propertyName))));\n&quot;);
</del><ins>+            push(@implContent, &quot;    auto* thisObject = jsCast&lt;$className*&gt;(slotBase);\n&quot;);
+            push(@implContent, &quot;    return JSValue::encode(toJS(exec, thisObject-&gt;globalObject(), thisObject-&gt;impl().namedItem(propertyNameToAtomicString(propertyName))));\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2944,14 +2936,14 @@
</span><span class="cx">         # check below the isObservable check.
</span><span class="cx">         my $emittedJSCast = 0;
</span><span class="cx">         if ($codeGenerator-&gt;InheritsExtendedAttribute($interface, &quot;ActiveDOMObject&quot;)) {
</span><del>-            push(@implContent, &quot;    JS${interfaceName}* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</del><ins>+            push(@implContent, &quot;    auto* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</ins><span class="cx">             $emittedJSCast = 1;
</span><span class="cx">             push(@implContent, &quot;    if (js${interfaceName}-&gt;impl().hasPendingActivity())\n&quot;);
</span><span class="cx">             push(@implContent, &quot;        return true;\n&quot;);
</span><span class="cx">         }
</span><span class="cx">         if ($codeGenerator-&gt;InheritsExtendedAttribute($interface, &quot;EventTarget&quot;)) {
</span><span class="cx">             if (!$emittedJSCast) {
</span><del>-                push(@implContent, &quot;    JS${interfaceName}* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</del><ins>+                push(@implContent, &quot;    auto* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</ins><span class="cx">                 $emittedJSCast = 1;
</span><span class="cx">             }
</span><span class="cx">             push(@implContent, &quot;    if (js${interfaceName}-&gt;impl().isFiringEventListeners())\n&quot;);
</span><span class="lines">@@ -2959,7 +2951,7 @@
</span><span class="cx">         }
</span><span class="cx">         if ($codeGenerator-&gt;InheritsInterface($interface, &quot;Node&quot;)) {
</span><span class="cx">             if (!$emittedJSCast) {
</span><del>-                push(@implContent, &quot;    JS${interfaceName}* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</del><ins>+                push(@implContent, &quot;    auto* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</ins><span class="cx">                 $emittedJSCast = 1;
</span><span class="cx">             }
</span><span class="cx">             push(@implContent, &quot;    if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor))\n&quot;);
</span><span class="lines">@@ -2967,7 +2959,7 @@
</span><span class="cx">         }
</span><span class="cx">         if (GetGenerateIsReachable($interface)) {
</span><span class="cx">             if (!$emittedJSCast) {
</span><del>-                push(@implContent, &quot;    JS${interfaceName}* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</del><ins>+                push(@implContent, &quot;    auto* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</ins><span class="cx">                 $emittedJSCast = 1;
</span><span class="cx">             }
</span><span class="cx">             push(@implContent, &quot;    if (!isObservable(js${interfaceName}))\n&quot;);
</span><span class="lines">@@ -3024,8 +3016,8 @@
</span><span class="cx">          $codeGenerator-&gt;InheritsExtendedAttribute($interface, &quot;ActiveDOMObject&quot;))) {
</span><span class="cx">         push(@implContent, &quot;void JS${interfaceName}Owner::finalize(JSC::Handle&lt;JSC::Unknown&gt; handle, void* context)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><del>-        push(@implContent, &quot;    JS${interfaceName}* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
-        push(@implContent, &quot;    DOMWrapperWorld&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);\n&quot;);
</del><ins>+        push(@implContent, &quot;    auto* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
+        push(@implContent, &quot;    auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);\n&quot;);
</ins><span class="cx">         push(@implContent, &quot;    uncacheWrapper(world, &amp;js${interfaceName}-&gt;impl(), js${interfaceName});\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    js${interfaceName}-&gt;releaseImpl();\n&quot;);
</span><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="lines">@@ -3132,7 +3124,7 @@
</span><span class="cx">         push(@callWithArgs, &quot;exec&quot;);
</span><span class="cx">     }
</span><span class="cx">     if ($codeGenerator-&gt;ExtendedAttributeContains($callWith, &quot;ScriptExecutionContext&quot;)) {
</span><del>-        push(@$outputArray, &quot;    ScriptExecutionContext* scriptContext = jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();\n&quot;);
</del><ins>+        push(@$outputArray, &quot;    auto* scriptContext = jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();\n&quot;);
</ins><span class="cx">         push(@$outputArray, &quot;    if (!scriptContext)\n&quot;);
</span><span class="cx">         push(@$outputArray, &quot;        return&quot; . ($returnValue ? &quot; &quot; . $returnValue : &quot;&quot;) . &quot;;\n&quot;);
</span><span class="cx">         push(@callWithArgs, &quot;scriptContext&quot;);
</span><span class="lines">@@ -4509,7 +4501,7 @@
</span><span class="cx">             push(@$outputArray, &lt;&lt;END);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* exec)
</span><span class="cx"> {
</span><del>-    ${constructorClassName}* jsConstructor = jsCast&lt;${constructorClassName}*&gt;(exec-&gt;callee());
</del><ins>+    auto* jsConstructor = jsCast&lt;${constructorClassName}*&gt;(exec-&gt;callee());
</ins><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* executionContext = jsConstructor-&gt;scriptExecutionContext();
</span><span class="cx">     if (!executionContext)
</span><span class="lines">@@ -4576,7 +4568,7 @@
</span><span class="cx"> 
</span><span class="cx">             push(@$outputArray, &quot;EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}${overloadedIndexString}(ExecState* exec)\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;{\n&quot;);
</span><del>-            push(@$outputArray, &quot;    ${constructorClassName}* castedThis = jsCast&lt;${constructorClassName}*&gt;(exec-&gt;callee());\n&quot;);
</del><ins>+            push(@$outputArray, &quot;    auto* castedThis = jsCast&lt;${constructorClassName}*&gt;(exec-&gt;callee());\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">             my @constructorArgList;
</span><span class="cx"> 
</span><span class="lines">@@ -4606,7 +4598,7 @@
</span><span class="cx">                 push(@$outputArray, &quot;    ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;    if (!context)\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        return throwConstructorDocumentUnavailableError(*exec, \&quot;${interfaceName}\&quot;);\n&quot;);
</span><del>-                push(@$outputArray, &quot;    Document&amp; document = downcast&lt;Document&gt;(*context);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;    auto&amp; document = downcast&lt;Document&gt;(*context);\n&quot;);
</ins><span class="cx">             }
</span><span class="cx">             if ($generatingNamedConstructor) {
</span><span class="cx">                 push(@constructorArgList, &quot;*castedThis-&gt;document()&quot;);
</span></span></pre>
</div>
</div>

</body>
</html>