The constellation notifies the script thread about documents becoming inactive, active and fully active.

This commit is contained in:
Alan Jeffrey 2017-01-10 14:35:25 -06:00
parent 556a46f537
commit a43c842099
14 changed files with 162 additions and 98 deletions

View file

@ -1488,21 +1488,17 @@ impl Window {
None
}
pub fn freeze(&self) {
pub fn suspend(&self) {
self.upcast::<GlobalScope>().suspend();
// A hint to the JS runtime that now would be a good time to
// GC any unreachable objects generated by user script,
// or unattached DOM nodes. Attached DOM nodes can't be GCd yet,
// as the document might be thawed later.
// as the document might be reactivated later.
self.Gc();
}
pub fn thaw(&self) {
pub fn resume(&self) {
self.upcast::<GlobalScope>().resume();
// Push the document title to the compositor since we are
// activating this document due to a navigation.
self.Document().title_changed();
}
pub fn need_emit_timeline_marker(&self, timeline_type: TimelineMarkerType) -> bool {