Issue #2488 - Part 6: Define and declare CSSStyleSheet cast functions directly in StyleSheet

This renames AsGecko calls to AsConcrete and removes the header containing leftover Stylo macros.
This commit is contained in:
FranklinDM 2024-03-29 16:30:12 +08:00 committed by roytam1
commit f0116f51db
18 changed files with 109 additions and 134 deletions

View file

@ -177,7 +177,7 @@ nsStyleSheetService::LoadAndRegisterSheet(nsIURI *aSheetURI,
// mSheets[aSheetType]
StyleSheet* sheet = mSheets[aSheetType].LastElement();
CSSStyleSheet* cssSheet = sheet->AsGecko();
CSSStyleSheet* cssSheet = sheet->AsConcrete();
serv->NotifyObservers(NS_ISUPPORTS_CAST(nsIDOMCSSStyleSheet*, cssSheet),
message, nullptr);
}
@ -283,7 +283,7 @@ nsStyleSheetService::PreloadSheet(nsIURI *aSheetURI, uint32_t aSheetType,
nsresult rv = loader->LoadSheetSync(aSheetURI, parsingMode, true, &sheet);
NS_ENSURE_SUCCESS(rv, rv);
RefPtr<CSSStyleSheet> cssSheet = sheet->AsGecko();
RefPtr<CSSStyleSheet> cssSheet = sheet->AsConcrete();
cssSheet.forget(aSheet);
return NS_OK;
@ -317,7 +317,7 @@ nsStyleSheetService::UnregisterSheet(nsIURI *aSheetURI, uint32_t aSheetType)
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
if (serv) {
CSSStyleSheet* cssSheet = sheet->AsGecko();
CSSStyleSheet* cssSheet = sheet->AsConcrete();
serv->NotifyObservers(NS_ISUPPORTS_CAST(nsIDOMCSSStyleSheet*, cssSheet),
message, nullptr);
}