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


C++ ContainerNode::setNeedsStyleRecalc方法代码示例

本文整理汇总了C++中ContainerNode::setNeedsStyleRecalc方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerNode::setNeedsStyleRecalc方法的具体用法?C++ ContainerNode::setNeedsStyleRecalc怎么用?C++ ContainerNode::setNeedsStyleRecalc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContainerNode的用法示例。


在下文中一共展示了ContainerNode::setNeedsStyleRecalc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: registerWithScopingNode

void HTMLStyleElement::registerWithScopingNode()
{
    // Note: We cannot rely on the 'scoped' element already being present when this method is invoked.
    // Therefore we cannot rely on scoped()!
    ASSERT(!m_isRegisteredWithScopingNode);
    ASSERT(inDocument());
    if (m_isRegisteredWithScopingNode)
        return;
    if (!ContextEnabledFeatures::styleScopedEnabled(document()))
        return;

    ContainerNode* scope = parentNode();
    if (!scope)
        return;
    if (!scope->isElementNode() && !scope->isShadowRoot()) {
        // DocumentFragment nodes should never be inDocument,
        // <style> should not be a child of Document, PI or some such.
        ASSERT_NOT_REACHED();
        return;
    }

    scope->registerScopedHTMLStyleChild();
    scope->setNeedsStyleRecalc();
    if (inDocument() && !document()->parsing() && document()->renderer())
        document()->styleResolverChanged(DeferRecalcStyle);

    m_isRegisteredWithScopingNode = true;
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例2: unregisterWithScopingNode

void HTMLStyleElement::unregisterWithScopingNode()
{
    // Note: We cannot rely on the 'scoped' element still being present when this method is invoked.
    // Therefore we cannot rely on scoped()!
    ASSERT(m_isRegisteredWithScopingNode || !RuntimeEnabledFeatures::styleScopedEnabled());
    if (!m_isRegisteredWithScopingNode)
        return;
    if (!RuntimeEnabledFeatures::styleScopedEnabled())
        return;

    ContainerNode* scope = parentNode();
    ASSERT(scope);
    if (scope) {
        ASSERT(scope->hasScopedHTMLStyleChild());
        scope->unregisterScopedHTMLStyleChild();
        scope->setNeedsStyleRecalc();
    }
    if (inDocument() && !document()->parsing() && document()->renderer())
        document()->styleResolverChanged(DeferRecalcStyle);

    m_isRegisteredWithScopingNode = false;
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例3: invalidateStyle

void StyleSheetInvalidationAnalysis::invalidateStyle()
{
    ASSERT(!m_dirtiesAllStyle);

    if (m_treeScope->rootNode().isShadowRoot()) {
        ContainerNode* shadowHost = toShadowRoot(m_treeScope->rootNode()).host();
        shadowHost->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange));
        return;
    }

    if (m_idScopes.isEmpty() && m_classScopes.isEmpty())
        return;
    Element* element = ElementTraversal::firstWithin(m_treeScope->document());
    while (element) {
        if (elementMatchesSelectorScopes(element, m_idScopes, m_classScopes)) {
            element->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange));
            // The whole subtree is now invalidated, we can skip to the next sibling.
            element = ElementTraversal::nextSkippingChildren(*element);
            continue;
        }
        element = ElementTraversal::next(*element);
    }
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:23,代码来源:StyleSheetInvalidationAnalysis.cpp


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