Bug 1247182 - Add an nsCSSRuleProcessor constructor that takes ownership of the given sheet array. r=birtles

This commit is contained in:
Cameron McCormack 2016-04-14 16:02:44 +10:00
Родитель ef94ddb6f5
Коммит c5e251b3b9
4 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -154,7 +154,7 @@ nsXBLPrototypeResources::GatherRuleProcessor()
"backends");
sheets.AppendElement(sheet->AsGecko());
}
mRuleProcessor = new nsCSSRuleProcessor(sheets,
mRuleProcessor = new nsCSSRuleProcessor(Move(sheets),
SheetType::Doc,
nullptr,
mRuleProcessor);

Просмотреть файл

@ -984,6 +984,17 @@ nsCSSRuleProcessor::nsCSSRuleProcessor(const sheet_array_type& aSheets,
nsCSSRuleProcessor*
aPreviousCSSRuleProcessor,
bool aIsShared)
: nsCSSRuleProcessor(sheet_array_type(aSheets), aSheetType, aScopeElement,
aPreviousCSSRuleProcessor, aIsShared)
{
}
nsCSSRuleProcessor::nsCSSRuleProcessor(sheet_array_type&& aSheets,
SheetType aSheetType,
Element* aScopeElement,
nsCSSRuleProcessor*
aPreviousCSSRuleProcessor,
bool aIsShared)
: mSheets(aSheets)
, mRuleCascades(nullptr)
, mPreviousCacheKey(aPreviousCSSRuleProcessor

Просмотреть файл

@ -69,6 +69,11 @@ public:
mozilla::dom::Element* aScopeElement,
nsCSSRuleProcessor* aPreviousCSSRuleProcessor,
bool aIsShared = false);
nsCSSRuleProcessor(sheet_array_type&& aSheets,
mozilla::SheetType aSheetType,
mozilla::dom::Element* aScopeElement,
nsCSSRuleProcessor* aPreviousCSSRuleProcessor,
bool aIsShared = false);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsCSSRuleProcessor)

Просмотреть файл

@ -510,7 +510,7 @@ nsStyleSet::GatherRuleProcessors(SheetType aType)
sheetsForScope.AppendElements(sheets.Elements() + start, end - start);
nsCSSRuleProcessor* oldRP = oldScopedRuleProcessorHash.Get(scope);
mScopedDocSheetRuleProcessors.AppendElement
(new nsCSSRuleProcessor(sheetsForScope, aType, scope, oldRP));
(new nsCSSRuleProcessor(Move(sheetsForScope), aType, scope, oldRP));
start = end;
} while (start < count);