Permalink
Browse files

fixed a couple test failures

git-svn-id: http://svn.mochikit.com/mochikit/trunk@736 14cb8549-11fe-0310-83a5-45f3e82da484
  • Loading branch information...
1 parent 582fbb5 commit a8180557d17d97a561466143acdbfc5e83e4d545 Beau Hartshorne committed Apr 25, 2006
Showing with 11 additions and 6 deletions.
  1. +7 −4 MochiKit/DOM.js
  2. +1 −0 MochiKit/Signal.js
  3. +2 −1 packed/MochiKit/MochiKit.js
  4. +1 −1 tests/test_MochiKit-DOM.html
View
11 MochiKit/DOM.js
@@ -272,16 +272,19 @@ MochiKit.Base.update(MochiKit.DOM, {
/*
- Opera & (Safari absolute) incorrectly account for body
- offsetTop and offsetLeft.
+ Opera < 9 and old Safari (absolute) incorrectly account for
+ body offsetTop and offsetLeft.
- */
+ */
var ua = navigator.userAgent.toLowerCase();
- if (ua.indexOf('opera') != -1 ||
+ if ((typeof(opera) != "undefined" &&
+ parseFloat(opera.version()) < 9) ||
(ua.indexOf('safari') != -1 &&
self.computedStyle(elem, 'position') == 'absolute')) {
+
c.x -= b.offsetLeft;
c.y -= b.offsetTop;
+
}
}
View
1 MochiKit/Signal.js
@@ -657,5 +657,6 @@ MochiKit.Signal.__new__(this);
connect = MochiKit.Signal.connect;
disconnect = MochiKit.Signal.disconnect;
disconnectAll = MochiKit.Signal.disconnectAll;
+signal = MochiKit.Signal.signal;
MochiKit.Base._exportSymbols(this, MochiKit.Signal);
View
3 packed/MochiKit/MochiKit.js
@@ -2612,7 +2612,7 @@ _330=_330.offsetParent;
}
}
var ua=navigator.userAgent.toLowerCase();
-if(ua.indexOf("opera")!=-1||(ua.indexOf("safari")!=-1&&self.computedStyle(elem,"position")=="absolute")){
+if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("safari")!=-1&&self.computedStyle(elem,"position")=="absolute")){
c.x-=b.offsetLeft;
c.y-=b.offsetTop;
}
@@ -4376,6 +4376,7 @@ MochiKit.Signal.__new__(this);
connect=MochiKit.Signal.connect;
disconnect=MochiKit.Signal.disconnect;
disconnectAll=MochiKit.Signal.disconnectAll;
+signal=MochiKit.Signal.signal;
MochiKit.Base._exportSymbols(this,MochiKit.Signal);
if(typeof (dojo)!="undefined"){
dojo.provide("MochiKit.Visual");
View
2 tests/test_MochiKit-DOM.html
@@ -7,7 +7,7 @@
<script type="text/javascript" src="SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="SimpleTest/test.css">
</head>
-<body style="margin: 10px; padding: 10px;">
+<body>
<div id="posTest" style="position: absolute; left: 400px; top: 100px; width: 100px; height: 100px; background: red;">&nbsp;</div>

0 comments on commit a818055

Please sign in to comment.