本文整理汇总了C++中HTMLDocument::documentNamedItemContainsMultipleElements方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLDocument::documentNamedItemContainsMultipleElements方法的具体用法?C++ HTMLDocument::documentNamedItemContainsMultipleElements怎么用?C++ HTMLDocument::documentNamedItemContainsMultipleElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLDocument
的用法示例。
在下文中一共展示了HTMLDocument::documentNamedItemContainsMultipleElements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nameGetter
JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>(asObject(slotBase));
HTMLDocument* document = thisObj->impl();
AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
if (!atomicPropertyName || !document->hasDocumentNamedItem(atomicPropertyName))
return jsUndefined();
if (UNLIKELY(document->documentNamedItemContainsMultipleElements(atomicPropertyName))) {
RefPtr<HTMLCollection> collection = document->documentNamedItems(atomicPropertyName);
ASSERT(!collection->isEmpty());
ASSERT(!collection->hasExactlyOneItem());
return toJS(exec, thisObj->globalObject(), WTF::getPtr(collection));
}
Node* node = document->documentNamedItem(atomicPropertyName);
Frame* frame;
if (node->hasTagName(iframeTag) && (frame = toHTMLIFrameElement(node)->contentFrame()))
return toJS(exec, frame);
return toJS(exec, thisObj->globalObject(), node);
}