From afb36ec8de4f676bd54d9ed615f814e7e3730887 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 25 Mar 2016 14:54:00 -0700 Subject: [PATCH] Fix forced repaint on image load After #10021, `LayoutThread::repaint` no longer forced a repaint because of the `restyle_damage` check. This patch adds the correct restyle damage and fixes #10163. --- components/layout/layout_thread.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index 646defb49e4..df555b1d485 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -593,6 +593,11 @@ impl LayoutThread { fn repaint<'a, 'b>(&mut self, possibly_locked_rw_data: &mut RwData<'a, 'b>) -> bool { let mut rw_data = possibly_locked_rw_data.lock(); + if let Some(mut root_flow) = self.root_flow.clone() { + let flow = flow::mut_base(flow_ref::deref_mut(&mut root_flow)); + flow.restyle_damage.insert(REPAINT); + } + let reflow_info = Reflow { goal: ReflowGoal::ForDisplay, page_clip_rect: MAX_RECT,