mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue