Make Window store an @Page instead of a *Page and remove a bunch of unsafe code.

This commit is contained in:
Josh Matthews 2013-09-11 23:14:14 -07:00
parent a31d950695
commit 8ae725146c
13 changed files with 52 additions and 69 deletions

View file

@ -56,13 +56,11 @@ impl HTMLImageElement {
Some(doc) => {
match doc.with_base(|doc| doc.window) {
Some(win) => {
unsafe {
let page = win.page;
let (port, chan) = stream();
match (*page).query_layout(ContentBoxQuery(abstract_self, chan), port) {
ContentBoxResponse(rect) => {
to_px(rect.size.width) as u32
}
let page = win.page;
let (port, chan) = stream();
match page.query_layout(ContentBoxQuery(abstract_self, chan), port) {
ContentBoxResponse(rect) => {
to_px(rect.size.width) as u32
}
}
}
@ -91,13 +89,11 @@ impl HTMLImageElement {
Some(doc) => {
match doc.with_base(|doc| doc.window) {
Some(win) => {
unsafe {
let page = win.page;
let (port, chan) = stream();
match (*page).query_layout(ContentBoxQuery(abstract_self, chan), port) {
ContentBoxResponse(rect) => {
to_px(rect.size.height) as u32
}
let page = win.page;
let (port, chan) = stream();
match page.query_layout(ContentBoxQuery(abstract_self, chan), port) {
ContentBoxResponse(rect) => {
to_px(rect.size.height) as u32
}
}
}