summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSNodeCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSNodeCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSNodeCustom.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/WebCore/bindings/js/JSNodeCustom.cpp b/WebCore/bindings/js/JSNodeCustom.cpp
index 52f21e7..2a4aa80 100644
--- a/WebCore/bindings/js/JSNodeCustom.cpp
+++ b/WebCore/bindings/js/JSNodeCustom.cpp
@@ -110,37 +110,21 @@ JSValue JSNode::appendChild(ExecState* exec, const ArgList& args)
JSValue JSNode::addEventListener(ExecState* exec, const ArgList& args)
{
- Document* document = impl()->document();
- if (!document)
- return jsUndefined();
-
- JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(document);
- if (!globalObject)
- return jsUndefined();
-
JSValue listener = args.at(1);
if (!listener.isObject())
return jsUndefined();
- impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), false), args.at(2).toBoolean(exec));
+ impl()->addEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), false, currentWorld(exec)), args.at(2).toBoolean(exec));
return jsUndefined();
}
JSValue JSNode::removeEventListener(ExecState* exec, const ArgList& args)
{
- Document* document = impl()->document();
- if (!document)
- return jsUndefined();
-
- JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(document);
- if (!globalObject)
- return jsUndefined();
-
JSValue listener = args.at(1);
if (!listener.isObject())
return jsUndefined();
- impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), false).get(), args.at(2).toBoolean(exec));
+ impl()->removeEventListener(args.at(0).toString(exec), JSEventListener::create(asObject(listener), false, currentWorld(exec)).get(), args.at(2).toBoolean(exec));
return jsUndefined();
}
@@ -159,10 +143,8 @@ void JSNode::markChildren(MarkStack& markStack)
// the document, we need to mark the document, but we don't need to explicitly
// mark any other nodes.
if (node->inDocument()) {
- if (Document* doc = node->ownerDocument()) {
- if (DOMObject* docWrapper = getCachedDOMObjectWrapper(*Heap::heap(this)->globalData(), doc))
- markStack.append(docWrapper);
- }
+ if (Document* doc = node->ownerDocument())
+ markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), doc);
return;
}