Issue #2488 - Part 3: Remove the StyleSetHandle smart pointer class

This commit is contained in:
FranklinDM 2024-03-29 01:40:22 +08:00 committed by roytam1
commit 4bf43b8fb4
58 changed files with 155 additions and 589 deletions

View file

@ -48,8 +48,7 @@
#include "nsCSSProps.h"
#include "nsCSSValue.h"
#include "nsColor.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsStyleUtil.h"
#include "nsQueryObject.h"
@ -87,7 +86,7 @@ inDOMUtils::GetAllStyleSheets(nsIDOMDocument *aDocument, uint32_t *aLength,
nsIPresShell* presShell = document->GetShell();
if (presShell) {
StyleSetHandle styleSet = presShell->StyleSet();
nsStyleSet* styleSet = presShell->StyleSet();
SheetType sheetType = SheetType::Agent;
for (int32_t i = 0; i < styleSet->SheetCount(sheetType); i++) {
sheets.AppendElement(styleSet->StyleSheetAt(sheetType, i));
@ -97,7 +96,7 @@ inDOMUtils::GetAllStyleSheets(nsIDOMDocument *aDocument, uint32_t *aLength,
sheets.AppendElement(styleSet->StyleSheetAt(sheetType, i));
}
AutoTArray<CSSStyleSheet*, 32> xblSheetArray;
styleSet->AsGecko()->AppendAllXBLStyleSheets(xblSheetArray);
styleSet->AppendAllXBLStyleSheets(xblSheetArray);
// The XBL stylesheet array will quite often be full of duplicates. Cope:
nsTHashtable<nsPtrHashKey<CSSStyleSheet>> sheetSet;