Example #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;
}
Example #2
0
 static v8::Handle<v8::Value> whatToShowAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.TreeWalker.whatToShow._get");
   TreeWalker* imp = V8TreeWalker::toNative(info.Holder());
   return v8::Integer::NewFromUnsigned(imp->whatToShow());
 }
static v8::Handle<v8::Value> whatToShowAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    TreeWalker* imp = V8TreeWalker::toNative(info.Holder());
    return v8UnsignedInteger(imp->whatToShow(), info.GetIsolate());
}