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


C++ JSHTMLCollection类代码示例

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


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

示例1: isReachableFromOpaqueRoots

bool JSHTMLCollectionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSHTMLCollection* jsHTMLCollection = static_cast<JSHTMLCollection*>(handle.get().asCell());
    if (!isObservable(jsHTMLCollection))
        return false;
    void* root = WebCore::root(jsHTMLCollection->impl()->base());
    return visitor.containsOpaqueRoot(root);
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:8,代码来源:JSHTMLCollection.cpp

示例2: jsHTMLCollectionLength

JSValue jsHTMLCollectionLength(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLCollection* castedThis = static_cast<JSHTMLCollection*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLCollection* imp = static_cast<HTMLCollection*>(castedThis->impl());
    JSValue result = jsNumber(imp->length());
    return result;
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:8,代码来源:JSHTMLCollection.cpp

示例3: jsHTMLCollectionPrototypeFunctionNamedItem

EncodedJSValue JSC_HOST_CALL jsHTMLCollectionPrototypeFunctionNamedItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSHTMLCollection::s_info))
        return throwVMTypeError(exec);
    JSHTMLCollection* castedThis = static_cast<JSHTMLCollection*>(asObject(thisValue));
    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLCollection::s_info);
    return JSValue::encode(castedThis->namedItem(exec));
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:9,代码来源:JSHTMLCollection.cpp

示例4: nameGetter

JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
    JSHTMLCollection* collection = jsCast<JSHTMLCollection*>(asObject(slotBase));
    const AtomicString& name = propertyNameToAtomicString(propertyName);
    HTMLCollection* impl = collection->impl();
#if ENABLE(MICRODATA)
    if (impl->type() == ItemProperties)
        return toJS(exec, collection->globalObject(), static_cast<HTMLPropertiesCollection*>(impl)->propertyNodeList(name));
#endif
    return toJS(exec, collection->globalObject(), impl->namedItem(name));
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:11,代码来源:JSHTMLCollectionCustom.cpp

示例5: callHTMLCollection

// HTMLCollections are strange objects, they support both get and call,
// so that document.forms.item(0) and document.forms(0) both work.
static EncodedJSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec)
{
    if (exec->argumentCount() < 1)
        return JSValue::encode(jsUndefined());

    // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case.
    JSHTMLCollection* jsCollection = static_cast<JSHTMLCollection*>(exec->callee());
    HTMLCollection* collection = jsCollection->impl();

    // Also, do we need the TypeError test here ?

    if (exec->argumentCount() == 1) {
        // Support for document.all(<index>) etc.
        bool ok;
        UString string = exec->argument(0).toString(exec);
        unsigned index = Identifier::toUInt32(string, ok);
        if (ok)
            return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection->item(index)));

        // Support for document.images('<name>') etc.
        return JSValue::encode(getNamedItems(exec, jsCollection, Identifier(exec, string)));
    }

    // The second arg, if set, is the index of the item we want
    bool ok;
    UString string = exec->argument(0).toString(exec);
    unsigned index = Identifier::toUInt32(exec->argument(1).toString(exec), ok);
    if (ok) {
        String pstr = ustringToString(string);
        Node* node = collection->namedItem(pstr);
        while (node) {
            if (!index)
                return JSValue::encode(toJS(exec, jsCollection->globalObject(), node));
            node = collection->nextNamedItem(pstr);
            --index;
        }
    }

    return JSValue::encode(jsUndefined());
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:42,代码来源:JSHTMLCollectionCustom.cpp

示例6: callHTMLCollection

// HTMLCollections are strange objects, they support both get and call,
// so that document.forms.item(0) and document.forms(0) both work.
static JSValue JSC_HOST_CALL callHTMLCollection(ExecState* exec, JSObject* function, JSValue, const ArgList& args)
{
    if (args.size() < 1)
        return jsUndefined();

    // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case.
    JSHTMLCollection* jsCollection = static_cast<JSHTMLCollection*>(function);
    HTMLCollection* collection = jsCollection->impl();

    // Also, do we need the TypeError test here ?

    if (args.size() == 1) {
        // Support for document.all(<index>) etc.
        bool ok;
        UString string = args.at(0).toString(exec);
        unsigned index = string.toUInt32(&ok, false);
        if (ok)
            return toJS(exec, jsCollection->globalObject(), collection->item(index));

        // Support for document.images('<name>') etc.
        return getNamedItems(exec, jsCollection, Identifier(exec, string));
    }

    // The second arg, if set, is the index of the item we want
    bool ok;
    UString string = args.at(0).toString(exec);
    unsigned index = args.at(1).toString(exec).toUInt32(&ok, false);
    if (ok) {
        String pstr = string;
        Node* node = collection->namedItem(pstr);
        while (node) {
            if (!index)
                return toJS(exec, jsCollection->globalObject(), node);
            node = collection->nextNamedItem(pstr);
            --index;
        }
    }

    return jsUndefined();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:42,代码来源:JSHTMLCollectionCustom.cpp

示例7: nameGetter

JSValue* JSHTMLCollection::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
    JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(slot.slotBase());
    return getNamedItems(exec, thisObj->impl(), propertyName);
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:5,代码来源:JSHTMLCollectionCustom.cpp

示例8: finalize

void JSHTMLCollectionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSHTMLCollection* jsHTMLCollection = static_cast<JSHTMLCollection*>(handle.get().asCell());
    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, jsHTMLCollection->impl(), jsHTMLCollection);
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:6,代码来源:JSHTMLCollection.cpp

示例9: indexGetter

JSValue JSHTMLCollection::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
{
    JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(asObject(slotBase));
    ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
    return toJS(exec, thisObj->globalObject(), static_cast<HTMLCollection*>(thisObj->impl())->item(index));
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:6,代码来源:JSHTMLCollection.cpp

示例10: jsHTMLCollectionConstructor

JSValue jsHTMLCollectionConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLCollection* domObject = static_cast<JSHTMLCollection*>(asObject(slotBase));
    return JSHTMLCollection::getConstructor(exec, domObject->globalObject());
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:5,代码来源:JSHTMLCollection.cpp

示例11: nameGetter

JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
    JSHTMLCollection* collection = jsCast<JSHTMLCollection*>(asObject(slotBase));
    const AtomicString& name = propertyNameToAtomicString(propertyName);
    return toJS(exec, collection->globalObject(), collection->impl()->namedItem(name));
}
开发者ID:kcomkar,项目名称:webkit,代码行数:6,代码来源:JSHTMLCollectionCustom.cpp


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