fix borrow check failures by reverting to storing *mut Page in window

This commit is contained in:
Tim Kuehn 2013-07-29 20:22:01 -07:00
parent 2b94dd6664
commit 2e6ad0a4a3
8 changed files with 46 additions and 63 deletions

View file

@ -88,7 +88,7 @@ impl Document {
parent: Element::new(HTMLHtmlElementTypeId, ~"html")
};
let cx = _owner.page.js_info.get_ref().js_compartment.cx.ptr;
let cx = unsafe {(*_owner.page).js_info.get_ref().js_compartment.cx.ptr};
let root = unsafe { Node::as_abstract_node(cx, root) };
Document(root, None)
}
@ -130,7 +130,7 @@ impl Document {
}
};
let win = self.window.get_ref();
let cx = win.page.js_info.get_ref().js_compartment.cx.ptr;
let cx = unsafe {(*win.page).js_info.get_ref().js_compartment.cx.ptr};
let cache = win.get_wrappercache();
let scope = cache.get_wrapper();
HTMLCollection::new(elements, cx, scope)
@ -138,7 +138,7 @@ impl Document {
pub fn GetElementsByTagNameNS(&self, _ns: DOMString, _tag: DOMString) -> @mut HTMLCollection {
let win = self.window.get_ref();
let cx = win.page.js_info.get_ref().js_compartment.cx.ptr;
let cx = unsafe {(*win.page).js_info.get_ref().js_compartment.cx.ptr};
let cache = win.get_wrappercache();
let scope = cache.get_wrapper();
HTMLCollection::new(~[], cx, scope)
@ -146,7 +146,7 @@ impl Document {
pub fn GetElementsByClassName(&self, _class: DOMString) -> @mut HTMLCollection {
let win = self.window.get_ref();
let cx = win.page.js_info.get_ref().js_compartment.cx.ptr;
let cx = unsafe {(*win.page).js_info.get_ref().js_compartment.cx.ptr};
let cache = win.get_wrappercache();
let scope = cache.get_wrapper();
HTMLCollection::new(~[], cx, scope)
@ -289,7 +289,7 @@ impl Document {
}
};
let win = self.window.get_ref();
let cx = win.page.js_info.get_ref().js_compartment.cx.ptr;
let cx = unsafe {(*win.page).js_info.get_ref().js_compartment.cx.ptr};
let cache = win.get_wrappercache();
let scope = cache.get_wrapper();
HTMLCollection::new(elements, cx, scope)