Skip to content

Commit

Permalink
Ensure we clean up after ourselves for all width and height compu…
Browse files Browse the repository at this point in the history
…tations in `Element.Layout`. (Sam Stephenson, Andrew Dupont)
  • Loading branch information
savetheclocktower committed May 14, 2010
1 parent 339bc8c commit 6c184a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions 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)
Expand Down
12 changes: 9 additions & 3 deletions src/dom/layout.js
Expand Up @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit 6c184a0

Please sign in to comment.