Auto merge of #27562 - jdm:devtools-session-history, r=paulrouget

Notify devtools of session history traversals

This makes the remote devtools and devtools panel in FxR clear the console when going backwards and forwards through session history.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #27525
- [x] These changes do not require tests because no devtools tests.
This commit is contained in:
bors-servo 2020-08-11 01:12:12 -04:00 committed by GitHub
commit 3097eb7de9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 2 deletions

View file

@ -1142,9 +1142,13 @@ impl Document {
pub fn title_changed(&self) {
if self.browsing_context().is_some() {
self.send_title_to_embedder();
let title = String::from(self.Title());
self.window.send_to_constellation(ScriptMsg::TitleChanged(
self.window.pipeline_id(),
title.clone(),
));
let global = self.window.upcast::<GlobalScope>();
if let Some(ref chan) = global.devtools_chan() {
let title = String::from(self.Title());
let _ = chan.send(ScriptToDevtoolsControlMsg::TitleChanged(
global.pipeline_id(),
title,