diff --git a/CHANGELOG b/CHANGELOG index 7803fd3b0..8f9051737 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Ensure we clean up after ourselves for all `width` and `height` computations in `Element.Layout`. (Sam Stephenson, Andrew Dupont) + *1.7_rc2* (May 12, 2010) * Remove redefinition of `Element#cumulativeOffset` when `getBoundingClientRect` is present, as it seems to give inaccurate results. (Andrew Dupont) diff --git a/src/dom/layout.js b/src/dom/layout.js index 317295e63..c7bdc697f 100644 --- a/src/dom/layout.js +++ b/src/dom/layout.js @@ -439,8 +439,11 @@ 'height': function(element) { if (!this._preComputing) this._begin(); - var bHeight = this.get('border-box-height'); - if (bHeight <= 0) return 0; + var bHeight = this.get('border-box-height'); + if (bHeight <= 0) { + if (!this._preComputing) this._end(); + return 0; + } var bTop = this.get('border-top'), bBottom = this.get('border-bottom'); @@ -457,7 +460,10 @@ if (!this._preComputing) this._begin(); var bWidth = this.get('border-box-width'); - if (bWidth <= 0) return 0; + if (bWidth <= 0) { + if (!this._preComputing) this._end(); + return 0; + } var bLeft = this.get('border-left'), bRight = this.get('border-right');