check for a document being "fully-active" before reflows

This commit is contained in:
Gregory Terzian 2018-12-15 15:54:04 +08:00
parent eb82e781a3
commit 7530faa4ea
3 changed files with 9 additions and 2 deletions

View file

@ -1741,7 +1741,11 @@ impl Document {
self.process_deferred_scripts();
},
LoadType::PageSource(_) => {
if self.has_browsing_context {
if self.has_browsing_context && self.is_fully_active() {
// Note: if the document is not fully active, the layout thread will have exited already.
// The underlying problem might actually be that layout exits while it should be kept alive.
// See https://github.com/servo/servo/issues/22507
// Disarm the reflow timer and trigger the initial reflow.
self.reflow_timeout.set(None);
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);