#5145 closed bug (fixed)
jQuery.support.opacity = false in the Chrome browser
Reported by: | piotrl86 | Owned by: | Timmy Willison |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | support | Version: | 1.4a1 |
Keywords: | opacity chrome | Cc: | |
Blocked by: | Blocking: |
Description
I found that jQuery.support.opacity = false in the Chrome browser but I think it should be true because the css property works fine for me. Tested on Linux, browser version: 4.0.203.2.
I checked the source code for jQuery 1.3.2 and I found that in Chrome browser: [some HTML Element].style.opacity = "0,5" but in other browsers like Firefox: [some HTML Element].style.opacity = "0.5"
line 3159 in jquery-1.3.2.js:
opacity: a.style.opacity === "0.5",
but "0.5" is not equal to "0,5"
Cheers, Piotr Labudda
Change History (11)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
I've the same issue with Google Chrome 4.0.213.1 on Linux but not with Chrome 3.0.195.24 on Windows.
comment:3 Changed 14 years ago by
In fact it's not a bug in jQuery, it's a bug in Chrome http://code.google.com/p/chromium/issues/detail?id=22782 that comes from an old bug in Webkit https://bugs.webkit.org/show_bug.cgi?id=18994 It depends on your locale
comment:4 Changed 14 years ago by
It seems that both Chrome and WebKit bugs were fixed recently.
However, we have lots of browsers (everything webkit-based that was released at least since May 2008 till Nov 2009) that experience this issue. I think that it is a good idea to add some kind of workaround for these browsers (see above).
comment:5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Version: | 1.3.2 → 1.4a1 |
comment:6 Changed 13 years ago by
Component: | core → support |
---|
comment:7 Changed 12 years ago by
Milestone: | 1.4 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
comment:8 Changed 12 years ago by
From http://bugs.jquery.com/ticket/10384
I know this is a dublicate of 'Ticket #5145'. I can't reopen it :-(
My phone (a webkit clone) throws an error on FadeIn() and fadeOut(). That's because it returns 'false' for '$.support.opacity'. Then it triggers the IE only 'cssHooks.opacity' and chunks on 'style.removeAttribute'. The real problem is that when setting style.opacity to '.55' and then read it, it says: '0,550000011920929' (note the comma and the rounding error).
Now if I simply add this to my code:
jQuery.support.opacity = true; jQuery.cssHooks.opacity = undefined;
everything is fine, fadeIn() works like show() and fadeOut() works like hide() - a lot better than an error.
So, basically we need to change the test for 'support.opacity', so it includes the above value, but still excludes old IE. Line 1221 currently says:
opacity: /^0.55$/.test( a.style.opacity ),
By removing the '$' sign it should work:
opacity: /^0.55/.test( a.style.opacity ),
comment:9 Changed 12 years ago by
Milestone: | → 1.7 |
---|---|
Priority: | major → high |
Status: | reopened → open |
comment:10 Changed 12 years ago by
Owner: | set to Timmy Willison |
---|---|
Status: | open → assigned |
comment:11 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Leave the opacity test unanchored in case of floating point rounding browser errors; small fix in queue tests. Fixes #5145.
Changeset: a18645c6f8f5d8d84c4d47c7137683ac7b4098cc
Confirm it here, on Linux too. Had to create patched jquery in order to make transparency effects work in Chrome/Chromium. Just changed this line to