Skip to content
Permalink
Browse files
Revert "Revert fb44450 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 012f0c3.
  • Loading branch information
jeresig committed Jan 14, 2011
1 parent f4add19 commit cf7ddcf
Showing 1 changed file with 14 additions and 3 deletions.
@@ -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;

1 comment on commit cf7ddcf

@csnover
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting this without fixing the issue in #7608 just breaks all versions of Opera again. The reason for why curCSS is split up should probably be commented here too in order to avoid forgetting why it exists in the first place. rwldrn had an alternative patch for this, check the closed pull requests. :)

Please sign in to comment.