本文整理汇总了C++中NamedNodeMap::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ NamedNodeMap::isEmpty方法的具体用法?C++ NamedNodeMap::isEmpty怎么用?C++ NamedNodeMap::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NamedNodeMap
的用法示例。
在下文中一共展示了NamedNodeMap::isEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: highestVisuallyEquivalentDivBelowRoot
// When inserting a new line, we want to avoid nesting empty divs if we can. Otherwise, when
// pasting, it's easy to have each new line be a div deeper than the previous. E.g., in the case
// below, we want to insert at ^ instead of |.
// <div>foo<div>bar</div>|</div>^
static Element* highestVisuallyEquivalentDivBelowRoot(Element* startBlock)
{
Element* curBlock = startBlock;
// We don't want to return a root node (if it happens to be a div, e.g., in a document fragment) because there are no
// siblings for us to append to.
while (!curBlock->nextSibling() && curBlock->parentElement()->hasTagName(divTag) && curBlock->parentElement()->parentElement()) {
NamedNodeMap* attributes = curBlock->parentElement()->attributes(true);
if (attributes && !attributes->isEmpty())
break;
curBlock = curBlock->parentElement();
}
return curBlock;
}