本文整理汇总了C++中StyleBase::isRule方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleBase::isRule方法的具体用法?C++ StyleBase::isRule怎么用?C++ StyleBase::isRule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleBase
的用法示例。
在下文中一共展示了StyleBase::isRule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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));
}
}
}
示例3: 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;
}
示例4: addSubresourceStyleURLs
void CSSStyleSheet::addSubresourceStyleURLs(ListHashSet<KURL>& urls)
{
Deque<CSSStyleSheet*> styleSheetQueue;
styleSheetQueue.append(this);
while (!styleSheetQueue.isEmpty()) {
CSSStyleSheet* styleSheet = styleSheetQueue.takeFirst();
for (unsigned i = 0; i < styleSheet->length(); ++i) {
StyleBase* styleBase = styleSheet->item(i);
if (!styleBase->isRule())
continue;
CSSRule* rule = static_cast<CSSRule*>(styleBase);
if (rule->isImportRule()) {
if (CSSStyleSheet* ruleStyleSheet = static_cast<CSSImportRule*>(rule)->styleSheet())
styleSheetQueue.append(ruleStyleSheet);
}
rule->addSubresourceStyleURLs(urls);
}
}
}