Bug 41541 - Dots are changed into commas in numbers when reading a css value from javascript
Summary: Dots are changed into commas in numbers when reading a css value from javascript
Status: RESOLVED DUPLICATE of bug 18994
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 14:26 PDT by dysinscr
Modified: 2010-07-02 20:20 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dysinscr 2010-07-02 14:26:37 PDT
Hi,
I have discovered that WebKit is changing dots into comas in CSS numbers when reading them in Javascript.
For example, 17.5 becomes 17,5. This is correct although it can be a problem.

Let's try this :
 - Open your favorite WebKit based browser that supports the web inspector, like chromium or epiphany-webkit.
 - Load your favorite page, like about:blank.
 - Load the Web Inspector (Developer Tools in chromium) and go to the "Console" tab.

Run theses commands :
   d = document.createElement('div'); // we create a new DIV element
   document.body.appendChild(d); // append it to body
   d.style.WebkitTransform = 'rotate(50deg)'; // rotation.

/* Now, we are going to read this transformation value */
   document.defaultView.getComputedStyle(d,null).getPropertyValue('-webkit-transform');

=> This give me "matrix(0,642788, 0,766044, -0,766044, 0,642788, 0, 0)"

I was first expecting "rotate(50deg)" (like Opera, which gives a rad value though) but matrix() is fine too (like Mozilla).

The problem is : I would prefer getting : "matrix(0.642788, 0.766044, -0.766044, 0.642788, 0, 0)"
This would be nicer because currently, commas are used for separating value AND for decimal separator.
That's not very convenient. Moreover, Javascript's parseFloat expects a dot for decimal separator.

This is the same behavior for opacity : if I set d.style.opacity="0.5", I get "0,5". So that's not a -webkit-transform specific issue.
Comment 1 Alexey Proskuryakov 2010-07-02 20:20:49 PDT

*** This bug has been marked as a duplicate of bug 18994 ***