[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:18:42 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 4c5b2734f490090631ecd0f1d83913853e5a9273
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 2 22:02:33 2009 +0000

    2009-11-02  Kelly Norton  <knorton at google.com>
    
            Reviewed by Timothy Hatcher.
    
            Adds a missed case for InspectorTimeline, DOMWindow dispatch of DOM events.
            https://bugs.webkit.org/show_bug.cgi?id=31030
    
            * dom/Node.cpp:
            (WebCore::eventHasListeners): Checks DOMWindow for listeners.
            (WebCore::Node::dispatchGenericEvent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50428 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3c2bace..e5a6b71 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2009-11-02  Kelly Norton  <knorton at google.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Adds a missed case for InspectorTimeline, DOMWindow dispatch of DOM events.
+        https://bugs.webkit.org/show_bug.cgi?id=31030
+
+        * dom/Node.cpp:
+        (WebCore::eventHasListeners): Checks DOMWindow for listeners.
+        (WebCore::Node::dispatchGenericEvent):
+
 2009-11-02  Dmitry Titov  <dimich at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index cbfde30..3d3546a 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -2446,8 +2446,11 @@ bool Node::dispatchEvent(PassRefPtr<Event> prpEvent)
     return dispatchGenericEvent(event.release());
 }
 
-static bool eventHasListeners(const AtomicString& eventType, Node* node, Vector<RefPtr<ContainerNode> >& ancestors)
+static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window, Node* node, Vector<RefPtr<ContainerNode> >& ancestors)
 {
+    if (window && window->hasEventListeners(eventType))
+        return true;
+
     if (node->hasEventListeners(eventType))
         return true;
 
@@ -2475,13 +2478,6 @@ bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
     Vector<RefPtr<ContainerNode> > ancestors;
     eventAncestors(ancestors);
 
-#if ENABLE(INSPECTOR)
-    InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent();
-    bool timelineAgentIsActive = timelineAgent && eventHasListeners(event->type(), this, ancestors);    
-    if (timelineAgentIsActive)
-        timelineAgent->willDispatchEvent(*event);
-#endif
-
     // Set up a pointer to indicate whether / where to dispatch window events.
     // We don't dispatch load events to the window. That quirk was originally
     // added because Mozilla doesn't propagate load events to the window object.
@@ -2492,6 +2488,13 @@ bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
             targetForWindowEvents = static_cast<Document*>(topLevelContainer)->domWindow();
     }
 
+#if ENABLE(INSPECTOR)
+    InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent();
+    bool timelineAgentIsActive = timelineAgent && eventHasListeners(event->type(), targetForWindowEvents, this, ancestors);
+    if (timelineAgentIsActive)
+        timelineAgent->willDispatchEvent(*event);
+#endif
+
     // Give the target node a chance to do some work before DOM event handlers get a crack.
     void* data = preDispatchEventHandler(event.get());
     if (event->propagationStopped())

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list