зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1247182 - Add an nsCSSRuleProcessor constructor that takes ownership of the given sheet array. r=birtles
This commit is contained in:
Родитель
ef94ddb6f5
Коммит
c5e251b3b9
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче