From 1dcfeefd69d00a3f2bb3a052076bfc906ac3251e Mon Sep 17 00:00:00 2001 From: Ben Turner Date: Mon, 16 Aug 2010 17:06:29 -0700 Subject: [PATCH] Bug 587876 - 'Undetermined progress bars should use mozRequestAnimationFrame'. r=roc --- toolkit/content/widgets/progressmeter.xml | 49 +++++++++++++---------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/toolkit/content/widgets/progressmeter.xml b/toolkit/content/widgets/progressmeter.xml index e27d0375ce5..fe4e3720a98 100644 --- a/toolkit/content/widgets/progressmeter.xml +++ b/toolkit/content/widgets/progressmeter.xml @@ -72,41 +72,48 @@ true > 2; spacer.height = stack.boxObject.height; spacer.width = width; spacer.left = width * position; - if (isLTR) { - position += 15 / (width + 150); - if (position >= 4) - position = -1; - } - else { - position -= 15 / (width + 150); - if (position < 0) - position = 4; - } + + mozRequestAnimationFrame(); } catch (e) { - clearInterval(interval); + window.removeEventListener("MozBeforePaint", nextStep, false); } - }, 20); + } + window.addEventListener("MozBeforePaint", nextStep, false); + mozRequestAnimationFrame(); ]]>