mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
script: Fix a few load related bugs.
This is what was making me hit the new test failures. So turns out that when the DOMContentLoaded event is fired we fired no messages to the constellation, but we fired the DOMLoad message from the DocumentProgressHandler, effectively after having dispatched the Load message from script thread. This also fixes the possibility of a subframe navigation not blocking the load event of the parent document, for example.
This commit is contained in:
parent
d81fe27b11
commit
e6958d3947
4 changed files with 22 additions and 14 deletions
|
@ -1441,6 +1441,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
let root = self.root_frame_id.is_none() || self.root_frame_id == Some(frame_id);
|
||||
self.compositor_proxy.send(ToCompositorMsg::LoadComplete(back, forward, root));
|
||||
}
|
||||
self.handle_subframe_loaded(pipeline_id);
|
||||
}
|
||||
|
||||
fn handle_dom_load(&mut self, pipeline_id: PipelineId) {
|
||||
|
@ -1455,8 +1456,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
if webdriver_reset {
|
||||
self.webdriver.load_channel = None;
|
||||
}
|
||||
|
||||
self.handle_subframe_loaded(pipeline_id);
|
||||
}
|
||||
|
||||
fn handle_traverse_history_msg(&mut self,
|
||||
|
@ -2073,7 +2072,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
}
|
||||
|
||||
// If there are pending loads, wait for those to complete.
|
||||
if self.pending_frames.len() > 0 {
|
||||
if !self.pending_frames.is_empty() {
|
||||
return ReadyToSave::PendingFrames;
|
||||
}
|
||||
|
||||
|
@ -2089,7 +2088,10 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
let pipeline_id = frame.current.0;
|
||||
|
||||
let pipeline = match self.pipelines.get(&pipeline_id) {
|
||||
None => { warn!("Pipeline {:?} screenshot while closing.", pipeline_id); continue; },
|
||||
None => {
|
||||
warn!("Pipeline {:?} screenshot while closing.", pipeline_id);
|
||||
continue;
|
||||
},
|
||||
Some(pipeline) => pipeline,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue