Skip to content

Commit

Permalink
Send LoadStart event when the actual pipeline is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrouget committed Jun 22, 2020
1 parent 3f999ce commit b5b8d46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
20 changes: 0 additions & 20 deletions components/constellation/constellation.rs
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions components/script/dom/document.rs
Expand Up @@ -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),
Expand Down

0 comments on commit b5b8d46

Please sign in to comment.