当前位置: 首页>>代码示例>>C++>>正文


C++ ElementRecord::next方法代码示例

本文整理汇总了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
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:31,代码来源:HTMLConstructionSite.cpp

示例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;
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:12,代码来源:HTMLElementStack.cpp

示例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;
}
开发者ID:NewDreamUser2,项目名称:webkit-webcl,代码行数:12,代码来源:HTMLElementStack.cpp

示例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;
}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:18,代码来源:HTMLConstructionSite.cpp

示例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;
}
开发者ID:ollie314,项目名称:chromium,代码行数:19,代码来源:HTMLTreeBuilderSimulator.cpp


注:本文中的htmlelementstack::ElementRecord::next方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。