layout: Keep track of whether we've deferred the painting of the document due to

a script query.

This will, rather unfortunately, mean that we might repaint two times if we've
deferred a paint, then get an out-of-band reflow. Still seemed better than not
suppressing paints at all.

Fixes #13131
This commit is contained in:
Emilio Cobos Álvarez 2016-08-30 16:37:37 -07:00
parent 1fcc447941
commit fd9cd2f103
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 106 additions and 52 deletions

View file

@ -1200,9 +1200,11 @@ impl Window {
if !for_display || self.Document().needs_reflow() {
issued_reflow = self.force_reflow(goal, query_type, reason);
// If window_size is `None`, we don't reflow, so the document stays dirty.
// Otherwise, we shouldn't need a reflow immediately after a reflow.
// If window_size is `None`, we don't reflow, so the document stays
// dirty. Otherwise, we shouldn't need a reflow immediately after a
// reflow, except if we're waiting for a deferred paint.
assert!(!self.Document().needs_reflow() ||
(!for_display && self.Document().needs_paint()) ||
self.window_size.get().is_none() ||
self.suppress_reflow.get());
} else {