本文整理汇总了C++中StyleSheet::GetSheetURI方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleSheet::GetSheetURI方法的具体用法?C++ StyleSheet::GetSheetURI怎么用?C++ StyleSheet::GetSheetURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleSheet
的用法示例。
在下文中一共展示了StyleSheet::GetSheetURI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FlushSkinSheets
nsresult nsXBLPrototypeResources::FlushSkinSheets() {
if (mStyleSheetList.Length() == 0) return NS_OK;
nsCOMPtr<Document> doc = mLoader->mBinding->XBLDocumentInfo()->GetDocument();
// If doc is null, we're in the process of tearing things down, so just
// return without rebuilding anything.
if (!doc) {
return NS_OK;
}
// We have scoped stylesheets. Reload any chrome stylesheets we
// encounter. (If they aren't skin sheets, it doesn't matter, since
// they'll still be in the chrome cache. Skip inline sheets, which
// skin sheets can't be, and which in any case don't have a usable
// URL to reload.)
nsTArray<RefPtr<StyleSheet>> oldSheets;
oldSheets.SwapElements(mStyleSheetList);
mozilla::css::Loader* cssLoader = doc->CSSLoader();
for (size_t i = 0, count = oldSheets.Length(); i < count; ++i) {
StyleSheet* oldSheet = oldSheets[i];
nsIURI* uri = oldSheet->GetSheetURI();
RefPtr<StyleSheet> newSheet;
if (!oldSheet->IsInline() && IsChromeURI(uri)) {
if (NS_FAILED(cssLoader->LoadSheetSync(uri, &newSheet))) continue;
} else {
newSheet = oldSheet;
}
mStyleSheetList.AppendElement(newSheet);
}
// There may be no shell during unlink.
if (auto* shell = doc->GetShell()) {
MOZ_ASSERT(shell->GetPresContext());
ComputeServoStyles(*shell->StyleSet());
}
return NS_OK;
}