mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update browsing context title/url when navigating.
This commit is contained in:
parent
b9bf9f873b
commit
3dfec95268
1 changed files with 16 additions and 10 deletions
|
@ -120,8 +120,8 @@ pub struct BrowsingContextActorMsg {
|
||||||
|
|
||||||
pub struct BrowsingContextActor {
|
pub struct BrowsingContextActor {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub title: String,
|
pub title: RefCell<String>,
|
||||||
pub url: String,
|
pub url: RefCell<String>,
|
||||||
pub console: String,
|
pub console: String,
|
||||||
pub emulation: String,
|
pub emulation: String,
|
||||||
pub inspector: String,
|
pub inspector: String,
|
||||||
|
@ -174,7 +174,7 @@ impl Actor for BrowsingContextActor {
|
||||||
javascriptEnabled: true,
|
javascriptEnabled: true,
|
||||||
traits: AttachedTraits {
|
traits: AttachedTraits {
|
||||||
reconfigure: false,
|
reconfigure: false,
|
||||||
frames: false,
|
frames: true,
|
||||||
logInPage: false,
|
logInPage: false,
|
||||||
canRewind: false,
|
canRewind: false,
|
||||||
watchpoints: false,
|
watchpoints: false,
|
||||||
|
@ -207,10 +207,11 @@ impl Actor for BrowsingContextActor {
|
||||||
let msg = ListFramesReply {
|
let msg = ListFramesReply {
|
||||||
from: self.name(),
|
from: self.name(),
|
||||||
frames: vec![FrameMsg {
|
frames: vec![FrameMsg {
|
||||||
id: 0, //FIXME should match outerwindow id
|
//FIXME: shouldn't ignore pipeline namespace field
|
||||||
|
id: self.active_pipeline.get().index.0.get(),
|
||||||
parentID: 0,
|
parentID: 0,
|
||||||
url: self.url.clone(),
|
url: self.url.borrow().clone(),
|
||||||
title: self.title.clone(),
|
title: self.title.borrow().clone(),
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
stream.write_json_packet(&msg);
|
stream.write_json_packet(&msg);
|
||||||
|
@ -268,8 +269,8 @@ impl BrowsingContextActor {
|
||||||
let target = BrowsingContextActor {
|
let target = BrowsingContextActor {
|
||||||
name: name,
|
name: name,
|
||||||
script_chan: script_sender,
|
script_chan: script_sender,
|
||||||
title: String::from(title),
|
title: RefCell::new(String::from(title)),
|
||||||
url: url.into_string(),
|
url: RefCell::new(url.into_string()),
|
||||||
console: console,
|
console: console,
|
||||||
emulation: emulation.name(),
|
emulation: emulation.name(),
|
||||||
inspector: inspector.name(),
|
inspector: inspector.name(),
|
||||||
|
@ -302,8 +303,8 @@ impl BrowsingContextActor {
|
||||||
traits: BrowsingContextTraits {
|
traits: BrowsingContextTraits {
|
||||||
isBrowsingContext: true,
|
isBrowsingContext: true,
|
||||||
},
|
},
|
||||||
title: self.title.clone(),
|
title: self.title.borrow().clone(),
|
||||||
url: self.url.clone(),
|
url: self.url.borrow().clone(),
|
||||||
//FIXME: shouldn't ignore pipeline namespace field
|
//FIXME: shouldn't ignore pipeline namespace field
|
||||||
browsingContextId: self.browsing_context_id.index.0.get(),
|
browsingContextId: self.browsing_context_id.index.0.get(),
|
||||||
//FIXME: shouldn't ignore pipeline namespace field
|
//FIXME: shouldn't ignore pipeline namespace field
|
||||||
|
@ -328,6 +329,11 @@ impl BrowsingContextActor {
|
||||||
if let Some(p) = pipeline {
|
if let Some(p) = pipeline {
|
||||||
self.active_pipeline.set(p);
|
self.active_pipeline.set(p);
|
||||||
}
|
}
|
||||||
|
*self.url.borrow_mut() = url.as_str().to_owned();
|
||||||
|
if let Some(ref t) = title {
|
||||||
|
*self.title.borrow_mut() = t.clone();
|
||||||
|
}
|
||||||
|
|
||||||
let msg = TabNavigated {
|
let msg = TabNavigated {
|
||||||
from: self.name(),
|
from: self.name(),
|
||||||
type_: "tabNavigated".to_owned(),
|
type_: "tabNavigated".to_owned(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue