当前位置: 首页>>代码示例>>C++>>正文


C++ JSNodeList类代码示例

本文整理汇总了C++中JSNodeList的典型用法代码示例。如果您正苦于以下问题:C++ JSNodeList类的具体用法?C++ JSNodeList怎么用?C++ JSNodeList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了JSNodeList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: finalize

void JSNodeListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.get().asCell());
    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, &jsNodeList->impl(), jsNodeList);
    jsNodeList->releaseImpl();
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:7,代码来源:JSNodeList.cpp

示例2: getOwnPropertyNames

void JSNodeList::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
    JSNodeList* thisObject = jsCast<JSNodeList*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    for (unsigned i = 0, count = thisObject->impl().length(); i < count; ++i)
        propertyNames.add(Identifier::from(exec, i));
     Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:8,代码来源:JSNodeList.cpp

示例3: isReachableFromOpaqueRoots

bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.get().asCell());
    if (!jsNodeList->hasCustomProperties())
        return false;
    if (!jsNodeList->impl()->isDynamicNodeList())
        return false;
    return visitor.containsOpaqueRoot(root(static_cast<DynamicNodeList*>(jsNodeList->impl())->node()));
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:9,代码来源:JSNodeListCustom.cpp

示例4: jsNodeListConstructor

EncodedJSValue jsNodeListConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSNodeList* domObject = jsDynamicCast<JSNodeList*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSNodeList::getConstructor(exec->vm(), domObject->globalObject()));
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:9,代码来源:JSNodeList.cpp

示例5: jsNodeListLength

EncodedJSValue jsNodeListLength(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSNodeList* castedThis = jsDynamicCast<JSNodeList*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    NodeList& impl = castedThis->impl();
    JSValue result = jsNumber(impl.length());
    return JSValue::encode(result);
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:11,代码来源:JSNodeList.cpp

示例6: getOwnPropertySlotByIndex

bool JSNodeList::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)
{
    JSNodeList* thisObject = jsCast<JSNodeList*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    if (index < thisObject->impl().length()) {
        unsigned attributes = DontDelete | ReadOnly;
        slot.setCustomIndex(thisObject, attributes, index, thisObject->indexGetter);
        return true;
    }
    PropertyName propertyName = Identifier::from(exec, index);
    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
        return true;
    }
    return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:16,代码来源:JSNodeList.cpp

示例7: jsNodeListPrototypeFunctionItem

JSValue* jsNodeListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSNodeList::s_info))
        return throwError(exec, TypeError);
    JSNodeList* castedThisObj = static_cast<JSNodeList*>(thisValue);
    NodeList* imp = static_cast<NodeList*>(castedThisObj->impl());
    int index = args[0]->toInt32(exec);
    if (index < 0) {
        setDOMException(exec, INDEX_SIZE_ERR);
        return jsUndefined();
    }


    KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->item(index)));
    return result;
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:16,代码来源:JSNodeList.cpp

示例8: jsNodeListPrototypeFunctionItem

EncodedJSValue JSC_HOST_CALL jsNodeListPrototypeFunctionItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSNodeList* castedThis = jsDynamicCast<JSNodeList*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSNodeList::info());
    NodeList& impl = castedThis->impl();
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    unsigned index(toUInt32(exec, exec->argument(0), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.item(index)));
    return JSValue::encode(result);
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:17,代码来源:JSNodeList.cpp

示例9: isReachableFromOpaqueRoots

bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.slot()->asCell());
    if (!jsNodeList->hasCustomProperties())
        return false;
    if (jsNodeList->impl().isLiveNodeList())
        return visitor.containsOpaqueRoot(root(static_cast<LiveNodeList&>(jsNodeList->impl()).ownerNode()));
    if (jsNodeList->impl().isChildNodeList())
        return visitor.containsOpaqueRoot(root(static_cast<ChildNodeList&>(jsNodeList->impl()).ownerNode()));
    if (jsNodeList->impl().isEmptyNodeList())
        return visitor.containsOpaqueRoot(root(static_cast<EmptyNodeList&>(jsNodeList->impl()).ownerNode()));
    return false;
}
开发者ID:PTaylour,项目名称:webkit,代码行数:13,代码来源:JSNodeListCustom.cpp

示例10: ASSERT_GC_OBJECT_INHERITS

bool JSNodeList::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSNodeList* thisObject = jsCast<JSNodeList*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    const HashEntry* entry = getStaticValueSlotEntryWithoutCaching<JSNodeList>(exec, propertyName);
    if (entry) {
        slot.setCustom(thisObject, entry->attributes(), entry->propertyGetter());
        return true;
    }
    unsigned index = propertyName.asIndex();
    if (index != PropertyName::NotAnIndex && index < thisObject->impl().length()) {
        unsigned attributes = DontDelete | ReadOnly;
        slot.setCustomIndex(thisObject, attributes, index, indexGetter);
        return true;
    }
    if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, thisObject->nameGetter);
        return true;
    }
    return getStaticValueSlot<JSNodeList, Base>(exec, JSNodeListTable, thisObject, propertyName, slot);
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:21,代码来源:JSNodeList.cpp

示例11: nameGetter

JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
    JSNodeList* thisObj = static_cast<JSNodeList*>(asObject(slotBase));
    return toJS(exec, thisObj->impl()->itemWithName(identifierToAtomicString(propertyName)));
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:5,代码来源:JSNodeListCustom.cpp

示例12: nameGetter

KJS::JSValue* JSNodeList::nameGetter(KJS::ExecState* exec, KJS::JSObject* originalObject, const KJS::Identifier& propertyName, const KJS::PropertySlot& slot)
{
    JSNodeList* thisObj = static_cast<JSNodeList*>(slot.slotBase());
    return toJS(exec, thisObj->impl()->itemWithName(propertyName));
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:5,代码来源:JSNodeListCustom.cpp

示例13: nameGetter

JSValue JSNodeList::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
    JSNodeList* thisObj = static_cast<JSNodeList*>(asObject(slot.slotBase()));
    return toJS(exec, thisObj->impl()->itemWithName(propertyName));
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:5,代码来源:JSNodeListCustom.cpp

示例14: nameGetter

JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
    JSNodeList* thisObj = jsCast<JSNodeList*>(asObject(slotBase));
    return toJS(exec, thisObj->globalObject(), thisObj->impl()->itemWithName(propertyNameToAtomicString(propertyName)));
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:5,代码来源:JSNodeListCustom.cpp

示例15: indexGetter

EncodedJSValue JSNodeList::indexGetter(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, unsigned index)
{
    JSNodeList* thisObj = jsCast<JSNodeList*>(JSValue::decode(slotBase));
    ASSERT_GC_OBJECT_INHERITS(thisObj, info());
    return JSValue::encode(toJS(exec, thisObj->globalObject(), thisObj->impl().item(index)));
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:6,代码来源:JSNodeList.cpp


注:本文中的JSNodeList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。