Ejemplo n.º 1
0
JSValue* JSTreeWalker::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case RootAttrNum: {
        TreeWalker* imp = static_cast<TreeWalker*>(impl());
        return toJS(exec, WTF::getPtr(imp->root()));
    }
    case WhatToShowAttrNum: {
        TreeWalker* imp = static_cast<TreeWalker*>(impl());
        return jsNumber(exec, imp->whatToShow());
    }
    case FilterAttrNum: {
        TreeWalker* imp = static_cast<TreeWalker*>(impl());
        return toJS(exec, WTF::getPtr(imp->filter()));
    }
    case ExpandEntityReferencesAttrNum: {
        TreeWalker* imp = static_cast<TreeWalker*>(impl());
        return jsBoolean(imp->expandEntityReferences());
    }
    case CurrentNodeAttrNum: {
        TreeWalker* imp = static_cast<TreeWalker*>(impl());
        return toJS(exec, WTF::getPtr(imp->currentNode()));
    }
    }
    return 0;
}
Ejemplo n.º 2
0
 static v8::Handle<v8::Value> rootAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.TreeWalker.root._get");
   TreeWalker* imp = V8TreeWalker::toNative(info.Holder());
   return toV8(imp->root());
 }
static v8::Handle<v8::Value> rootAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    TreeWalker* imp = V8TreeWalker::toNative(info.Holder());
    return toV8Fast(imp->root(), info, imp);
}