static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& args) { INC_STATS("DOM.Node.removeEventListener()"); RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly); if (listener) { V8Node::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue()); } return v8::Undefined(); }
static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args) { INC_STATS("DOM.TestEventTarget.addEventListener()"); RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate); if (listener) { V8TestEventTarget::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue()); createHiddenDependency(args.Holder(), args[1], V8TestEventTarget::eventListenerCacheIndex); } return v8::Undefined(); }
AtomicString toAtomicWebCoreStringWithNullCheck(v8::Handle<v8::Value> value) { if (value->IsNull()) return AtomicString(); return v8ValueToAtomicWebCoreString(value); }