diff --git a/toolkit/content/widgets/progressmeter.xml b/toolkit/content/widgets/progressmeter.xml index 0bb6fac7c6b..4a4b451af0e 100644 --- a/toolkit/content/widgets/progressmeter.xml +++ b/toolkit/content/widgets/progressmeter.xml @@ -74,7 +74,19 @@ var position = isLTR ? 4 : -1; var interval = setInterval(function nextStep() { try { - var width = stack.boxObject.width >> 2; + var width = stack.boxObject.width; + if (!width) { + // Maybe we've been removed from the document. + var currentNode = stack; + while (currentNode && currentNode != stack.ownerDocument) { + currentNode = currentNode.parentNode; + } + if (!currentNode) { + clearInterval(interval); + return; + } + } + width = width >> 2; spacer.height = stack.boxObject.height; spacer.width = width; spacer.left = width * position;