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


C++ StyleBase类代码示例

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


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

示例1: getParsedVariable

CSSValueList* CSSVariablesDeclaration::getParsedVariable(const String& variableName)
{
    StyleBase* result = m_variablesMap.get(variableName).get();
    if (result->isValueList())
        return static_cast<CSSValueList*>(result);
    return 0;
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:7,代码来源:CSSVariablesDeclaration.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: 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

示例4: 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

示例5: getVariableValue

String CSSVariablesDeclaration::getVariableValue(const String& variableName)
{
    StyleBase* val = m_variablesMap.get(variableName).get();
    if (val)
        return val->cssText();
    return "";
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:7,代码来源:CSSVariablesDeclaration.cpp

示例6: getParsedVariableDeclarationBlock

CSSMutableStyleDeclaration* CSSVariablesDeclaration::getParsedVariableDeclarationBlock(const String& variableName)
{
    StyleBase* result = m_variablesMap.get(variableName).get();
    if (result->isMutableStyleDeclaration())
        return static_cast<CSSMutableStyleDeclaration*>(result);
    return 0;
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:7,代码来源:CSSVariablesDeclaration.cpp

示例7: serializeCSSStyleSheet

void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const KURL& url)
{
    StringBuilder cssText;
    for (unsigned i = 0; i < styleSheet->length(); ++i) {
        StyleBase* item = styleSheet->item(i);
        String itemText = item->cssText();
        if (!itemText.isEmpty()) {
            cssText.append(itemText);
            if (i < styleSheet->length() - 1)
                cssText.append("\n\n");
        }
        // Some rules have resources associated with them that we need to retrieve.
        if (item->isImportRule()) {
            CSSImportRule* importRule = static_cast<CSSImportRule*>(item);
            KURL importURL = styleSheet->document()->completeURL(importRule->href());
            if (m_resourceURLs.contains(importURL))
                continue;
            serializeCSSStyleSheet(importRule->styleSheet(), importURL);
        } else if (item->isFontFaceRule()) {
            // FIXME: Add support for font face rule. It is not clear to me at this point if the actual otf/eot file can
            // be retrieved from the CSSFontFaceRule object.
        } else if (item->isStyleRule())
            retrieveResourcesForCSSRule(static_cast<CSSStyleRule*>(item));
    }

    if (url.isValid() && !m_resourceURLs.contains(url)) {
        // FIXME: We should check whether a charset has been specified and if none was found add one.
        TextEncoding textEncoding(styleSheet->charset());
        ASSERT(textEncoding.isValid());
        String textString = cssText.toString();
        CString text = textEncoding.encode(textString.characters(), textString.length(), EntitiesForUnencodables);
        m_resources->append(Resource(url, String("text/css"), SharedBuffer::create(text.data(), text.length())));
        m_resourceURLs.add(url);
    }
}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:35,代码来源:PageSerializer.cpp

示例8: while

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

示例9: while

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

示例10: length

bool CSSStyleSheet::isLoading()
{
    unsigned len = length();
    for (unsigned i = 0; i < len; ++i) {
        StyleBase* rule = item(i);
        if (rule->isImportRule() && static_cast<CSSImportRule*>(rule)->isLoading())
            return true;
    }
    return false;
}
开发者ID:13W,项目名称:phantomjs,代码行数:10,代码来源:CSSStyleSheet.cpp

示例11: getParsedVariableDeclarationBlock

CSSMutableStyleDeclaration* CSSVariablesDeclaration::getParsedVariableDeclarationBlock(const String&)
{
// FIXME: Disabling declarations as variable values for now since they no longer have a common base class with CSSValues.
#if 0
    StyleBase* result = m_variablesMap.get(variableName).get();

    if (result->isMutableStyleDeclaration())
        return static_cast<CSSMutableStyleDeclaration*>(result);
#endif
    return 0;
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:11,代码来源:CSSVariablesDeclaration.cpp

示例12: item

CSSRule* CSSRuleList::item(unsigned index)
{
    if (m_list) {
        StyleBase* rule = m_list->item(index);
        ASSERT(!rule || rule->isRule());
        return static_cast<CSSRule*>(rule);
    }

    if (index < m_lstCSSRules.size())
        return m_lstCSSRules[index].get();
    return 0;
}
开发者ID:Fale,项目名称:qtmoko,代码行数:12,代码来源:CSSRuleList.cpp

示例13: length

bool XSLStyleSheet::isLoading()
{
    unsigned len = length();
    for (unsigned i = 0; i < len; ++i) {
        StyleBase* rule = item(i);
        if (rule->isImportRule()) {
            XSLImportRule* import = static_cast<XSLImportRule*>(rule);
            if (import->isLoading())
                return true;
        }
    }
    return false;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:13,代码来源:XSLStyleSheet.cpp

示例14: append

CSSRuleList::CSSRuleList(StyleList* list, bool omitCharsetRules)
{
    m_list = list;
    if (list && omitCharsetRules) {
        m_list = 0;
        unsigned len = list->length();
        for (unsigned i = 0; i < len; ++i) {
            StyleBase* style = list->item(i);
            if (style->isRule() && !style->isCharsetRule())
                append(static_cast<CSSRule*>(style));
        }
    }
}
开发者ID:Fale,项目名称:qtmoko,代码行数:13,代码来源:CSSRuleList.cpp

示例15: while

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


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