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/dom/document.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/dom/document.rs')
-rw-r--r-- | src/components/script/dom/document.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index e2984a1bf82..d0ffb203282 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -660,8 +660,9 @@ impl Document { pub fn Location(&mut self, _abstract_self: &JSRef<Document>) -> Unrooted<Location> { let roots = RootCollection::new(); - let window = self.window.root(&roots); - self.window.get_mut().Location(&*window) + let mut window = self.window.root(&roots); + let window_alias = self.window.root(&roots); + window.get_mut().Location(&*window_alias) } pub fn Children(&self, abstract_self: &JSRef<Document>) -> Unrooted<HTMLCollection> { @@ -695,11 +696,13 @@ impl Document { } pub fn damage_and_reflow(&self, damage: DocumentDamageLevel) { - self.window.get().damage_and_reflow(damage); + let roots = RootCollection::new(); + self.window.root(&roots).damage_and_reflow(damage); } pub fn wait_until_safe_to_modify_dom(&self) { - self.window.get().wait_until_safe_to_modify_dom(); + let roots = RootCollection::new(); + self.window.root(&roots).wait_until_safe_to_modify_dom(); } |