Title: [141730] trunk/Source/WebCore
Revision
141730
Author
hara...@chromium.org
Date
2013-02-03 19:22:44 -0800 (Sun, 03 Feb 2013)

Log Message

[V8] Simplify CodeGeneratorV8.pm by using InheritsExtendedAttribute("EventTarget")
https://bugs.webkit.org/show_bug.cgi?id=108441

Reviewed by Adam Barth.

A complicated condition in GetInternalFields() can be simplified
by using InheritsExtendedAttribute("EventTarget").

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm:
(GetInternalFields):
* dom/EventTarget.idl: Added [EventTarget] which should have been added.
* svg/SVGElementInstance.idl: Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141729 => 141730)


--- trunk/Source/WebCore/ChangeLog	2013-02-04 03:09:17 UTC (rev 141729)
+++ trunk/Source/WebCore/ChangeLog	2013-02-04 03:22:44 UTC (rev 141730)
@@ -1,3 +1,20 @@
+2013-02-03  Kentaro Hara  <hara...@chromium.org>
+
+        [V8] Simplify CodeGeneratorV8.pm by using InheritsExtendedAttribute("EventTarget")
+        https://bugs.webkit.org/show_bug.cgi?id=108441
+
+        Reviewed by Adam Barth.
+
+        A complicated condition in GetInternalFields() can be simplified
+        by using InheritsExtendedAttribute("EventTarget").
+
+        No tests. No change in behavior.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GetInternalFields):
+        * dom/EventTarget.idl: Added [EventTarget] which should have been added.
+        * svg/SVGElementInstance.idl: Ditto.
+
 2013-02-03  Gustavo Noronha Silva  <g...@gnome.org>
 
         [Soup] Do not use local variables for the client

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (141729 => 141730)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2013-02-04 03:09:17 UTC (rev 141729)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2013-02-04 03:22:44 UTC (rev 141730)
@@ -616,18 +616,11 @@
     my $interface = shift;
 
     my @customInternalFields = ();
-    # We can't ask whether a parent type has a given extendedAttribute,
-    # so special-case AbstractWorker and WorkerContext to include all sub-types.
     # Event listeners on DOM nodes are explicitly supported in the GC controller.
-    # FIXME: Simplify this when all EventTargets are subtypes of EventTarget.
-    if (!$codeGenerator->InheritsInterface($interface, "Node")
-        && ($interface->extendedAttributes->{"EventTarget"}
-            || $interface->extendedAttributes->{"IsWorkerContext"}
-            || $codeGenerator->InheritsInterface($interface, "AbstractWorker")
-            || $codeGenerator->InheritsInterface($interface, "EventTarget"))) {
+    if (!$codeGenerator->InheritsInterface($interface, "Node") &&
+        $codeGenerator->InheritsExtendedAttribute($interface, "EventTarget")) {
         push(@customInternalFields, "eventListenerCacheIndex");
     }
-
     return @customInternalFields;
 }
 

Modified: trunk/Source/WebCore/dom/EventTarget.idl (141729 => 141730)


--- trunk/Source/WebCore/dom/EventTarget.idl	2013-02-04 03:09:17 UTC (rev 141729)
+++ trunk/Source/WebCore/dom/EventTarget.idl	2013-02-04 03:22:44 UTC (rev 141730)
@@ -25,7 +25,8 @@
     OmitConstructor,
     CustomToJSObject,
     JSCustomToNativeObject,
-    V8NoWrapperCache
+    V8NoWrapperCache,
+    EventTarget
 ] interface EventTarget {
     [ObjCLegacyUnnamedParameters] void addEventListener(in DOMString type, 
                                          in EventListener listener, 

Modified: trunk/Source/WebCore/svg/SVGElementInstance.cpp (141729 => 141730)


--- trunk/Source/WebCore/svg/SVGElementInstance.cpp	2013-02-04 03:09:17 UTC (rev 141729)
+++ trunk/Source/WebCore/svg/SVGElementInstance.cpp	2013-02-04 03:22:44 UTC (rev 141730)
@@ -186,9 +186,7 @@
 
 EventTargetData* SVGElementInstance::eventTargetData()
 {
-    // EventTarget would use these methods if we were actually using its add/removeEventListener logic.
-    // As we're forwarding those calls to the correspondingElement(), no one should ever call this function.
-    ASSERT_NOT_REACHED();
+    // Since no event listeners are added to an SVGElementInstance, we don't have eventTargetData.
     return 0;
 }
 

Modified: trunk/Source/WebCore/svg/SVGElementInstance.idl (141729 => 141730)


--- trunk/Source/WebCore/svg/SVGElementInstance.idl	2013-02-04 03:09:17 UTC (rev 141729)
+++ trunk/Source/WebCore/svg/SVGElementInstance.idl	2013-02-04 03:22:44 UTC (rev 141730)
@@ -28,7 +28,8 @@
     Conditional=SVG,
     JSCustomMarkFunction,
     JSGenerateToNativeObject,
-    JSGenerateToJSObject
+    JSGenerateToJSObject,
+    EventTarget
 ] interface SVGElementInstance
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
     : Object, EventTarget
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to