mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Fix #14497: WeakMediaQueryListVec assumes its contents are still alive
This commit is contained in:
parent
5fca03418f
commit
0d9b4e858c
1 changed files with 2 additions and 2 deletions
|
@ -138,7 +138,7 @@ impl WeakMediaQueryListVec {
|
|||
/// Evaluate media query lists and report changes
|
||||
/// https://drafts.csswg.org/cssom-view/#evaluate-media-queries-and-report-changes
|
||||
pub fn evaluate_and_report_changes(&self) {
|
||||
for mql in self.cell.borrow().iter() {
|
||||
self.cell.borrow_mut().update(|mql| {
|
||||
let mql = mql.root().unwrap();
|
||||
if let MediaQueryListMatchState::Changed(_) = mql.evaluate_changes() {
|
||||
let event = MediaQueryListEvent::new(&mql.global(),
|
||||
|
@ -148,7 +148,7 @@ impl WeakMediaQueryListVec {
|
|||
mql.Matches());
|
||||
event.upcast::<Event>().fire(mql.upcast::<EventTarget>());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue