diff options
Diffstat (limited to 'WebCore/bindings/js/JSNodeCustom.cpp')
-rw-r--r-- | WebCore/bindings/js/JSNodeCustom.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/WebCore/bindings/js/JSNodeCustom.cpp b/WebCore/bindings/js/JSNodeCustom.cpp index 2b4d6d4..8f4d2c1 100644 --- a/WebCore/bindings/js/JSNodeCustom.cpp +++ b/WebCore/bindings/js/JSNodeCustom.cpp @@ -43,6 +43,7 @@ #include "JSDocumentType.h" #include "JSEntity.h" #include "JSEntityReference.h" +#include "JSEventListener.h" #include "JSHTMLElement.h" #include "JSHTMLElementWrapperFactory.h" #include "JSNotation.h" @@ -106,6 +107,34 @@ JSValuePtr JSNode::appendChild(ExecState* exec, const ArgList& args) return jsNull(); } +JSValuePtr JSNode::addEventListener(ExecState* exec, const ArgList& args) +{ + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(impl()->scriptExecutionContext()); + if (!globalObject) + return jsUndefined(); + + if (RefPtr<JSProtectedEventListener> listener = globalObject->findOrCreateJSProtectedEventListener(exec, args.at(exec, 1))) + impl()->addEventListener(args.at(exec, 0).toString(exec), listener.release(), args.at(exec, 2).toBoolean(exec)); + + return jsUndefined(); +} + +JSValuePtr JSNode::removeEventListener(ExecState* exec, const ArgList& args) +{ + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(impl()->scriptExecutionContext()); + if (!globalObject) + return jsUndefined(); + + if (JSProtectedEventListener* listener = globalObject->findJSProtectedEventListener(args.at(exec, 1))) + impl()->removeEventListener(args.at(exec, 0).toString(exec), listener, args.at(exec, 2).toBoolean(exec)); + + return jsUndefined(); +} + +void JSNode::pushEventHandlerScope(ExecState*, ScopeChain&) const +{ +} + void JSNode::mark() { ASSERT(!marked()); |