1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! For handling unmounting HTML elements.
//!
//! When a [ContainerNodeFuture][crate::ContainerNodeFuture] is dropped,
//! it removes its HTML node from the parent HTML node.
//! If we let things happen naturally, the drop glue would then call the drop
//! impl of the descendant futures, causing them to detach their HTML nodes.
//! However, the HTML nodes in these descendants are no longer in the HTML document
//! (because their ancestor has been removed), so we want to just ignore them.
//! The mechanism in this module let futures know whether or not their ancestor
//! have been removed.
use Cell;
thread_local! ;
/// Use for accessing the thread local that determines whether or not DOM
/// futures being dropped should try to detach their nodes from the parent.
/// Rust's drop glue drops struct fields in order of declaration,
/// so as the last field, we put a struct that will unset the thread local
/// when dropped.
;