From fd9cd2f1036a580eba85dc65c11125a0bc85fb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 30 Aug 2016 16:37:37 -0700 Subject: 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 --- components/script/layout_wrapper.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'components/script/layout_wrapper.rs') diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 906bde60550..4edd821ad0b 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -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> { -- cgit v1.2.3