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

@ -405,6 +405,14 @@ impl<'ld> TDocument for ServoLayoutDocument<'ld> {
let elements = unsafe { self.document.drain_modified_elements() };
elements.into_iter().map(|(el, snapshot)| (ServoLayoutElement::from_layout_js(el), snapshot)).collect()
}
fn needs_paint_from_layout(&self) {
unsafe { self.document.needs_paint_from_layout(); }
}
fn will_paint(&self) {
unsafe { self.document.will_paint(); }
}
}
impl<'ld> ServoLayoutDocument<'ld> {