Ticket #6921: abs_wip.3.patch
| File abs_wip.3.patch, 1.7 kB (added by haysmark, 6 months ago) |
|---|
-
_base/html.js
978 978 endNode = db.parentNode; 979 979 } 980 980 // Opera seems to be double counting for some elements 981 ret.x -= _sumAncestorProperties(node, "scrollLeft"); 982 ret.y -= _sumAncestorProperties(node, "scrollTop"); 981 var cs=gcs(node); 982 var n=node; 983 if(d.isOpera&&cs.position!="absolute"){ 984 n=n.offsetParent; 985 } 986 ret.x -= _sumAncestorProperties(n, "scrollLeft"); 987 ret.y -= _sumAncestorProperties(n, "scrollTop"); 983 988 984 989 var curnode = node; 985 990 do{ … … 992 997 } 993 998 var t = curnode.offsetTop; 994 999 ret.y += isNaN(t) ? 0 : t; 1000 var cs = gcs(curnode); 995 1001 if(curnode != node){ 996 var cs = gcs(curnode);997 1002 if(d.isSafari){ 998 1003 ret.x += px(curnode, cs.borderLeftWidth); 999 1004 ret.y += px(curnode, cs.borderTopWidth); … … 1004 1009 ret.y += 2*px(curnode,cs.borderTopWidth); 1005 1010 } 1006 1011 } 1007 // FIXME:static children in a static div in FF2 are affected by the div's border as well1012 // static children in a static div in FF2 are affected by the div's border as well 1008 1013 // but offsetParent will skip this div! 1014 if(d.isFF&&cs.position=="static"){ 1015 var parent=curnode.parentNode; 1016 while(parent!=curnode.offsetParent){ 1017 var pcs=gcs(parent); 1018 if(pcs.position=="static"){ 1019 ret.x += px(curnode,pcs.borderLeftWidth); 1020 ret.y += px(curnode,pcs.borderTopWidth); 1021 } 1022 parent=parent.parentNode; 1023 } 1024 } 1009 1025 curnode = curnode.offsetParent; 1010 1026 }while((curnode != endNode) && curnode); 1011 1027 }else if(node.x && node.y){