本文整理汇总了C++中StyleBaseImpl::isRule方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleBaseImpl::isRule方法的具体用法?C++ StyleBaseImpl::isRule怎么用?C++ StyleBaseImpl::isRule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleBaseImpl
的用法示例。
在下文中一共展示了StyleBaseImpl::isRule方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteRule
void CSSStyleSheetImpl::deleteRule(unsigned long index, int &exceptioncode)
{
exceptioncode = 0;
if (index + 1 > (unsigned) m_lstChildren->count()) {
exceptioncode = DOMException::INDEX_SIZE_ERR;
return;
}
StyleBaseImpl *b = m_lstChildren->takeAt(index);
if (b->isRule() && static_cast<CSSRuleImpl *>(b)->type() == DOM::CSSRule::NAMESPACE_RULE) {
dirtyNamespaceInfo();
if (static_cast<CSSNamespaceRuleImpl *>(b)->isDefault()) {
recomputeNamespaceInfo(); // default may have changed
}
// ### too late for some rules?
}
// TreeShared requires delete not deref when removed from tree
b->setParent(0);
if (!b->refCount()) {
delete b;
}
if (m_doc) {
m_doc->updateStyleSelector(true /*shallow*/);
}
}
示例2: recomputeNamespaceInfo
void CSSStyleSheetImpl::recomputeNamespaceInfo()
{
assert(!m_namespaces);
m_namespaces = new QList<CSSNamespaceRuleImpl *>;
m_defaultNamespace = NamespaceName::fromId(anyNamespace);
// Compute list of all the @namespace nodes, as well as the default one.
for (int i = 0; i < m_lstChildren->count(); ++i) {
StyleBaseImpl *b = m_lstChildren->at(i);
if (b->isRule() && static_cast<CSSRuleImpl *>(b)->type() == DOM::CSSRule::NAMESPACE_RULE) {
CSSNamespaceRuleImpl *nr = static_cast<CSSNamespaceRuleImpl *>(b);
DOM::DOMString prefix = nr->prefix();
DOM::DOMString uri = nr->namespaceURI();
if (uri.isNull()) {
continue;
}
if (nr->isDefault()) {
m_defaultNamespace = NamespaceName::fromString(uri);
}
m_namespaces->append(nr);
}
}
}
示例3:
CSSRuleList::CSSRuleList(StyleListImpl *lst)
{
impl = new CSSRuleListImpl;
impl->ref();
if (lst)
{
for( unsigned long i = 0; i < lst->length() ; ++i )
{
StyleBaseImpl* style = lst->item( i );
if ( style->isRule() )
impl->insertRule( static_cast<CSSRuleImpl *>(style), impl->length() );
}
}
}