Skip to main content

Bug Tracker

Side navigation

#7286 closed bug (wontfix)

Opened October 22, 2010 12:26PM UTC

Closed April 17, 2011 06:11PM UTC

.css(propertyName) returns values with floating comma instead of a dot for some properties in Chrome 7

Reported by: Owned by:
Priority: undecided Milestone:
Component: css Version: 1.4.3
Keywords: needsreview Cc:
Blocked by: Blocking:

When you hover the box, in Chrome 7 (Polish) it first disappears (changing its opacity to 0), then it fades to 1.

The problem is with .css("opacity"), which returns value 0,5 (parseFloat("0,5") === 0) instead of 0.5 (parseFloat("0.5" === 0.5).

Issue probably appears for other properties as well, it may not affect other functions as opacity affects fadeIn and fadeOut. It may also be a locale issue, as comma is a decimal separation character in Polish.

I believe jQuery's $.css() should be cross-browser, or shouldn't it?

Attachments (0)
Change History (6)

Changed October 22, 2010 01:15PM UTC by mhaligowski comment:1

Seems to be only Chrome for Linux issue:

I'm writing a fix for jQuery, though.

Changed October 22, 2010 05:47PM UTC by rwaldron comment:2

component: unfiledcss

Changed October 22, 2010 07:21PM UTC by snover comment:3

keywords: → needsreview

This issue has been resolved upstream at Given the very low impact (one report after a year?), I am not sure it’s worth adding a patch to jQuery to address it.

Changed October 24, 2010 10:26AM UTC by mhaligowski comment:4


>>> var elem = $("<div />");
>>> var op = 0.5;
>>> elem.css("opacity", op);
>>> elem.css("opacity") != op;

The bug affects $.css() function, so I believe it's worth sorting this out.

Changed November 04, 2010 04:57AM UTC by comment:5

This is related to #5145, which $.support.opacity was normalized for this issue.

But currently, css() as a getter does not normalize the comma->period.

Changed April 17, 2011 06:11PM UTC by john comment:6

resolution: → wontfix
status: newclosed

Yeah, considering that this was already resolved in Chrome (and it has a good update process) we're not going to tackle this in jQuery itself.