本文整理汇总了C++中StyleSheetContents::finalURL方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleSheetContents::finalURL方法的具体用法?C++ StyleSheetContents::finalURL怎么用?C++ StyleSheetContents::finalURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleSheetContents
的用法示例。
在下文中一共展示了StyleSheetContents::finalURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: requestStyleSheet
void StyleRuleImport::requestStyleSheet()
{
if (!m_parentStyleSheet)
return;
Document* document = m_parentStyleSheet->singleOwnerDocument();
if (!document)
return;
CachedResourceLoader* cachedResourceLoader = document->cachedResourceLoader();
if (!cachedResourceLoader)
return;
String absHref = m_strHref;
if (!m_parentStyleSheet->finalURL().isNull())
// use parent styleheet's URL as the base URL
absHref = KURL(m_parentStyleSheet->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.
StyleSheetContents* rootSheet = m_parentStyleSheet;
for (StyleSheetContents* sheet = m_parentStyleSheet; sheet; sheet = sheet->parentStyleSheet()) {
if (absHref == sheet->finalURL().string() || absHref == sheet->originalURL())
return;
rootSheet = sheet;
}
ResourceRequest request(document->completeURL(absHref));
if (m_parentStyleSheet->isUserStyleSheet())
m_cachedSheet = cachedResourceLoader->requestUserCSSStyleSheet(request, m_parentStyleSheet->charset());
else
m_cachedSheet = cachedResourceLoader->requestCSSStyleSheet(request, m_parentStyleSheet->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 (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() && rootSheet == m_parentStyleSheet)
m_parentStyleSheet->startLoadingDynamicSheet();
m_loading = true;
m_cachedSheet->addClient(&m_styleSheetClient);
}
}