本文整理汇总了C++中SVGUseElement::nodeName方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGUseElement::nodeName方法的具体用法?C++ SVGUseElement::nodeName怎么用?C++ SVGUseElement::nodeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGUseElement
的用法示例。
在下文中一共展示了SVGUseElement::nodeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpInstanceTree
static void dumpInstanceTree(unsigned int& depth, String& text, SVGElementInstance* targetInstance)
{
SVGElement* element = targetInstance->correspondingElement();
ASSERT(element);
if (element->hasTagName(SVGNames::useTag)) {
if (toSVGUseElement(element)->cachedDocumentIsStillLoading())
return;
}
SVGElement* shadowTreeElement = targetInstance->shadowTreeElement();
ASSERT(shadowTreeElement);
SVGUseElement* directUseElement = targetInstance->directUseElement();
String directUseElementName = directUseElement ? directUseElement->nodeName() : "null";
String elementId = element->getIdAttribute();
String elementNodeName = element->nodeName();
String shadowTreeElementNodeName = shadowTreeElement->nodeName();
String parentNodeName = element->parentNode() ? element->parentNode()->nodeName() : "null";
String firstChildNodeName = element->firstChild() ? element->firstChild()->nodeName() : "null";
for (unsigned int i = 0; i < depth; ++i)
text += " ";
text += String::format("SVGElementInstance this=%p, (parentNode=%s (%p), firstChild=%s (%p), correspondingElement=%s (%p), directUseElement=%s (%p), shadowTreeElement=%s (%p), id=%s)\n",
targetInstance, parentNodeName.latin1().data(), element->parentNode(), firstChildNodeName.latin1().data(), element->firstChild(),
elementNodeName.latin1().data(), element, directUseElementName.latin1().data(), directUseElement, shadowTreeElementNodeName.latin1().data(), shadowTreeElement, elementId.latin1().data());
for (unsigned int i = 0; i < depth; ++i)
text += " ";
const HashSet<SVGElementInstance*>& elementInstances = element->instancesForElement();
text += "Corresponding element is associated with " + String::number(elementInstances.size()) + " instance(s):\n";
const HashSet<SVGElementInstance*>::const_iterator end = elementInstances.end();
for (HashSet<SVGElementInstance*>::const_iterator it = elementInstances.begin(); it != end; ++it) {
for (unsigned int i = 0; i < depth; ++i)
text += " ";
text += String::format(" -> SVGElementInstance this=%p, (refCount: %i, shadowTreeElement in document? %i)\n",
*it, (*it)->refCount(), (*it)->shadowTreeElement()->inDocument());
}
++depth;
for (SVGElementInstance* instance = targetInstance->firstChild(); instance; instance = instance->nextSibling())
dumpInstanceTree(depth, text, instance);
--depth;
}