[Webkit-unassigned] [Bug 41541] New: Dots are changed into comas in numbers when reading a css value from javascript

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 2 14:26:37 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41541

           Summary: Dots are changed into comas in numbers when reading a
                    css value from javascript
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dysinscr at gmail.com


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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list