Removed recent cssText addition, doesn't work as expected.
[jquery.git] / jquery / jquery.js
index b7a2799..fafed0e 100644 (file)
@@ -353,10 +353,15 @@ $.apply = function(o,f,a) {
 $.getCSS = function(e,p) {
        // Adapted from Prototype 1.4.0
        if ( p == 'height' || p == 'width' ) {
-               var ph = $.browser == "msie" ? 0 : 
-                       parseInt($.css(e,"paddingTop")) + parseInt($.css(e,"paddingBottom"));
-               var pw = $.browser == "msie" ? 0 : 
-                       parseInt($.css(e,"paddingLeft")) + parseInt($.css(e,"paddingRight"));
+
+               // Handle extra width/height provided by the W3C box model
+               var ph = !$.boxModel ? 0 : 
+                       parseInt($.css(e,"paddingTop")) + parseInt($.css(e,"paddingBottom")) +
+                       parseInt($.css(e,"borderTop")) + parseInt($.css(e,"borderBottom"));
+
+               var pw = !$.boxModel ? 0 : 
+                       parseInt($.css(e,"paddingLeft")) + parseInt($.css(e,"paddingRight")) +
+                       parseInt($.css(e,"borderLeft")) + parseInt($.css(e,"borderRight"));
 
                var oHeight, oWidth;
 
@@ -602,8 +607,7 @@ $.attr = function(o,a,v){
                        'for': 'htmlFor',
                        'text': 'cssText',
                        'class': 'className',
-                       'float': 'cssFloat',
-                       'style': 'cssText'
+                       'float': 'cssFloat'
                };
                a = (fix[a] && fix[a].replace && fix[a]) || a;
                var r = new RegExp("-([a-z])","ig");
@@ -773,7 +777,12 @@ $.event = {};
 // Bind an event to an element
 // Original by Dean Edwards
 $.event.add = function(element, type, handler) {
-       if ( element.location ) { element = window; } // Ughhhhh....
+       // For whatever reason, IE has trouble passing the window object
+       // around, causing it to be cloned in the process
+       if ( $.browser == "msie" && typeof element.setInterval != "undefined" ) {
+               element = window;
+       }
+
        if (!handler.$$guid) { handler.$$guid = $.event.add.guid++; }
        if (!element.events) { element.events = {}; }
        var handlers = element.events[type];