From 55fe61b6d6a3b96f35689ed52fc58c1173a36031 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Sat, 2 Sep 2017 20:43:42 +0200 Subject: [PATCH] Backed out changeset 06fd7e672abd (bug 1382078) --- dom/xbl/nsBindingManager.cpp | 13 +++++++------ dom/xbl/nsBindingManager.h | 3 ++- layout/style/nsStyleSet.cpp | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dom/xbl/nsBindingManager.cpp b/dom/xbl/nsBindingManager.cpp index 39d631d78560..faed4edb85b7 100644 --- a/dom/xbl/nsBindingManager.cpp +++ b/dom/xbl/nsBindingManager.cpp @@ -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 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 diff --git a/dom/xbl/nsBindingManager.h b/dom/xbl/nsBindingManager.h index cde7889e4454..b5d9b207c870 100644 --- a/dom/xbl/nsBindingManager.h +++ b/dom/xbl/nsBindingManager.h @@ -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& aArray); diff --git a/layout/style/nsStyleSet.cpp b/layout/style/nsStyleSet.cpp index 01d5fae91a8b..901a8d941b39 100644 --- a/layout/style/nsStyleSet.cpp +++ b/layout/style/nsStyleSet.cpp @@ -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; }