Backed out changeset 06fd7e672abd (bug 1382078)

This commit is contained in:
Sebastian Hengst 2017-09-02 20:43:42 +02:00
Родитель 3764de542b
Коммит 55fe61b6d6
3 изменённых файлов: 11 добавлений и 9 удалений

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

@ -740,22 +740,23 @@ nsBindingManager::WalkAllRules(nsIStyleRuleProcessor::EnumFunc aFunc,
});
}
bool
nsBindingManager::MediumFeaturesChanged(nsPresContext* aPresContext)
nsresult
nsBindingManager::MediumFeaturesChanged(nsPresContext* aPresContext,
bool* aRulesChanged)
{
bool rulesChanged = false;
*aRulesChanged = false;
RefPtr<nsPresContext> presContext = aPresContext;
EnumerateBoundContentBindings([=, &rulesChanged](nsXBLBinding* aBinding) {
EnumerateBoundContentBindings([=](nsXBLBinding* aBinding) {
nsIStyleRuleProcessor* ruleProcessor =
aBinding->PrototypeBinding()->GetRuleProcessor();
if (ruleProcessor) {
bool thisChanged = ruleProcessor->MediumFeaturesChanged(presContext);
rulesChanged = rulesChanged || thisChanged;
*aRulesChanged = *aRulesChanged || thisChanged;
}
});
return rulesChanged;
return NS_OK;
}
void

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

@ -135,7 +135,8 @@ public:
* the characteristics of the medium, and return whether this rule
* processor's rules have changed (e.g., because of media queries).
*/
bool MediumFeaturesChanged(nsPresContext* aPresContext);
nsresult MediumFeaturesChanged(nsPresContext* aPresContext,
bool* aRulesChanged);
void AppendAllSheets(nsTArray<mozilla::StyleSheet*>& aArray);

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

@ -2686,8 +2686,8 @@ nsStyleSet::MediumFeaturesChanged(bool aViewportChanged)
}
if (mBindingManager) {
bool thisChanged =
mBindingManager->MediumFeaturesChanged(presContext);
bool thisChanged = false;
mBindingManager->MediumFeaturesChanged(presContext, &thisChanged);
stylesChanged = stylesChanged || thisChanged;
}