本文整理汇总了C++中SVGUseElement::buildShadowAndInstanceTree方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGUseElement::buildShadowAndInstanceTree方法的具体用法?C++ SVGUseElement::buildShadowAndInstanceTree怎么用?C++ SVGUseElement::buildShadowAndInstanceTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGUseElement
的用法示例。
在下文中一共展示了SVGUseElement::buildShadowAndInstanceTree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateFromElement
void RenderSVGShadowTreeRootContainer::updateFromElement()
{
bool hadExistingTree = m_shadowRoot;
SVGUseElement* useElement = static_cast<SVGUseElement*>(node());
if (!m_shadowRoot) {
ASSERT(!m_recreateTree);
m_shadowRoot = new SVGShadowTreeRootElement(document(), useElement);
useElement->buildPendingResource();
}
ASSERT(m_shadowRoot->shadowParentNode() == useElement);
bool shouldRecreateTree = m_recreateTree;
if (m_recreateTree) {
ASSERT(hadExistingTree);
if (m_shadowRoot->attached())
m_shadowRoot->detach();
m_shadowRoot->removeAllChildren();
m_recreateTree = false;
}
// Only rebuild the shadow tree, if we a) never had a tree or b) we were specifically asked to do so
// If the use element is a pending resource, and a) or b) is true, do nothing, and wait for the use
// element to be asked to buildPendingResource(), this will call us again, with m_recreateTrue=true.
if ((shouldRecreateTree || !hadExistingTree) && !useElement->isPendingResource()) {
useElement->buildShadowAndInstanceTree(m_shadowRoot.get());
// Attach shadow root element
m_shadowRoot->attachElement(style(), renderArena());
// Attach subtree, as if it was a regular non-shadow tree
for (Node* child = m_shadowRoot->firstChild(); child; child = child->nextSibling())
child->attach();
}
ASSERT(!m_recreateTree);
RenderSVGTransformableContainer::updateFromElement();
}