mirror of
https://github.com/servo/servo.git
synced 2025-06-20 15:18:58 +01:00
Make Window store an @Page instead of a *Page and remove a bunch of unsafe code.
This commit is contained in:
parent
a31d950695
commit
8ae725146c
13 changed files with 52 additions and 69 deletions
|
@ -29,13 +29,13 @@ impl HTMLDocument {
|
|||
parent: Document::new(root, window, HTML)
|
||||
};
|
||||
|
||||
let compartment = unsafe { (*window.get_ref().page).js_info.get_ref().js_compartment };
|
||||
let compartment = window.get_ref().page.js_info.get_ref().js_compartment;
|
||||
AbstractDocument::as_abstract(compartment.cx.ptr, doc)
|
||||
}
|
||||
|
||||
fn get_scope_and_cx(&self) -> (*JSObject, *JSContext) {
|
||||
let win = self.parent.window.get_ref();
|
||||
let cx = unsafe {(*win.page).js_info.get_ref().js_compartment.cx.ptr};
|
||||
let cx = win.page.js_info.get_ref().js_compartment.cx.ptr;
|
||||
let cache = win.get_wrappercache();
|
||||
let scope = cache.get_wrapper();
|
||||
(scope, cx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue