Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History API #11220

Closed
wants to merge 10 commits into from

rebased

added TODO for fully active document
  • Loading branch information
cbrewster committed May 28, 2016
commit 379497a2c58aed019ca56c26adb0007a2b52d1e5
@@ -733,12 +733,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.handle_navigate_msg(pipeline_id, direction);
}
// Handle request for history length
Request::Script(FromScriptMsg::HistoryLength(pipeline_id, sender)) => {
FromScriptMsg::HistoryLength(pipeline_id, sender) => {
debug!("constellation got history length message from script");
self.handle_history_length(pipeline_id, sender);
}
// Handle pushing a history entry due to state change
Request::Script(FromScriptMsg::HistoryStatePushed(pipeline_info, active_index)) => {
FromScriptMsg::HistoryStatePushed(pipeline_info, active_index) => {
debug!("constellation got history state pushed message from script");
self.handle_history_state_pushed(pipeline_info, active_index);
}
@@ -848,7 +848,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
debug!("constellation got Alert message");
self.handle_alert(pipeline_id, message, sender);
}
Request::Script(FromScriptMsg::IsPipelineFullyActive(pipeline_id, sender)) => {
FromScriptMsg::IsPipelineFullyActive(pipeline_id, sender) => {
debug!("constellation got IsPipelineFullyActive message");
self.handle_is_pipeline_fully_active(pipeline_id, sender);
}
@@ -1207,7 +1207,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
}
}

// https://html.spec.whatwg.org/multipage/browsers.html#fully-active
// https://html.spec.whatwg.org/multipage/#fully-active
fn handle_is_pipeline_fully_active(&mut self, pipeline_id: PipelineId, sender: IpcSender<bool>) {
// Iterate through the frame tree and see if this pipeline matches any of the
// active frame pipelines.
@@ -46,6 +46,9 @@ impl History {
self.window.constellation_chan().send(msg).unwrap();
}

// TODO: Move this elsewhere as it seems other things than just `History`
// require this check
// https://html.spec.whatwg.org/multipage/#fully-active
fn is_fully_active(&self) -> ErrorResult {
let (sender, receiver) = ipc::channel::<bool>().expect("Failed to create IPC channel");
let msg = ConstellationMsg::IsPipelineFullyActive(self.window.pipeline(), sender);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.