Skip to content
Permalink
Browse files

Revert fb44450 which is no longer necessary with the release of Opera…

… 11. Fixes #7608.
  • Loading branch information...
csnover committed Jan 9, 2011
1 parent fcf6237 commit 012f0c3b4bd3d04c2f3e1ea80fc1230901d607d9
Showing with 3 additions and 14 deletions.
  1. +3 −14 src/css.js
@@ -12,9 +12,6 @@ var ralpha = /alpha\([^)]*\)/i,
cssHeight = [ "Top", "Bottom" ],
curCSS,

getComputedStyle,
currentStyle,

fcamelCase = function( all, letter ) {
return letter.toUpperCase();
};
@@ -172,10 +169,6 @@ 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
@@ -241,7 +234,7 @@ if ( !jQuery.support.opacity ) {
}

if ( document.defaultView && document.defaultView.getComputedStyle ) {
getComputedStyle = function( elem, newName, name ) {
curCSS = function( elem, newName, name ) {
var ret, defaultView, computedStyle;

name = name.replace( rupper, "-$1" ).toLowerCase();
@@ -259,10 +252,8 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {

return ret;
};
}

if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
} else if ( document.documentElement.currentStyle ) {
curCSS = function( elem, name ) {
var left, rsLeft,
ret = elem.currentStyle && elem.currentStyle[ name ],
style = elem.style;
@@ -291,8 +282,6 @@ if ( document.documentElement.currentStyle ) {
};
}

curCSS = getComputedStyle || currentStyle;

function getWH( elem, name, extra ) {
var which = name === "width" ? cssWidth : cssHeight,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;

18 comments on commit 012f0c3

@mathiasbynens

This comment has been minimized.

Copy link
Contributor

mathiasbynens replied Jan 10, 2011

Gotta love auto-updating browsers :) What’s up with this commit though? What exactly do you mean by “no longer necessary with the release of Opera 11”? Older versions never existed?

@jdalton

This comment has been minimized.

Copy link
Member

jdalton replied Jan 10, 2011

Does this mean you only support the newest Opera in jQuery?

@gblazex

This comment has been minimized.

Copy link

gblazex replied Jan 10, 2011

@jdalton When you consider browser support you can take into account the conversion rate between versions. If you look at Russia (the biggest userbase of Opera, ~31% of the country uses it) you can see that such version changes go really fast. [1]

It may seem a bit harsh to treat a decent browser like Opera this way, but I guess jQuery decided so. And it's not necessarily bad.

[1] http://gs.statcounter.com/#browser_version-RU-monthly-200912-201012

@mathiasbynens

This comment has been minimized.

Copy link
Contributor

mathiasbynens replied Jan 10, 2011

@galambalazs: The StatCounter results you’re linking to are flawed. Opera’s David Storey recently tweeted:

There was an issue with StatCounter detection of Opera in Q4. It dropped while our users exploded. It is going back to normal in jan

However, I agree with your point that it may not matter all that much, since Opera has had auto-updating functionality as of version 9.

@gblazex

This comment has been minimized.

Copy link

gblazex replied Jan 10, 2011

@jdalton ...and it's not necessarily bad from the market's perspective.

From another point of view if ( document.defaultView.getComputedStyle ) may be too weak to detect full support, especially if you're aware of caveats (as per Mr Resig's commit @fb44450). Capability AND bug testing is the right way to go in this case. Because there may be no explicit UA sniffing in the code, but to tell you the truth it isn't too far from that.

@gblazex

This comment has been minimized.

Copy link

gblazex replied Jan 10, 2011

@mathiasbynens - I thought I've deleted that comment, because I wanted to add some more content to it. Now, I have to edit it to make more sense :)

As for the flawed results, the main point here is not Opera's overall usage, rather the trend between version changes (e.g.: 10.5 -> 10.6). And it's quite comforting I think (also cannot be too flawed because 10.5 users seem to be converted into 10.6 users as you can see).

@jdalton

This comment has been minimized.

Copy link
Member

jdalton replied Jan 10, 2011

I don't like it. I know @csnover has been asking for reduced browser support in jQuery for a while. http://forum.jquery.com/topic/drop-official-support-for-firefox-2-safari-3-opera-9-chrome-4

@miketaylr

This comment has been minimized.

Copy link

miketaylr replied Jan 10, 2011

I don't like it either. Why only support the current version of Opera? Are there any other browsers that jQuery supports in such a manner?

@gblazex

This comment has been minimized.

Copy link

gblazex replied Jan 10, 2011

@jdalton - I can't comment on that, I haven't reserched those browsers for significance specifically (but note: Firefox has much slower conversion rates).

@miketaylr

This comment has been minimized.

Copy link

miketaylr replied Jan 10, 2011

Has there been any testing to see if this doesn't mess with jQuery mobile? The Presto Core is shared between mobile and desktop...so only supporting the latest version of desktop is going to have some consequences for mobile devices as well (which generally are behind desktop).

@dmethvin

This comment has been minimized.

Copy link
Member

dmethvin replied Jan 10, 2011

Going back to the previous code will break Opera 11, which does not seem like a good idea. Does anyone here have a proposal for a patch that will work better?

@paulirish

This comment has been minimized.

Copy link
Member

paulirish replied Jan 10, 2011

Are there any other browsers that jQuery supports in such a manner?

John said jQuery treats Chrome like this. Always supports stable channel. That said it feels reallly early to drop support for Opera 10.

@jdalton

This comment has been minimized.

Copy link
Member

jdalton replied Jan 10, 2011

@dmerthvin - I believe there were other patches

@mathiasbynens

This comment has been minimized.

Copy link
Contributor

mathiasbynens replied Jan 10, 2011

John said jQuery treats Chrome like this. Always supports stable channel.

IIRC, Opera’s auto-update doesn’t update without user consent (by default). Chrome does it all automatically (provided the user opens and closes the application every now and then). That’s a big difference.

@miketaylr

This comment has been minimized.

Copy link

miketaylr replied Jan 10, 2011

yep. http://help.opera.com/Windows/11.00/en/autoupdate.html
Users can turn it off, or have it configured to do it manually, or tell it to remind them later. Meaning stuff is going to break for them if they don't update within what, 3 weeks since Opera 11 has officially been out?

@miketaylr

This comment has been minimized.

Copy link

miketaylr replied Jan 10, 2011

Is this list authoritative? https://gist.github.com/672714#LID164 If so, it says Chrome-1, not current Chrome.

@miketaylr

This comment has been minimized.

Copy link

miketaylr replied Jan 10, 2011

From #jquery-meeting: "JohnResig: for desktop we should support 11 and 10.6 for now - dropping 10.6 in the next major. For mobile we support Mini and Mobile current"

@mathiasbynens

This comment has been minimized.

Copy link
Contributor

mathiasbynens replied Jan 10, 2011

For the record, during today’s jQuery meeting, it was decided that Opera 11 and 10.6 will still be supported in jQuery 1.5. Support for Opera 10.6 will be dropped in the next major release. For mobile, Opera Mini and the current Opera Mobile version will be supported.

Edit: Whoops, looks like @miketaylr had already said that :) Hadn’t refreshed. For some reason, GitHub won’t let me delete this comment. Move along, nothing to see here.

Please sign in to comment.
You can’t perform that action at this time.