mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
[35131] Borrow hazard in Document::broadcast_active_resize_observations (#35168)
* removed panic status: added cloned and collect Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> * applied fmt Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> --------- Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
This commit is contained in:
parent
81b09790cd
commit
fe5a075766
2 changed files with 7 additions and 4 deletions
|
@ -3213,12 +3213,14 @@ impl Document {
|
||||||
// Breaking potential re-borrow cycle on `resize_observers`:
|
// Breaking potential re-borrow cycle on `resize_observers`:
|
||||||
// broadcasting resize observations calls into a JS callback,
|
// broadcasting resize observations calls into a JS callback,
|
||||||
// which can add new observers.
|
// which can add new observers.
|
||||||
for observer in self
|
let iterator: Vec<DomRoot<ResizeObserver>> = self
|
||||||
.resize_observers
|
.resize_observers
|
||||||
.borrow()
|
.borrow()
|
||||||
.iter()
|
.iter()
|
||||||
.map(|obs| DomRoot::from_ref(&**obs))
|
.cloned()
|
||||||
{
|
.map(|obs| DomRoot::from_ref(&*obs))
|
||||||
|
.collect();
|
||||||
|
for observer in iterator {
|
||||||
observer.broadcast_active_resize_observations(&mut shallowest, can_gc);
|
observer.broadcast_active_resize_observations(&mut shallowest, can_gc);
|
||||||
}
|
}
|
||||||
shallowest
|
shallowest
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[calculate-depth-for-node.html]
|
[calculate-depth-for-node.html]
|
||||||
expected: CRASH
|
expected: ERROR
|
||||||
|
|
||||||
["Calculate depth for node" algorithm with Shadow DOM]
|
["Calculate depth for node" algorithm with Shadow DOM]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue