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


C++ JSHTMLElement::globalObject方法代码示例

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


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

示例1: nameGetter

JSValue JSHTMLFormElement::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
    JSHTMLElement* jsForm = jsCast<JSHTMLFormElement*>(asObject(slotBase));
    HTMLFormElement* form = toHTMLFormElement(jsForm->impl());

    Vector<RefPtr<Node> > namedItems;
    form->getNamedElements(propertyNameToAtomicString(propertyName), namedItems);
    
    if (namedItems.isEmpty())
        return jsUndefined();
    if (namedItems.size() == 1)
        return toJS(exec, jsForm->globalObject(), namedItems[0].get());

    // FIXME: HTML5 specifies that this should be a RadioNodeList.
    return toJS(exec, jsForm->globalObject(), StaticNodeList::adopt(namedItems).get());
}
开发者ID:KnightSwarm,项目名称:WebKitTi,代码行数:16,代码来源:JSHTMLFormElementCustom.cpp

示例2: jsHTMLElementChildren

JSValue jsHTMLElementChildren(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->children()));
    return result;
}
开发者ID:dpnishant,项目名称:tpjs,代码行数:8,代码来源:JSHTMLElement.cpp

示例3: nameGetter

JSValue JSHTMLFormElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
    JSHTMLElement* jsForm = static_cast<JSHTMLFormElement*>(asObject(slot.slotBase()));
    HTMLFormElement* form = static_cast<HTMLFormElement*>(jsForm->impl());

    Vector<RefPtr<Node> > namedItems;
    form->getNamedElements(propertyName, namedItems);
    
    if (namedItems.isEmpty())
        return jsUndefined();
    if (namedItems.size() == 1)
        return toJS(exec, namedItems[0].get());

    // FIXME: HTML5 specifies that this should be a RadioNodeList.
    return toJS(exec, jsForm->globalObject(), StaticNodeList::adopt(namedItems).get());
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:16,代码来源:JSHTMLFormElementCustom.cpp

示例4: jsHTMLElementPrototypeFunctionInsertAdjacentElement

EncodedJSValue JSC_HOST_CALL jsHTMLElementPrototypeFunctionInsertAdjacentElement(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSHTMLElement::s_info))
        return throwVMTypeError(exec);
    JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(thisValue));
    HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
    ExceptionCode ec = 0;
    const String& where(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    Element* element(toElement(exec->argument(1)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->insertAdjacentElement(where, element, ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
开发者ID:dpnishant,项目名称:tpjs,代码行数:20,代码来源:JSHTMLElement.cpp

示例5: jsHTMLElementConstructor

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


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