зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1428491: Remove redundant mBindingManager member in ServoStyleSet. r=heycam
MozReview-Commit-ID: KMiivgik0fr
This commit is contained in:
Родитель
ae38d1cb24
Коммит
480dcc7f05
|
@ -959,7 +959,7 @@ PresShell::Init(nsIDocument* aDocument,
|
|||
// calling Init, since various subroutines need to find the style set off
|
||||
// the PresContext during initialization.
|
||||
mStyleSet = aStyleSet;
|
||||
mStyleSet->Init(aPresContext, mDocument->BindingManager());
|
||||
mStyleSet->Init(aPresContext);
|
||||
|
||||
// Notify our prescontext that it now has a compatibility mode. Note that
|
||||
// this MUST happen after we set up our style set but before we create any
|
||||
|
|
|
@ -120,7 +120,7 @@ ServoStyleSet::CreateXBLServoStyleSet(
|
|||
const nsTArray<RefPtr<ServoStyleSheet>>& aNewSheets)
|
||||
{
|
||||
auto set = MakeUnique<ServoStyleSet>(Kind::ForXBL);
|
||||
set->Init(aPresContext, nullptr);
|
||||
set->Init(aPresContext);
|
||||
|
||||
// The XBL style sheets aren't document level sheets, but we need to
|
||||
// decide a particular SheetType to add them to style set. This type
|
||||
|
@ -154,7 +154,7 @@ ServoStyleSet::GetPresContext()
|
|||
}
|
||||
|
||||
void
|
||||
ServoStyleSet::Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager)
|
||||
ServoStyleSet::Init(nsPresContext* aPresContext)
|
||||
{
|
||||
mDocument = aPresContext->Document();
|
||||
MOZ_ASSERT(GetPresContext() == aPresContext);
|
||||
|
@ -162,7 +162,6 @@ ServoStyleSet::Init(nsPresContext* aPresContext, nsBindingManager* aBindingManag
|
|||
mLastPresContextUsesXBLStyleSet = aPresContext;
|
||||
|
||||
mRawSet.reset(Servo_StyleSet_Init(aPresContext));
|
||||
mBindingManager = aBindingManager;
|
||||
|
||||
aPresContext->DeviceContext()->InitFontCache();
|
||||
|
||||
|
@ -832,8 +831,8 @@ ServoStyleSet::StyleSheetAt(SheetType aType, int32_t aIndex) const
|
|||
void
|
||||
ServoStyleSet::AppendAllXBLStyleSheets(nsTArray<StyleSheet*>& aArray) const
|
||||
{
|
||||
if (mBindingManager) {
|
||||
mBindingManager->AppendAllSheets(aArray);
|
||||
if (mDocument) {
|
||||
mDocument->BindingManager()->AppendAllSheets(aArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
CreateXBLServoStyleSet(nsPresContext* aPresContext,
|
||||
const nsTArray<RefPtr<ServoStyleSheet>>& aNewSheets);
|
||||
|
||||
void Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager);
|
||||
void Init(nsPresContext* aPresContext);
|
||||
void BeginShutdown() {}
|
||||
void Shutdown();
|
||||
|
||||
|
@ -649,9 +649,6 @@ private:
|
|||
// Constructed lazily when requested by devtools.
|
||||
UniquePtr<ServoStyleRuleMap> mStyleRuleMap;
|
||||
|
||||
// This can be null if we are used to hold XBL style sheets.
|
||||
RefPtr<nsBindingManager> mBindingManager;
|
||||
|
||||
static ServoStyleSet* sInServoTraversal;
|
||||
};
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
// nsStyleSet or ServoStyleSet. See corresponding comments in
|
||||
// nsStyleSet.h for descriptions of these methods.
|
||||
|
||||
inline void Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager);
|
||||
inline void Init(nsPresContext* aPresContext);
|
||||
inline void BeginShutdown();
|
||||
inline void Shutdown();
|
||||
inline bool GetAuthorStyleDisabled() const;
|
||||
|
|
|
@ -44,10 +44,9 @@ StyleSetHandle::Ptr::Delete()
|
|||
}
|
||||
|
||||
void
|
||||
StyleSetHandle::Ptr::Init(nsPresContext* aPresContext,
|
||||
nsBindingManager* aBindingManager)
|
||||
StyleSetHandle::Ptr::Init(nsPresContext* aPresContext)
|
||||
{
|
||||
FORWARD(Init, (aPresContext, aBindingManager));
|
||||
FORWARD(Init, (aPresContext));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -274,15 +274,15 @@ nsStyleSet::AddSizeOfIncludingThis(nsWindowSizes& aSizes) const
|
|||
}
|
||||
|
||||
void
|
||||
nsStyleSet::Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager)
|
||||
nsStyleSet::Init(nsPresContext* aPresContext)
|
||||
{
|
||||
mFirstLineRule = new nsEmptyStyleRule;
|
||||
mFirstLetterRule = new nsEmptyStyleRule;
|
||||
mPlaceholderRule = new nsEmptyStyleRule;
|
||||
mDisableTextZoomStyleRule = new nsDisableTextZoomStyleRule;
|
||||
mBindingManager = aPresContext->Document()->BindingManager();
|
||||
|
||||
mRuleTree = nsRuleNode::CreateRootNode(aPresContext);
|
||||
mBindingManager = aBindingManager;
|
||||
|
||||
// Make an explicit GatherRuleProcessors call for the levels that
|
||||
// don't have style sheets. The other levels will have their calls
|
||||
|
@ -2702,9 +2702,6 @@ nsStyleSet::EnsureUniqueInnerOnCSSSheets()
|
|||
|
||||
if (mBindingManager) {
|
||||
AutoTArray<StyleSheet*, 32> sheets;
|
||||
// XXXheycam stylo: AppendAllSheets will need to be able to return either
|
||||
// CSSStyleSheets or ServoStyleSheets, on request (and then here requesting
|
||||
// CSSStyleSheets).
|
||||
mBindingManager->AppendAllSheets(sheets);
|
||||
for (StyleSheet* sheet : sheets) {
|
||||
MOZ_ASSERT(sheet->IsGecko(), "stylo: AppendAllSheets shouldn't give us "
|
||||
|
|
|
@ -110,7 +110,7 @@ class nsStyleSet final
|
|||
|
||||
void AddSizeOfIncludingThis(nsWindowSizes& aSizes) const;
|
||||
|
||||
void Init(nsPresContext* aPresContext, nsBindingManager* aBindingManager);
|
||||
void Init(nsPresContext* aPresContext);
|
||||
|
||||
nsRuleNode* GetRuleTree() { return mRuleTree; }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче