本文整理汇总了C++中StyleSheetContents::hasImportCycle方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleSheetContents::hasImportCycle方法的具体用法?C++ StyleSheetContents::hasImportCycle怎么用?C++ StyleSheetContents::hasImportCycle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleSheetContents
的用法示例。
在下文中一共展示了StyleSheetContents::hasImportCycle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: requestStyleSheet
void StyleRuleImport::requestStyleSheet(CSSStyleSheet* rootSheet, const CSSParserContext& parserContext)
{
ASSERT(!rootSheet->parentStyleSheet());
ASSERT(!m_cachedSheet);
Node* ownerNode = rootSheet->ownerNode();
if (!ownerNode)
return;
Document* document = ownerNode->document();
KURL resolvedURL;
if (!parserContext.baseURL.isNull())
resolvedURL = KURL(parserContext.baseURL, m_strHref);
else
resolvedURL = document->completeURL(m_strHref);
StyleSheetContents* rootSheetContents = rootSheet->contents();
if (rootSheetContents->hasImportCycle(this, resolvedURL, document->baseURL()))
return;
ResourceRequest request(resolvedURL);
CachedResourceLoader* cachedResourceLoader = document->cachedResourceLoader();
if (rootSheetContents->isUserStyleSheet())
m_cachedSheet = cachedResourceLoader->requestUserCSSStyleSheet(request, parserContext.charset);
else
m_cachedSheet = cachedResourceLoader->requestCSSStyleSheet(request, parserContext.charset);
if (!m_cachedSheet)
return;
// 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 (rootSheetContents->loadCompleted())
ownerNode->startLoadingDynamicSheet();
m_loadContext = adoptPtr(new LoadContext(rootSheet, parserContext));
m_cachedSheet->addClient(this);
}