mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Checking the browsing_context before change title, and adding wpt test
This commit is contained in:
parent
75ae1c033f
commit
3c56d41699
4 changed files with 46 additions and 3 deletions
|
@ -618,10 +618,12 @@ impl Document {
|
|||
|
||||
/// Handles any updates when the document's title has changed.
|
||||
pub fn title_changed(&self) {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsertitlechange
|
||||
self.trigger_mozbrowser_event(MozBrowserEvent::TitleChange(String::from(self.Title())));
|
||||
if self.browsing_context().is_some() {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsertitlechange
|
||||
self.trigger_mozbrowser_event(MozBrowserEvent::TitleChange(String::from(self.Title())));
|
||||
|
||||
self.send_title_to_compositor();
|
||||
self.send_title_to_compositor();
|
||||
}
|
||||
}
|
||||
|
||||
/// Sends this document's title to the compositor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue