Remove entries for removed iframes

Notify history changed after a navigation

Add history drop test
This commit is contained in:
Connor Brewster 2018-04-06 21:20:14 -05:00
parent ae117be752
commit 787ec4b209
5 changed files with 64 additions and 4 deletions

View file

@ -42,6 +42,15 @@ impl JointSessionHistory {
diff.replace(&old_reloader, &new_reloader);
}
}
pub fn remove_entries_for_browsing_context(&mut self, context_id: BrowsingContextId) {
self.past.retain(|&SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, .. }| {
browsing_context_id != context_id
});
self.future.retain(|&SessionHistoryDiff::BrowsingContextDiff { browsing_context_id, .. }| {
browsing_context_id != context_id
});
}
}
/// Represents a pending change in a session history, that will be applied