Floating number applies with comma via JavaScript DOM API
Reported by
vlad...@gmail.com,
Mar 2 2018
|
||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
Steps to reproduce the problem:
1. Add any element on page
2. Do `var div = document.querySelector('div');`
3. Apply any style with floating number, e.g. `div.style.width = "50.5%";`
What is the expected behavior?
Should be `style="width: 50.5%"
What went wrong?
1. Dot transforms into comma and become `style="width: 50,5%"
2. In DevTools I see, that property is wrong, but styles successfully applied
3. After chaging of property (need to keep comma) styles stop working, e.g. change 50,5% to 50,6%
Did this work before? N/A
Chrome version: 64.0.3282.186 Channel: stable
OS Version: OS X 10.13.3
Flash Version:
,
Mar 2 2018
I opened Mac System Preferences -> Lang and Region -> Additional -> Delimiter and changed it from comma to dot. Now all works fine, but I am not sure that language preferences should affect JS API.
,
Mar 2 2018
Sounds like devtools UI is affected by the bug, not JavaScript DOM API.
,
Mar 2 2018
Note comment #3. I agree this appears to be DevTools localizing the string and then using that localized version in JS calls.
,
Mar 2 2018
Cannot reproduce it. Please see the screenshot. Where do you observe 10,5% ?
,
Mar 3 2018
You need to have delimiter to be set "," in MacOS System Preferences. Then restart browser and issue will reproduce.
,
Mar 5 2018
Tested the issue on reported chrome version 64.0.3282.186 using Mac 10.13.3 with steps mentioned below: 1) Launched chrome reported version and opened https://jsfiddle.net/4Ly7mo43/5/(as provided in comment#1) 2) Right click on jsfiddle output and select inspect and observed "width" value 3) Able to see as width: 50.5%; Observation: Tried checking the issue by changing comma to dot by navigating Mac System Preferences -> Lang and Region -> Additional -> Delimiter, seen the same behaviour. @Reporter:Please find the attached screen cast for your reference and let us know if we missed anything in reproducing the issue, please provide your feedback on it which helps us in further triaging it. Thanks!
,
Mar 6 2018
,
Apr 6 2018
No feedback was received in the last 30 days from the reporter, so archiving this issue. Please re-open or file a new bug if necessary. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by vlad...@gmail.com
, Mar 2 2018