зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1357583: Remove ServoStyleSheet::ClearRuleCascades. r=heycam
These invalidations are already handled from the PresShell notifications, no need to handle it somewhere else. MozReview-Commit-ID: G9KDVvSKMJY
This commit is contained in:
Родитель
6e97f119ed
Коммит
a9f348149b
|
@ -601,8 +601,8 @@ CSSStyleSheet::List(FILE* out, int32_t aIndent) const
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
CSSStyleSheet::ClearRuleCascadesInternal()
|
||||
void
|
||||
CSSStyleSheet::ClearRuleCascades()
|
||||
{
|
||||
// We might be in ClearRuleCascadesInternal because we had a modification
|
||||
// to the sheet that resulted in an nsCSSSelector being destroyed.
|
||||
|
@ -628,6 +628,10 @@ CSSStyleSheet::ClearRuleCascadesInternal()
|
|||
(*iter)->ClearRuleCascades();
|
||||
}
|
||||
}
|
||||
|
||||
if (mParent) {
|
||||
static_cast<CSSStyleSheet*>(mParent)->ClearRuleCascades();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -178,7 +178,7 @@ private:
|
|||
protected:
|
||||
virtual ~CSSStyleSheet();
|
||||
|
||||
void ClearRuleCascadesInternal() override;
|
||||
void ClearRuleCascades();
|
||||
|
||||
// Add the namespace mapping from this @namespace rule to our namespace map
|
||||
nsresult RegisterNamespaceRule(css::Rule* aRule);
|
||||
|
|
|
@ -219,15 +219,6 @@ ServoStyleSheet::Clone(StyleSheet* aCloneParent,
|
|||
return clone.forget();
|
||||
}
|
||||
|
||||
void
|
||||
ServoStyleSheet::ClearRuleCascadesInternal()
|
||||
{
|
||||
for (StyleSetHandle& setHandle : mStyleSets) {
|
||||
setHandle->AsServo()->NoteStyleSheetsChanged();
|
||||
setHandle->AsServo()->UpdateStylistIfNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
CSSRuleList*
|
||||
ServoStyleSheet::GetCssRulesInternal(ErrorResult& aRv)
|
||||
{
|
||||
|
|
|
@ -123,8 +123,6 @@ public:
|
|||
protected:
|
||||
virtual ~ServoStyleSheet();
|
||||
|
||||
void ClearRuleCascadesInternal() override;
|
||||
|
||||
ServoStyleSheetInner* Inner() const
|
||||
{
|
||||
return static_cast<ServoStyleSheetInner*>(mInner);
|
||||
|
|
|
@ -127,15 +127,6 @@ StyleSheet::TraverseInner(nsCycleCollectionTraversalCallback &cb)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
StyleSheet::ClearRuleCascades()
|
||||
{
|
||||
ClearRuleCascadesInternal();
|
||||
if (mParent) {
|
||||
mParent->ClearRuleCascades();
|
||||
}
|
||||
}
|
||||
|
||||
// QueryInterface implementation for StyleSheet
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheet)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
|
@ -448,7 +439,14 @@ StyleSheet::EnsureUniqueInner()
|
|||
mInner = clone;
|
||||
|
||||
// Ensure we're using the new rules.
|
||||
ClearRuleCascades();
|
||||
//
|
||||
// NOTE: In Servo, all kind of changes that change the set of selectors or
|
||||
// rules we match are covered by the PresShell notifications. In Gecko that's
|
||||
// true too, but this is probably needed because selectors are not refcounted
|
||||
// and can become stale.
|
||||
if (CSSStyleSheet* geckoSheet = GetAsGecko()) {
|
||||
geckoSheet->ClearRuleCascades();
|
||||
}
|
||||
|
||||
// let our containing style sets know that if we call
|
||||
// nsPresContext::EnsureSafeToHandOutCSSRules we will need to restyle the
|
||||
|
|
|
@ -288,9 +288,6 @@ protected:
|
|||
// Traverse our inner, if needed, for cycle collection
|
||||
virtual void TraverseInner(nsCycleCollectionTraversalCallback &);
|
||||
|
||||
void ClearRuleCascades();
|
||||
virtual void ClearRuleCascadesInternal() {}
|
||||
|
||||
StyleSheet* mParent; // weak ref
|
||||
|
||||
nsString mTitle;
|
||||
|
|
Загрузка…
Ссылка в новой задаче