From a9019da39d5a47e62f51aa3ab568389daccbe9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Wed, 6 Mar 2019 16:05:59 +0100 Subject: Move mutation observers list to NodeRareData --- components/script/dom/node.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'components/script/dom/node.rs') diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index f8b6de5cb24..f93679a3976 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -5,7 +5,6 @@ //! The core DOM types. Defines the basic DOM hierarchy as well as all the HTML elements. use crate::document_loader::DocumentLoader; -use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use crate::dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; @@ -152,9 +151,6 @@ pub struct Node { /// node is finalized. style_and_layout_data: Cell>, - /// Registered observers for this node. - mutation_observers: DomRefCell>, - unique_id: UniqueId, } @@ -454,12 +450,13 @@ impl Node { /// Return all registered mutation observers for this node. pub fn registered_mutation_observers(&self) -> RefMut> { - self.mutation_observers.borrow_mut() + self.rare_data.mutation_observers.borrow_mut() } /// Removes the mutation observer for a given node. pub fn remove_mutation_observer(&self, observer: &MutationObserver) { - self.mutation_observers + self.rare_data + .mutation_observers .borrow_mut() .retain(|reg_obs| &*reg_obs.observer != observer) } @@ -1652,8 +1649,6 @@ impl Node { style_and_layout_data: Cell::new(None), - mutation_observers: Default::default(), - unique_id: UniqueId::new(), } } -- cgit v1.2.3