Bug 1382078 Part 2 - Make nsBindingManager::MediumFeaturesChanged() return bool directly. r=emilio

The method always returns NS_OK, and no other caller checks the nsresult.
Hence the patch.

MozReview-Commit-ID: CnYCZ8VchG

--HG--
extra : rebase_source : 8626332e2774c1d6f42c7afa5e9679091a3aeaa2
This commit is contained in:
Ting-Yu Lin 2017-08-30 15:22:31 +08:00
parent f62ed82f17
commit a61a1227e9
3 changed files with 9 additions and 11 deletions

View File

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

View File

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

View File

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