зеркало из https://github.com/mozilla/pjs.git
Bug 761884 - LayoutView is causing an infinite loop by making changes within a MozAfterPaint handler. r=dcamp
This commit is contained in:
Родитель
7d9ea6d908
Коммит
4debf43d2e
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче