webkit jsbind

来源:互联网 发布:mac 产品原型设计工具 编辑:程序博客网 时间:2024/06/06 16:55


 

 CREATE_DOM_NODE_WRAPPER(exec, globalObject, Text, text);

 

view plaincopy to clipboardprint?
  1. #define CREATE_DOM_NODE_WRAPPER(exec, globalObject, className, object) createDOMNodeWrapper<JS##className>(exec, globalObject, static_cast<className*>(object))  
  2.    template<class WrapperClass, class DOMClass> inline JSNode* createDOMNodeWrapper(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMClass* node)  
  3.    {  
  4.        ASSERT(node);  
  5.        ASSERT(!getCachedDOMNodeWrapper(exec, node->document(), node));  
  6.        WrapperClass* wrapper = new (exec) WrapperClass(getDOMStructure<WrapperClass>(exec, globalObject), globalObject, node);  
  7.        // FIXME: The entire function can be removed, once we fix caching.  
  8.        // This function is a one-off hack to make Nodes cache in the right global object.  
  9.        cacheDOMNodeWrapper(exec, node->document(), node, wrapper);  
  10.        return wrapper;  
  11.    }  

 

原创粉丝点击