diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-04-30 13:33:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 13:33:23 -0400 |
commit | 847115ba0441b1b1a6ad98562b010f7e33b7b14d (patch) | |
tree | f0c52de1b51d15d1e51a6b5a842c86be664c88eb /components/script/script_thread.rs | |
parent | 76a66ee998ca024ea4bb849d3a2497debce94c25 (diff) | |
parent | e7ef9cfb303598e582f0f589da855bdd33c1dd08 (diff) | |
download | servo-847115ba0441b1b1a6ad98562b010f7e33b7b14d.tar.gz servo-847115ba0441b1b1a6ad98562b010f7e33b7b14d.zip |
Auto merge of #20671 - cbrewster:history_url, r=asajeffrey
Make session history aware of URLs
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20671)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 4e89ba4ceff..6ee0ec46d33 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1169,7 +1169,7 @@ impl ScriptThread { Navigate(id, ..) => Some(id), PostMessage(id, ..) => Some(id), UpdatePipelineId(_, _, id, _) => Some(id), - UpdateHistoryStateId(id, ..) => Some(id), + UpdateHistoryState(id, ..) => Some(id), RemoveHistoryStates(id, ..) => Some(id), FocusIFrame(id, ..) => Some(id), WebDriverScriptCommand(id, ..) => Some(id), @@ -1297,8 +1297,8 @@ impl ScriptThread { browsing_context_id, new_pipeline_id, reason), - ConstellationControlMsg::UpdateHistoryStateId(pipeline_id, history_state_id) => - self.handle_update_history_state_id_msg(pipeline_id, history_state_id), + ConstellationControlMsg::UpdateHistoryState(pipeline_id, history_state_id, url) => + self.handle_update_history_state_msg(pipeline_id, history_state_id, url), ConstellationControlMsg::RemoveHistoryStates(pipeline_id, history_states) => self.handle_remove_history_states(pipeline_id, history_states), ConstellationControlMsg::FocusIFrame(parent_pipeline_id, frame_id) => @@ -1679,10 +1679,14 @@ impl ScriptThread { } } - fn handle_update_history_state_id_msg(&self, pipeline_id: PipelineId, history_state_id: Option<HistoryStateId>) { + fn handle_update_history_state_msg( + &self, pipeline_id: PipelineId, + history_state_id: Option<HistoryStateId>, + url: ServoUrl, + ) { match { self.documents.borrow().find_window(pipeline_id) } { None => return warn!("update history state after pipeline {} closed.", pipeline_id), - Some(window) => window.History().r().activate_state(history_state_id), + Some(window) => window.History().r().activate_state(history_state_id, url), } } |