本文整理汇总了C++中htmlelementstack::ElementRecord::next方法的典型用法代码示例。如果您正苦于以下问题:C++ ElementRecord::next方法的具体用法?C++ ElementRecord::next怎么用?C++ ElementRecord::next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htmlelementstack::ElementRecord
的用法示例。
在下文中一共展示了ElementRecord::next方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findFosterSite
void HTMLConstructionSite::findFosterSite(HTMLConstructionSiteTask& task)
{
// When a node is to be foster parented, the last template element with no table element is below it in the stack of open elements is the foster parent element (NOT the template's parent!)
HTMLElementStack::ElementRecord* lastTemplateElement = m_openElements.topmost(templateTag.localName());
if (lastTemplateElement && !m_openElements.inTableScope(tableTag)) {
task.parent = lastTemplateElement->element();
return;
}
HTMLElementStack::ElementRecord* lastTableElementRecord = m_openElements.topmost(tableTag.localName());
if (lastTableElementRecord) {
Element* lastTableElement = lastTableElementRecord->element();
ContainerNode* parent;
if (lastTableElementRecord->next()->stackItem()->hasTagName(templateTag))
parent = lastTableElementRecord->next()->element();
else
parent = lastTableElement->parentNode();
// When parsing HTML fragments, we skip step 4.2 ("Let root be a new html element with no attributes") for efficiency,
// and instead use the DocumentFragment as a root node. So we must treat the root node (DocumentFragment) as if it is a html element here.
if (parent && (parent->isElementNode() || (m_isParsingFragment && parent == m_openElements.rootNode()))) {
task.parent = parent;
task.nextChild = lastTableElement;
return;
}
task.parent = lastTableElementRecord->next()->element();
return;
}
// Fragment case
task.parent = m_openElements.rootNode(); // DocumentFragment
}
示例2: inScopeCommon
bool inScopeCommon(HTMLElementStack::ElementRecord* top, const AtomicString& targetTag)
{
for (HTMLElementStack::ElementRecord* pos = top; pos; pos = pos->next()) {
HTMLStackItem* item = pos->stackItem().get();
if (item->matchesHTMLTag(targetTag))
return true;
if (isMarker(item))
return false;
}
ASSERT_NOT_REACHED(); // <html> is always on the stack and is a scope marker.
return false;
}
示例3: inScopeCommon
bool inScopeCommon(HTMLElementStack::ElementRecord* top, const AtomicString& targetTag)
{
for (HTMLElementStack::ElementRecord* pos = top; pos; pos = pos->next()) {
Element* element = pos->element();
if (element->hasLocalName(targetTag))
return true;
if (isMarker(element))
return false;
}
ASSERT_NOT_REACHED(); // <html> is always on the stack and is a scope marker.
return false;
}
示例4: findFosterSite
void HTMLConstructionSite::findFosterSite(AttachmentSite& site)
{
HTMLElementStack::ElementRecord* lastTableElementRecord = m_openElements.topmost(tableTag.localName());
if (lastTableElementRecord) {
Element* lastTableElement = lastTableElementRecord->element();
if (ContainerNode* parent = lastTableElement->parentNode()) {
site.parent = parent;
site.nextChild = lastTableElement;
return;
}
site.parent = lastTableElementRecord->next()->element();
site.nextChild = 0;
return;
}
// Fragment case
site.parent = m_openElements.rootNode(); // DocumentFragment
site.nextChild = 0;
}
示例5: stateFor
HTMLTreeBuilderSimulator::State HTMLTreeBuilderSimulator::stateFor(
HTMLTreeBuilder* treeBuilder) {
ASSERT(isMainThread());
State namespaceStack;
for (HTMLElementStack::ElementRecord* record =
treeBuilder->openElements()->topRecord();
record; record = record->next()) {
Namespace currentNamespace = HTML;
if (record->namespaceURI() == SVGNames::svgNamespaceURI)
currentNamespace = SVG;
else if (record->namespaceURI() == MathMLNames::mathmlNamespaceURI)
currentNamespace = MathML;
if (namespaceStack.isEmpty() || namespaceStack.last() != currentNamespace)
namespaceStack.append(currentNamespace);
}
namespaceStack.reverse();
return namespaceStack;
}