mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Change window title to reflect document title
This commit is contained in:
parent
554e1ee939
commit
56eedbaebe
2 changed files with 23 additions and 42 deletions
|
@ -70,6 +70,19 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTitleElement> {
|
|||
Some(htmlelement as &VirtualMethods)
|
||||
}
|
||||
|
||||
fn child_inserted(&self, child: JSRef<Node>) {
|
||||
match self.super_type() {
|
||||
Some(ref s) => s.child_inserted(child),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
let node: JSRef<Node> = NodeCast::from_ref(*self);
|
||||
if node.is_in_doc() {
|
||||
let document = node.owner_doc().root();
|
||||
document.r().send_title_to_compositor();
|
||||
}
|
||||
}
|
||||
|
||||
fn bind_to_tree(&self, is_in_doc: bool) {
|
||||
let node: JSRef<Node> = NodeCast::from_ref(*self);
|
||||
if is_in_doc {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue