Skip to content

Commit

Permalink
Different brokenOffsetParent check.
Browse files Browse the repository at this point in the history
  • Loading branch information
timwienk authored and cpojer committed Oct 27, 2010
1 parent 0b855f1 commit b2c64b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/Element/Element.Dimensions.js
Expand Up @@ -58,9 +58,12 @@ Element.implement({
},

getOffsetParent: (function(){
var rootLastChild = document.documentElement.lastChild;
var brokenOffsetParent = !(('offsetParent' in rootLastChild) && !rootLastChild.offsetParent);
rootLastChild = null;
var element = document.createElement('div'),
child = document.createElement('div');
element.style.height = '0';
element.appendChild(child);
var brokenOffsetParent = (child.offsetParent === element);

This comment has been minimized.

Copy link
@jdalton

jdalton Oct 27, 2010

Is this a failure in a current browser or are yall just being safe?

element = child = null;

var isOffset = function(el){
return styleString(el, 'position') != 'static' || isBody(el);
Expand Down

0 comments on commit b2c64b7

Please sign in to comment.