本文整理汇总了C++中StyleBase::isMutableStyleDeclaration方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleBase::isMutableStyleDeclaration方法的具体用法?C++ StyleBase::isMutableStyleDeclaration怎么用?C++ StyleBase::isMutableStyleDeclaration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleBase
的用法示例。
在下文中一共展示了StyleBase::isMutableStyleDeclaration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: getParsedVariableDeclarationBlock
CSSMutableStyleDeclaration* CSSVariablesDeclaration::getParsedVariableDeclarationBlock(const String& variableName)
{
StyleBase* result = m_variablesMap.get(variableName).get();
if (result->isMutableStyleDeclaration())
return static_cast<CSSMutableStyleDeclaration*>(result);
return 0;
}
示例3: 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;
}