mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Send LoadStart event when the actual pipeline is loading
This commit is contained in:
parent
3f999ce785
commit
b5b8d462f2
2 changed files with 6 additions and 20 deletions
|
@ -1317,10 +1317,6 @@ where
|
|||
"no replacement"
|
||||
},
|
||||
);
|
||||
self.handle_load_start_msg(
|
||||
change.top_level_browsing_context_id,
|
||||
change.browsing_context_id,
|
||||
);
|
||||
self.pending_changes.push(change);
|
||||
}
|
||||
|
||||
|
@ -3626,18 +3622,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn handle_load_start_msg(
|
||||
&mut self,
|
||||
top_level_browsing_context_id: TopLevelBrowsingContextId,
|
||||
browsing_context_id: BrowsingContextId,
|
||||
) {
|
||||
if browsing_context_id == top_level_browsing_context_id {
|
||||
// Notify embedder top level document started loading.
|
||||
self.embedder_proxy
|
||||
.send((Some(top_level_browsing_context_id), EmbedderMsg::LoadStart));
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_load_complete_msg(
|
||||
&mut self,
|
||||
top_level_browsing_context_id: TopLevelBrowsingContextId,
|
||||
|
@ -3680,10 +3664,6 @@ where
|
|||
// Notify embedder and compositor top level document finished loading.
|
||||
self.compositor_proxy
|
||||
.send(ToCompositorMsg::LoadComplete(top_level_browsing_context_id));
|
||||
self.embedder_proxy.send((
|
||||
Some(top_level_browsing_context_id),
|
||||
EmbedderMsg::LoadComplete,
|
||||
));
|
||||
}
|
||||
} else {
|
||||
self.handle_subframe_loaded(pipeline_id);
|
||||
|
|
|
@ -997,9 +997,15 @@ impl Document {
|
|||
pub fn set_ready_state(&self, state: DocumentReadyState) {
|
||||
match state {
|
||||
DocumentReadyState::Loading => {
|
||||
if self.window().is_top_level() {
|
||||
self.send_to_embedder(EmbedderMsg::LoadStart);
|
||||
}
|
||||
update_with_current_time_ms(&self.dom_loading);
|
||||
},
|
||||
DocumentReadyState::Complete => {
|
||||
if self.window().is_top_level() {
|
||||
self.send_to_embedder(EmbedderMsg::LoadComplete);
|
||||
}
|
||||
update_with_current_time_ms(&self.dom_complete);
|
||||
},
|
||||
DocumentReadyState::Interactive => update_with_current_time_ms(&self.dom_interactive),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue