Bug 1406108: Make MediaQueryList iteration no longer copy RefPtrs.
MozReview-Commit-ID: 4eDs6viuxvT
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -2121,17 +2121,17 @@ nsPresContext::MediaFeatureValuesChanged
// Copy pointers to all the lists into a new array, in case one of our
// notifications modifies the list.
nsTArray<RefPtr<mozilla::dom::MediaQueryList>> localMediaQueryLists;
for (auto* mql : mDocument->MediaQueryLists()) {
localMediaQueryLists.AppendElement(mql);
}
// Now iterate our local array of the lists.
- for (auto mql : localMediaQueryLists) {
+ for (const auto& mql : localMediaQueryLists) {
nsAutoMicroTask mt;
mql->MaybeNotify();
}
}
}
void
nsPresContext::PostMediaFeatureValuesChangedEvent()