本文整理汇总了C++中DocLoader::requestCSSStyleSheet方法的典型用法代码示例。如果您正苦于以下问题:C++ DocLoader::requestCSSStyleSheet方法的具体用法?C++ DocLoader::requestCSSStyleSheet怎么用?C++ DocLoader::requestCSSStyleSheet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocLoader
的用法示例。
在下文中一共展示了DocLoader::requestCSSStyleSheet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertedIntoParent
void CSSImportRule::insertedIntoParent()
{
CSSStyleSheet* parentSheet = parentStyleSheet();
if (!parentSheet)
return;
DocLoader* docLoader = parentSheet->doc()->docLoader();
if (!docLoader)
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;
}
if (parentSheet->isUserStyleSheet())
m_cachedSheet = docLoader->requestUserCSSStyleSheet(absHref, parentSheet->charset());
else
m_cachedSheet = docLoader->requestCSSStyleSheet(absHref, 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->doc()->addPendingSheet();
m_loading = true;
m_cachedSheet->addClient(this);
}
}