summaryrefslogtreecommitdiffstats
path: root/layout/base/nsPresContext.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-09-23 23:45:46 +0000
committerMoonchild <moonchild@palemoon.org>2020-09-23 23:45:46 +0000
commit9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f (patch)
tree831e0ae1649d6135429def03688bc93ff7c86b03 /layout/base/nsPresContext.cpp
parent42f895f27f239e973c9c06241f7a58da7381353c (diff)
parentf624bd1375655dea196cdcb70a9860bc5817df49 (diff)
downloadUXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar.gz
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar.lz
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.tar.xz
UXP-9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f.zip
Merge branch 'redwood' into releaseRELBASE_20200929RC_20200924
Diffstat (limited to 'layout/base/nsPresContext.cpp')
-rw-r--r--layout/base/nsPresContext.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp
index befb5deb2..1d90b967a 100644
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1931,33 +1931,13 @@ nsPresContext::MediaFeatureValuesChanged(nsRestyleHint aRestyleHint,
if (!PR_CLIST_IS_EMPTY(mDocument->MediaQueryLists())) {
// We build a list of all the notifications we're going to send
- // before we send any of them. (The spec says the notifications
- // should be a queued task, so any removals that happen during the
- // notifications shouldn't affect what gets notified.) Furthermore,
- // we hold strong pointers to everything we're going to make
- // notification calls to, since each notification involves calling
- // arbitrary script that might otherwise destroy these objects, or,
- // for that matter, |this|.
- //
- // Note that we intentionally send the notifications to media query
- // list in the order they were created and, for each list, to the
- // listeners in the order added.
- nsTArray<MediaQueryList::HandleChangeData> notifyList;
+ // before we send any of them.
for (PRCList *l = PR_LIST_HEAD(mDocument->MediaQueryLists());
l != mDocument->MediaQueryLists(); l = PR_NEXT_LINK(l)) {
+ nsAutoMicroTask mt;
MediaQueryList *mql = static_cast<MediaQueryList*>(l);
- mql->MediumFeaturesChanged(notifyList);
+ mql->MaybeNotify();
}
-
- if (!notifyList.IsEmpty()) {
- for (uint32_t i = 0, i_end = notifyList.Length(); i != i_end; ++i) {
- nsAutoMicroTask mt;
- MediaQueryList::HandleChangeData &d = notifyList[i];
- d.callback->Call(*d.mql);
- }
- }
-
- // NOTE: When |notifyList| goes out of scope, our destructor could run.
}
}