From b22b29533a4bf3452265e90de4c0c0407ab3d989 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 22 Dec 2014 11:34:07 -0800 Subject: [PATCH] gfx: Fix a nasty bug whereby the transient clip was not always removed, causing elements to be randomly clipped out. Improves Wikipedia, Reddit, etc. --- components/gfx/paint_context.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 835870136cb..f93c858d302 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -814,6 +814,12 @@ impl<'a> PaintContext<'a> { pub fn get_or_create_temporary_draw_target(&mut self, opacity: AzFloat) -> DrawTarget { if opacity == 1.0 { + // Reuse the draw target, but remove the transient clip. If we don't do the latter, + // we'll be in a state whereby the paint subcontext thinks it has no transient clip + // (see `StackingContext::optimize_and_draw_into_context`) but it actually does, + // resulting in a situation whereby display items are seemingly randomly clipped out. + self.remove_transient_clip_if_applicable(); + return self.draw_target.clone() }