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


C++ StyleBase::parent方法代码示例

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


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

示例1: notifyChanged

void MediaList::notifyChanged()
{
    for (StyleBase* p = parent(); p; p = p->parent()) {
        if (p->isCSSStyleSheet())
            return static_cast<CSSStyleSheet*>(p)->styleSheetChanged();
    }
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:7,代码来源:MediaList.cpp

示例2: stylesheet

StyleSheet* StyleBase::stylesheet()
{
    StyleBase *b = this;
    while (b && !b->isStyleSheet())
        b = b->parent();
    return static_cast<StyleSheet*>(b);
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:7,代码来源:StyleBase.cpp

示例3: calculateGroupId

static GroupId calculateGroupId(StyleBase* styleBase)
{
    ASSERT(styleBase);
    StyleBase* current = styleBase;
    StyleSheet* styleSheet = 0;
    while (true) {
        // Special case: CSSStyleDeclarations might be either inline and in this case
        // we need to group them with their node or regular ones.
        if (current->isMutableStyleDeclaration()) {
            CSSMutableStyleDeclaration* cssMutableStyleDeclaration = static_cast<CSSMutableStyleDeclaration*>(current);
            if (cssMutableStyleDeclaration->isInlineStyleDeclaration()) {
                ASSERT(cssMutableStyleDeclaration->parent()->isStyleSheet());
                return calculateGroupId(cssMutableStyleDeclaration->node());
            }
            // Either we have no parent, or this parent is a CSSRule.
            ASSERT(cssMutableStyleDeclaration->parent() == cssMutableStyleDeclaration->parentRule());
        }

        if (current->isStyleSheet())
            styleSheet = static_cast<StyleSheet*>(current);

        StyleBase* parent = current->parent();
        if (!parent)
            break;
        current = parent;
    }

    if (styleSheet) {
        if (Node* ownerNode = styleSheet->ownerNode())
            return calculateGroupId(ownerNode);
        return GroupId(styleSheet);
    }

    return GroupId(current);
}
开发者ID:ohyeah521,项目名称:GT-I9300_Platform,代码行数:35,代码来源:V8GCController.cpp

示例4: setNeedsStyleRecalc

void CSSMutableStyleDeclaration::setNeedsStyleRecalc()
{
    if (m_node) {
        // FIXME: Ideally, this should be factored better and there
        // should be a subclass of CSSMutableStyleDeclaration just
        // for inline style declarations that handles this
        bool isInlineStyleDeclaration = m_node->isStyledElement() && this == static_cast<StyledElement*>(m_node)->inlineStyleDecl();
        if (isInlineStyleDeclaration) {
            m_node->setNeedsStyleRecalc(InlineStyleChange);
            static_cast<StyledElement*>(m_node)->invalidateStyleAttribute();
            if (m_node->document())
                InspectorInstrumentation::didInvalidateStyleAttr(m_node->document(), m_node);
        } else
            m_node->setNeedsStyleRecalc(FullStyleChange);
        return;
    }

    StyleBase* root = this;
    while (StyleBase* parent = root->parent())
        root = parent;
    if (root->isCSSStyleSheet()) {
        if (Document* document = static_cast<CSSStyleSheet*>(root)->document())
            document->styleSelectorChanged(DeferRecalcStyle);
    }
}
开发者ID:NewDreamUser2,项目名称:webkit-webcl,代码行数:25,代码来源:CSSMutableStyleDeclaration.cpp

示例5: setChanged

void CSSVariablesDeclaration::setChanged()
{
    // FIXME: Make this much better (it has the same problem CSSMutableStyleDeclaration does).
    StyleBase* root = this;
    while (StyleBase* parent = root->parent())
        root = parent;
    if (root->isCSSStyleSheet())
        static_cast<CSSStyleSheet*>(root)->doc()->updateStyleSelector();
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:9,代码来源:CSSVariablesDeclaration.cpp

示例6: styleSheetChanged

void CSSStyleSheet::styleSheetChanged()
{
    StyleBase* root = this;
    while (StyleBase* parent = root->parent())
        root = parent;
    Document* documentToUpdate = root->isCSSStyleSheet() ? static_cast<CSSStyleSheet*>(root)->document() : 0;

    /* FIXME: We don't need to do everything updateStyleSelector does,
     * basically we just need to recreate the document's selector with the
     * already existing style sheets.
     */
    if (documentToUpdate)
        documentToUpdate->styleSelectorChanged(DeferRecalcStyle);
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:14,代码来源:CSSStyleSheet.cpp

示例7: document

Document* CSSStyleSheet::document()
{
    StyleBase* styleObject = this;
    while (styleObject) {
        if (styleObject->isCSSStyleSheet()) {
            Node* ownerNode = static_cast<CSSStyleSheet*>(styleObject)->ownerNode();
            if (ownerNode)
                return ownerNode->document();
        }
        if (styleObject->isRule())
            styleObject = static_cast<CSSRule*>(styleObject)->parentStyleSheet();
        else
            styleObject = styleObject->parent();
    }

    return 0;
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:17,代码来源:CSSStyleSheet.cpp

示例8: insertedIntoParent

void CSSImportRule::insertedIntoParent()
{
    CSSStyleSheet* parentSheet = parentStyleSheet();
    if (!parentSheet || !parentSheet->document())
        return;

    CachedResourceLoader* cachedResourceLoader = parentSheet->document()->cachedResourceLoader();
    if (!cachedResourceLoader)
        return;

    String absHref = m_strHref;
    if (!parentSheet->finalURL().isNull())
        // use parent styleheet's URL as the base URL
        absHref = KURL(parentSheet->finalURL(), m_strHref).string();

    // Check for a cycle in our import chain.  If we encounter a stylesheet
    // in our parent chain with the same URL, then just bail.
    StyleBase* root = this;
    for (StyleBase* curr = parent(); curr; curr = curr->parent()) {
        // FIXME: This is wrong if the finalURL was updated via document::updateBaseURL. 
        if (curr->isCSSStyleSheet() && absHref == static_cast<CSSStyleSheet*>(curr)->finalURL().string())
            return;
        root = curr;
    }

    ResourceRequest request(parentSheet->document()->completeURL(absHref));
    if (parentSheet->isUserStyleSheet())
        m_cachedSheet = cachedResourceLoader->requestUserCSSStyleSheet(request, parentSheet->charset());
    else
        m_cachedSheet = cachedResourceLoader->requestCSSStyleSheet(request, parentSheet->charset());
    if (m_cachedSheet) {
        // if the import rule is issued dynamically, the sheet may be
        // removed from the pending sheet count, so let the doc know
        // the sheet being imported is pending.
        if (parentSheet && parentSheet->loadCompleted() && root == parentSheet)
            parentSheet->startLoadingDynamicSheet();
        m_loading = true;
        m_cachedSheet->addClient(this);
    }
}
开发者ID:studiomobile,项目名称:webcore,代码行数:40,代码来源:CSSImportRule.cpp

示例9: setChanged

void CSSMutableStyleDeclaration::setChanged()
{
    if (m_node) {
        // FIXME: Ideally, this should be factored better and there
        // should be a subclass of CSSMutableStyleDeclaration just
        // for inline style declarations that handles this
        bool isInlineStyleDeclaration = m_node->isStyledElement() && this == static_cast<StyledElement*>(m_node)->inlineStyleDecl();
        if (isInlineStyleDeclaration) {
            m_node->setChanged(InlineStyleChange);
            static_cast<StyledElement*>(m_node)->invalidateStyleAttribute();
        } else
            m_node->setChanged(FullStyleChange);
        return;
    }

    // FIXME: quick&dirty hack for KDE 3.0... make this MUCH better! (Dirk)
    StyleBase* root = this;
    while (StyleBase* parent = root->parent())
        root = parent;
    if (root->isCSSStyleSheet())
        static_cast<CSSStyleSheet*>(root)->doc()->updateStyleSelector();
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:22,代码来源:CSSMutableStyleDeclaration.cpp


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