diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-04-10 17:11:08 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2014-05-03 14:18:30 -0400 |
commit | dfdda0098a3f169a37c100b36d4dd36ec1d815aa (patch) | |
tree | b4835f3c863c6e45849cf036faf5611925e10189 /src/components/script/script_task.rs | |
parent | d7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1 (diff) | |
download | servo-dfdda0098a3f169a37c100b36d4dd36ec1d815aa.tar.gz servo-dfdda0098a3f169a37c100b36d4dd36ec1d815aa.zip |
Remove JS::get/get_mut to enforce sound rooting practices.
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r-- | src/components/script/script_task.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index f29a18b850a..36fc83b1aee 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -277,7 +277,7 @@ impl Page { let roots = RootCollection::new(); let root = match *self.frame() { None => return, - Some(ref frame) => frame.document.get().GetDocumentElement() + Some(ref frame) => frame.document.root(&roots).GetDocumentElement() }; match root.root(&roots) { None => {}, @@ -359,7 +359,7 @@ impl Page { let root = match *self.frame() { None => return, Some(ref frame) => { - frame.document.get().GetDocumentElement() + frame.document.root(&roots).GetDocumentElement() } }; @@ -444,7 +444,7 @@ impl Page { pub fn hit_test(&self, point: &Point2D<f32>) -> Option<UntrustedNodeAddress> { let roots = RootCollection::new(); let frame = self.frame(); - let document = frame.get_ref().document.clone(); + let document = frame.get_ref().document.root(&roots); let root = document.get().GetDocumentElement().root(&roots); if root.is_none() { return None; @@ -467,7 +467,7 @@ impl Page { pub fn get_nodes_under_mouse(&self, point: &Point2D<f32>) -> Option<Vec<UntrustedNodeAddress>> { let roots = RootCollection::new(); let frame = self.frame(); - let document = frame.get_ref().document.clone(); + let document = frame.get_ref().document.root(&roots); let root = document.get().GetDocumentElement().root(&roots); if root.is_none() { return None; @@ -737,11 +737,13 @@ impl ScriptTask { /// Handles a timer that fired. fn handle_fire_timer_msg(&self, id: PipelineId, timer_id: TimerId) { + let roots = RootCollection::new(); + let mut page_tree = self.page_tree.borrow_mut(); let page = page_tree.find(id).expect("ScriptTask: received fire timer msg for a pipeline ID not associated with this script task. This is a bug.").page(); let frame = page.frame(); - let mut window = frame.get_ref().window.clone(); + let mut window = frame.get_ref().window.root(&roots); let is_interval; match window.get().active_timers.find(&timer_id) { |