Bug Tracker

Modify

Ticket #7286 (closed bug: wontfix)

Opened 3 years ago

Last modified 2 years ago

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

Reported by: mateusz.haligowski@… Owned by:
Priority: undecided Milestone:
Component: css Version: 1.4.3
Keywords: needsreview Cc:
Blocking: Blocked by:

Description

 http://www.jsfiddle.net/JJkWP/

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?

Change History

comment:1 Changed 3 years ago by mhaligowski

Seems to be only Chrome for Linux issue:  http://code.google.com/p/chromium/issues/detail?id=22782

I'm writing a fix for jQuery, though.

comment:2 Changed 3 years ago by rwaldron

  • Component changed from unfiled to css

comment:3 Changed 3 years ago by snover

  • Keywords needsreview added

This issue has been resolved upstream at  http://trac.webkit.org/changeset/69928. 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.

comment:4 Changed 3 years ago by mhaligowski

Still:

>>> 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.

comment:5 Changed 3 years ago by paul.irish

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.

comment:6 Changed 2 years ago by john

  • Status changed from new to closed
  • Resolution set to wontfix

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.