Implement MutationObserver.disconnect()

This commit is contained in:
Fabrice Desré 2018-05-02 13:30:02 -07:00
parent 2c9ef9e558
commit 5bfa819038
7 changed files with 25 additions and 15 deletions

View file

@ -392,6 +392,13 @@ impl Node {
self.mutation_observers.borrow_mut()
}
/// Removes the mutation observer for a given node.
pub fn remove_mutation_observer(&self, observer: &MutationObserver) {
self.mutation_observers.borrow_mut().retain(|reg_obs| {
&*reg_obs.observer != observer
})
}
/// Dumps the subtree rooted at this node, for debugging.
pub fn dump(&self) {
self.dump_indent(0);