Title: [291883] trunk/Source/WebCore
Revision
291883
Author
[email protected]
Date
2022-03-25 13:32:31 -0700 (Fri, 25 Mar 2022)

Log Message

Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots()
https://bugs.webkit.org/show_bug.cgi?id=238376

Reviewed by Geoffrey Garen.

Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots().
Those wrappers already call JSNodeOwner::isReachableFromOpaqueRoots() which already takes care
of checking the isFiringEventListeners flag.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291882 => 291883)


--- trunk/Source/WebCore/ChangeLog	2022-03-25 20:16:29 UTC (rev 291882)
+++ trunk/Source/WebCore/ChangeLog	2022-03-25 20:32:31 UTC (rev 291883)
@@ -1,3 +1,17 @@
+2022-03-25  Chris Dumez  <[email protected]>
+
+        Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots()
+        https://bugs.webkit.org/show_bug.cgi?id=238376
+
+        Reviewed by Geoffrey Garen.
+
+        Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots().
+        Those wrappers already call JSNodeOwner::isReachableFromOpaqueRoots() which already takes care
+        of checking the isFiringEventListeners flag.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+
 2022-03-25  J Pascoe  <[email protected]>
 
         [WebAuthn] Maintain last modification time separate from last used time for platform credentials

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (291882 => 291883)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2022-03-25 20:16:29 UTC (rev 291882)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2022-03-25 20:32:31 UTC (rev 291883)
@@ -5021,24 +5021,23 @@
             push(@implContent, "        return true;\n");
             push(@implContent, "     }\n");
         }
-        if ($codeGenerator->InheritsInterface($interface, "EventTarget")) {
+        if ($codeGenerator->InheritsInterface($interface, "Node")) {
             if (!$emittedJSCast) {
                 push(@implContent, "    auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");
                 $emittedJSCast = 1;
             }
-            push(@implContent, "    if (js${interfaceName}->wrapped().isFiringEventListeners()) {\n");
-            push(@implContent, "        if (UNLIKELY(reason))\n");
-            push(@implContent, "            *reason = \"EventTarget firing event listeners\";\n");
+            push(@implContent, "    if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor, reason))\n");
             push(@implContent, "        return true;\n");
-            push(@implContent, "    }\n");
-        }
-        if ($codeGenerator->InheritsInterface($interface, "Node")) {
+        } elsif ($codeGenerator->InheritsInterface($interface, "EventTarget")) {
             if (!$emittedJSCast) {
                 push(@implContent, "    auto* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.slot()->asCell());\n");
                 $emittedJSCast = 1;
             }
-            push(@implContent, "    if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor, reason))\n");
+            push(@implContent, "    if (js${interfaceName}->wrapped().isFiringEventListeners()) {\n");
+            push(@implContent, "        if (UNLIKELY(reason))\n");
+            push(@implContent, "            *reason = \"EventTarget firing event listeners\";\n");
             push(@implContent, "        return true;\n");
+            push(@implContent, "    }\n");
         }
         if (GetGenerateIsReachable($interface)) {
             if (!$emittedJSCast) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to