summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/gobject/WebKitDOMBinding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/gobject/WebKitDOMBinding.cpp')
-rw-r--r--WebCore/bindings/gobject/WebKitDOMBinding.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/WebCore/bindings/gobject/WebKitDOMBinding.cpp b/WebCore/bindings/gobject/WebKitDOMBinding.cpp
index aa4610b..1154d6c 100644
--- a/WebCore/bindings/gobject/WebKitDOMBinding.cpp
+++ b/WebCore/bindings/gobject/WebKitDOMBinding.cpp
@@ -24,14 +24,19 @@
#include "config.h"
#include "WebKitDOMBinding.h"
+#include "Element.h"
#include "Event.h"
#include "EventException.h"
#include "HTMLNames.h"
+#include "MouseEvent.h"
+#include "UIEvent.h"
#include "WebKitDOMDOMWindowPrivate.h"
#include "WebKitDOMElementPrivate.h"
#include "WebKitDOMNode.h"
#include "WebKitDOMNodePrivate.h"
#include "WebKitHTMLElementWrapperFactory.h"
+#include "webkit/WebKitDOMMouseEventPrivate.h"
+#include "webkit/WebKitDOMUIEventPrivate.h"
namespace WebKit {
@@ -78,7 +83,7 @@ static gpointer createWrapper(Node* node)
if (node->isHTMLElement())
wrappedNode = createHTMLElementWrapper(static_cast<HTMLElement*>(node));
else
- wrappedNode = wrapNode(node);
+ wrappedNode = wrapElement(static_cast<Element*>(node));
break;
default:
wrappedNode = wrapNode(node);
@@ -119,6 +124,27 @@ gpointer kit(Element* element)
return DOMObjectCache::put(element, wrappedElement);
}
+gpointer kit(Event* event)
+{
+ if (!event)
+ return 0;
+
+ gpointer kitEvent = DOMObjectCache::get(event);
+ if (kitEvent)
+ return kitEvent;
+
+ gpointer wrappedEvent;
+
+ if (event->isMouseEvent())
+ wrappedEvent = wrapMouseEvent(static_cast<MouseEvent*>(event));
+ else if (event->isUIEvent())
+ wrappedEvent = wrapUIEvent(static_cast<UIEvent*>(event));
+ else
+ wrappedEvent = 0;
+
+ return DOMObjectCache::put(event, wrappedEvent);
+}
+
static gpointer wrapEventTarget(EventTarget* target)
{
ASSERT(target);