本文整理汇总了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());
}
示例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;
}
示例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());
}
示例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);
}
示例5: jsHTMLElementConstructor
JSValue jsHTMLElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* domObject = static_cast<JSHTMLElement*>(asObject(slotBase));
return JSHTMLElement::getConstructor(exec, domObject->globalObject());
}