aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2011-01-14 14:12:29 -0500
committerjeresig <jeresig@gmail.com>2011-01-14 14:12:29 -0500
commitcf7ddcf79a3d4d455711b67b252b19ae343645b1 (patch)
tree10a69f7aabcef9ab1096307e937fa1dd88326825
parentf4add19759678797ed8078a96d0c18b168df8588 (diff)
downloadjquery-cf7ddcf79a3d4d455711b67b252b19ae343645b1.tar.gz
jquery-cf7ddcf79a3d4d455711b67b252b19ae343645b1.zip
Revert "Revert fb4445070cd9e06929c7b6f27c10dbf42d4a3367 which is no longer necessary with the release of Opera 11. Fixes #7608." We will be continuing to support Opera 10.6 in jQuery 1.5.
This reverts commit 012f0c3b4bd3d04c2f3e1ea80fc1230901d607d9.
-rw-r--r--src/css.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/css.js b/src/css.js
index a6e2bb614..8a83c6072 100644
--- a/src/css.js
+++ b/src/css.js
@@ -12,6 +12,9 @@ var ralpha = /alpha\([^)]*\)/i,
cssHeight = [ "Top", "Bottom" ],
curCSS,
+ getComputedStyle,
+ currentStyle,
+
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
};
@@ -169,6 +172,10 @@ jQuery.each(["height", "width"], function( i, name ) {
if ( val <= 0 ) {
val = curCSS( elem, name, name );
+ if ( val === "0px" && currentStyle ) {
+ val = currentStyle( elem, name, name );
+ }
+
if ( val != null ) {
// Should return "auto" instead of 0, use 0 for
// temporary backwards-compat
@@ -234,7 +241,7 @@ if ( !jQuery.support.opacity ) {
}
if ( document.defaultView && document.defaultView.getComputedStyle ) {
- curCSS = function( elem, newName, name ) {
+ getComputedStyle = function( elem, newName, name ) {
var ret, defaultView, computedStyle;
name = name.replace( rupper, "-$1" ).toLowerCase();
@@ -252,8 +259,10 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
return ret;
};
-} else if ( document.documentElement.currentStyle ) {
- curCSS = function( elem, name ) {
+}
+
+if ( document.documentElement.currentStyle ) {
+ currentStyle = function( elem, name ) {
var left, rsLeft,
ret = elem.currentStyle && elem.currentStyle[ name ],
style = elem.style;
@@ -282,6 +291,8 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
};
}
+curCSS = getComputedStyle || currentStyle;
+
function getWH( elem, name, extra ) {
var which = name === "width" ? cssWidth : cssHeight,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;