mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
switched window.page from *mut Page to @mut Page
This commit is contained in:
parent
43491d5b23
commit
df5306e358
5 changed files with 17 additions and 26 deletions
|
@ -28,7 +28,7 @@ pub enum TimerControlMsg {
|
|||
//FIXME If we're going to store the script task, find a way to do so safely. Currently it's
|
||||
// only used for querying layout from arbitrary script.
|
||||
pub struct Window {
|
||||
page: *mut Page,
|
||||
page: @mut Page,
|
||||
script_chan: ScriptChan,
|
||||
compositor: @ScriptListener,
|
||||
wrapper: WrapperCache,
|
||||
|
@ -91,15 +91,13 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn content_changed(&self) {
|
||||
unsafe {
|
||||
// TODO(tkuehn): currently reflow top-level, but want to reflow only the associated frame
|
||||
(*self.page).reflow_all(ReflowForScriptQuery, self.script_chan.clone(), self.compositor);
|
||||
}
|
||||
self.page.reflow_all(ReflowForScriptQuery, self.script_chan.clone(), self.compositor);
|
||||
}
|
||||
|
||||
pub fn new(page: *mut Page, script_chan: ScriptChan, compositor: @ScriptListener)
|
||||
pub fn new(page: @mut Page, script_chan: ScriptChan, compositor: @ScriptListener)
|
||||
-> @mut Window {
|
||||
let script_chan_clone = script_chan.clone();
|
||||
let page_id = page.id.clone();
|
||||
let win = @mut Window {
|
||||
page: page,
|
||||
script_chan: script_chan,
|
||||
|
@ -111,7 +109,7 @@ impl Window {
|
|||
loop {
|
||||
match timer_port.recv() {
|
||||
TimerMessage_Close => break,
|
||||
TimerMessage_Fire(td) => unsafe {script_chan_clone.chan.send(FireTimerMsg((*page).id.clone(), td))},
|
||||
TimerMessage_Fire(td) => script_chan_clone.chan.send(FireTimerMsg(page_id.clone(), td)),
|
||||
TimerMessage_TriggerExit => script_chan_clone.chan.send(ExitMsg),
|
||||
}
|
||||
}
|
||||
|
@ -120,11 +118,8 @@ impl Window {
|
|||
},
|
||||
};
|
||||
|
||||
unsafe {
|
||||
// TODO(tkuehn): This just grabs the top-level page. Need to handle subframes.
|
||||
let compartment = (*page).js_info.get_ref().js_compartment;
|
||||
window::create(compartment, win);
|
||||
}
|
||||
let compartment = page.js_info.get_ref().js_compartment;
|
||||
window::create(compartment, win);
|
||||
win
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue