summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/custom/V8NodeCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/custom/V8NodeCustom.cpp')
-rw-r--r--WebCore/bindings/v8/custom/V8NodeCustom.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/WebCore/bindings/v8/custom/V8NodeCustom.cpp b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
index 9b4b9aa..79afbe8 100644
--- a/WebCore/bindings/v8/custom/V8NodeCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NodeCustom.cpp
@@ -45,25 +45,25 @@
namespace WebCore {
-CALLBACK_FUNC_DECL(NodeAddEventListener)
+v8::Handle<v8::Value> V8Node::addEventListenerCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Node.addEventListener()");
- Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(args.Holder());
+ Node* node = V8Node::toNative(args.Holder());
RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(node, args[1], false, ListenerFindOrCreate);
if (listener) {
String type = toWebCoreString(args[0]);
bool useCapture = args[2]->BooleanValue();
node->addEventListener(type, listener, useCapture);
- createHiddenDependency(args.Holder(), args[1], V8Custom::kNodeEventListenerCacheIndex);
+ createHiddenDependency(args.Holder(), args[1], cacheIndex);
}
return v8::Undefined();
}
-CALLBACK_FUNC_DECL(NodeRemoveEventListener)
+v8::Handle<v8::Value> V8Node::removeEventListenerCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Node.removeEventListener()");
- Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(args.Holder());
+ Node* node = V8Node::toNative(args.Holder());
// It is possbile that the owner document of the node is detached
// from the frame.
@@ -73,21 +73,21 @@ CALLBACK_FUNC_DECL(NodeRemoveEventListener)
AtomicString type = v8ValueToAtomicWebCoreString(args[0]);
bool useCapture = args[2]->BooleanValue();
node->removeEventListener(type, listener.get(), useCapture);
- removeHiddenDependency(args.Holder(), args[1], V8Custom::kNodeEventListenerCacheIndex);
+ removeHiddenDependency(args.Holder(), args[1], cacheIndex);
}
return v8::Undefined();
}
// This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
-CALLBACK_FUNC_DECL(NodeInsertBefore)
+v8::Handle<v8::Value> V8Node::insertBeforeCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Node.insertBefore");
v8::Handle<v8::Object> holder = args.Holder();
- Node* imp = V8DOMWrapper::convertDOMWrapperToNode<Node>(holder);
+ Node* imp = V8Node::toNative(holder);
ExceptionCode ec = 0;
- Node* newChild = V8Node::HasInstance(args[0]) ? V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0])) : 0;
- Node* refChild = V8Node::HasInstance(args[1]) ? V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[1])) : 0;
+ Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+ Node* refChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
bool success = imp->insertBefore(newChild, refChild, ec, true);
if (ec) {
V8Proxy::setDOMException(ec);
@@ -99,14 +99,14 @@ CALLBACK_FUNC_DECL(NodeInsertBefore)
}
// This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
-CALLBACK_FUNC_DECL(NodeReplaceChild)
+v8::Handle<v8::Value> V8Node::replaceChildCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Node.replaceChild");
v8::Handle<v8::Object> holder = args.Holder();
- Node* imp = V8DOMWrapper::convertDOMWrapperToNode<Node>(holder);
+ Node* imp = V8Node::toNative(holder);
ExceptionCode ec = 0;
- Node* newChild = V8Node::HasInstance(args[0]) ? V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0])) : 0;
- Node* oldChild = V8Node::HasInstance(args[1]) ? V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[1])) : 0;
+ Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+ Node* oldChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
bool success = imp->replaceChild(newChild, oldChild, ec, true);
if (ec) {
V8Proxy::setDOMException(ec);
@@ -117,13 +117,13 @@ CALLBACK_FUNC_DECL(NodeReplaceChild)
return v8::Null();
}
-CALLBACK_FUNC_DECL(NodeRemoveChild)
+v8::Handle<v8::Value> V8Node::removeChildCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Node.removeChild");
v8::Handle<v8::Object> holder = args.Holder();
- Node* imp = V8DOMWrapper::convertDOMWrapperToNode<Node>(holder);
+ Node* imp = V8Node::toNative(holder);
ExceptionCode ec = 0;
- Node* oldChild = V8Node::HasInstance(args[0]) ? V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+ Node* oldChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
bool success = imp->removeChild(oldChild, ec);
if (ec) {
V8Proxy::setDOMException(ec);
@@ -135,13 +135,13 @@ CALLBACK_FUNC_DECL(NodeRemoveChild)
}
// This function is customized to take advantage of the optional 4th argument: shouldLazyAttach
-CALLBACK_FUNC_DECL(NodeAppendChild)
+v8::Handle<v8::Value> V8Node::appendChildCallback(const v8::Arguments& args)
{
INC_STATS("DOM.Node.appendChild");
v8::Handle<v8::Object> holder = args.Holder();
- Node* imp = V8DOMWrapper::convertDOMWrapperToNode<Node>(holder);
+ Node* imp = V8Node::toNative(holder);
ExceptionCode ec = 0;
- Node* newChild = V8Node::HasInstance(args[0]) ? V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+ Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
bool success = imp->appendChild(newChild, ec, true );
if (ec) {
V8Proxy::setDOMException(ec);