Bug 761884 - LayoutView is causing an infinite loop by making changes within a MozAfterPaint handler. r=dcamp

This commit is contained in:
Paul Rouget 2012-06-20 16:22:02 +02:00
parent 206ad00f97
commit 538f068655

View File

@ -294,7 +294,12 @@ LayoutView.prototype = {
let clientRect = node.getBoundingClientRect();
let width = Math.round(clientRect.width);
let height = Math.round(clientRect.height);
this.doc.querySelector("#element-size").textContent = width + "x" + height;
let elt = this.doc.querySelector("#element-size");
let newLabel = width + "x" + height;
if (elt.textContent != newLabel) {
elt.textContent = newLabel;
}
// If the view is closed, no need to do anything more.
if (!this.isOpen) return;