[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

xan at webkit.org xan at webkit.org
Wed Dec 22 12:37:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 159c9fa776a5c8dc49f065b0480d8565ce140f61
Author: xan at webkit.org <xan at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 26 08:58:41 2010 +0000

    2010-08-25  Xan Lopez  <xlopez at igalia.com>
    
            Reviewed by Martin Robinson.
    
            [GTK] Rework event definition in the DOM bindings
            https://bugs.webkit.org/show_bug.cgi?id=44597
    
            Define DOM events in the base classes that implement EventTarget,
            since theoretically you can dispatch any event to any of those
            classes whether it makes sense semantically or not.
    
            All the existing events in WebKit are not listed anywhere in the
            IDL files, so we need to have the list in the generator script.
    
            * bindings/scripts/CodeGeneratorGObject.pm:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index da93a9b..3c04fb7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-25  Xan Lopez  <xlopez at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Rework event definition in the DOM bindings
+        https://bugs.webkit.org/show_bug.cgi?id=44597
+
+        Define DOM events in the base classes that implement EventTarget,
+        since theoretically you can dispatch any event to any of those
+        classes whether it makes sense semantically or not.
+
+        All the existing events in WebKit are not listed anywhere in the
+        IDL files, so we need to have the list in the generator script.
+
+        * bindings/scripts/CodeGeneratorGObject.pm:
+
 2010-08-25  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index 5700ff7..62f17b3 100644
--- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -479,23 +479,11 @@ sub EventSignalName {
 }
 
 sub GenerateEventListener {
-    my $attribute = shift;
+    my $name = shift;
     my $object = shift;
     my $interfaceName = shift;
 
-    # This marks event listeners in some subclasses of Element. We
-    # cannot add them, otherwise we'll get runtime errors because of
-    # duplicated signal definitions between a class and some ancestor.
-
-    # FIXME: it would be very good to be a lot more precise in how we
-    # do this...
-    if ($attribute->signature->extendedAttributes->{"WindowEventListener"}) {
-        return;
-    }
-
-    my $name = $attribute->signature->name;
-    my $domSignalName = substr($name, 2);
-    my $gobjectSignalName = EventSignalName($domSignalName);
+    my $gobjectSignalName = EventSignalName($name);
 
     my $txtInstallSignal = << "EOF";
     g_signal_new("${gobjectSignalName}",
@@ -510,11 +498,11 @@ sub GenerateEventListener {
 EOF
     push(@txtInstallSignals, $txtInstallSignal);
 
-    my ${listenerName} = $domSignalName . "Listener";
+    my ${listenerName} = $name . "Listener";
 
     my $txtInstallEventListener = << "EOF";
     RefPtr<WebCore::GObjectEventListener> ${listenerName} = WebCore::GObjectEventListener::create(reinterpret_cast<GObject*>(object), "${gobjectSignalName}");
-    coreObject->addEventListener("${domSignalName}", ${listenerName}, false);
+    coreObject->addEventListener("${name}", ${listenerName}, false);
 EOF
     push(@txtInstallEventListeners, $txtInstallEventListener);
 
@@ -522,6 +510,34 @@ EOF
     $implIncludes{"GObjectEventListener.h"} = 1;
 }
 
+my @eventSignalNames = (
+    # User Interface Event types
+    "focus", "blur",
+    # Basic Event types
+    "load", "unload", "abort", "error", "select", "change", "submit", "reset",
+    "resize", "scroll",
+    # Mouse Event types
+    "click", "dblclick", "mousedown", "mouseup",
+    "mousemove", "mouseover", "mouseout",
+    # Mouse Wheel Event types
+    "mousewheel",
+    # Keyboard Event types
+    "keydown", "keypress", "keyup",
+    # -- Events not in the spec but defined in WebKit
+    # Media Event types,
+    "loadstart", "progress", "suspend", "emptied", "stalled", "play",
+    "loadedmetadata", "loadeddata", "waiting", "playing", "canplay",
+    "canplaythrough", "seeking", "seeked", "timeupdate", "ended",
+    "ratechange", "durationchange", "volumechange",
+    # Drag and Drop Event types
+    "drag", "dragend", "dragenter", "dragleave", "dragover", "dragstart", "drop",
+    # Cut and Paste Event types
+    "beforecut", "cut", "beforecopy", "copy", "beforepaste", "paste",
+    # Animations
+    "webkitanimationend", "webkitanimationstart", "webkitanimationiteration",
+    # Other
+    "contextmenu", "input", "invalid", "search", "selectstart");
+
 sub GenerateProperties {
     my ($object, $interfaceName, $dataNode) = @_;
 
@@ -584,13 +600,20 @@ EOF
     push(@txtSetProps, $txtSetProps);
 
     foreach my $attribute (@readableProperties) {
-        if ($attribute->signature->type eq "EventListener") {
-            GenerateEventListener($attribute, $object, $interfaceName);
-        } else {
+        if ($attribute->signature->type ne "EventListener") {
             GenerateProperty($attribute, $interfaceName, \@writeableProperties);
         }
     }
 
+    # We need to define all the events there are in all base classes
+    # that implement EventTarget. For now we only care about these
+    # two.
+    if ($interfaceName eq "Node" || $interfaceName eq "DOMWindow") {
+        foreach my $signalName (@eventSignalNames) {
+            GenerateEventListener($signalName, $object, $interfaceName);
+        }
+    }
+
     push(@cBodyPriv, "};\n\n");
 
     $txtGetProp = << "EOF";

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list