本文整理汇总了C++中htmlelementstack::ElementRecord类的典型用法代码示例。如果您正苦于以下问题:C++ ElementRecord类的具体用法?C++ ElementRecord怎么用?C++ ElementRecord使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ElementRecord类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例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;
}