Issue metadata
Sign in to add a comment
|
getComputedStyle parsing float, return string with , instead of .
Reported by
stevench...@gmail.com,
Jun 12 2017
|
||||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36
Steps to reproduce the problem:
1. Open a page with the following div: <div id="test" style="transition:height 0.35s ease"></div>
2. Open developer console
3. Run javascript: window.getComputedStyle(document.getElementById('test')).transitionDuration
What is the expected behavior?
The console prints: "0.35s" (the result of the window.getComputedStyle)
What went wrong?
The parsed result is "0,35s" instead of "0.35s"
Did this work before? Yes Version 59.0.3071.86 (Official Build) (64-bit) Get help with Chrome Report an issue
Chrome version: 60.0.3112.24 (Official Build) beta (64-bit) Channel: beta
OS Version: Ubuntu 16.04.2 LTS
Flash Version:
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.24 Safari/537.36
Chrome version: Version 60.0.3112.24 (Official Build) beta (64-bit)
,
Jun 13 2017
Added a screencast demo. (Did not know this was an option) I only have Ubuntu 16.04.2 LTS available to so unable to try other Ubuntu versions. If you need extra info about the system or OS, please let me know so that I can provide it.
,
Jun 13 2017
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 13 2017
This bug needs to be fixed pronto as it's breaking websites. It only occurs with languages that use "," as decimal point. Try this (Linux). $ LANGUAGE=DE chrome
,
Jun 13 2017
Just to add to the prervious comment. This is potentially site-breaking for websites that use parseFloat on values returned by getComputedStyle.
,
Jun 13 2017
Or if values are copied from one element to the other via getComputedStyle, as set values such as 14,5px are invalid.
,
Jun 14 2017
I cannot repro on Windows with a ToT build with my language set to German in Chromium (61.0.3130.0 (Entwickler-Build) (64-Bit), f3017f051032150a9bbcd75dbfb371d21ab3abdb-refs/heads/master@{#478988}) I tried adding the lang="nl" as observed in the screencast (see attached test.html). @Test team - can you please retry with the reported version and with setting the language to German?
,
Jun 14 2017
Might be Linux-only then. I observed this with 60.0.3112.31.
,
Jun 14 2017
Re #7: When you say "language set to German in Chromium", did you set the OS-level language, or just something in Chromium itself?
,
Jun 14 2017
I set it in Chromium's settings - ie the 'Chromium is displayed in this language' setting.
,
Jun 14 2017
May Linux reproduction step was wrong. I've tried LANGUAGE=EN (or C) and it did not fix the problem. So the reverse does probably not cause it. This bug has wider implications for Developer Tools at least. Any manually set attribute reports the style with "," in "Elements" and "Styles", being stroked-through as invalid in the latter. So doing this in console works properly (in that the correct padding is added), but is displayed improperly in Developer Tools. $0.style.padding = "100.5px"
,
Jun 14 2017
Alright, I've got it. This does definitely fix it. $ LC_NUMERIC=C chrome And this does definitely cause it, but only after you've installed the language packages for these languages in Ubuntu. (In settings.) Otherwise it appears to fall back to C. $ LC_NUMERIC=de_DE.UTF-8 chrome $ LC_NUMERIC=fr_FR.UTF-8 chrome
,
Jun 14 2017
re #12 to clarify, is this problem restricted to the developer tools console? Or does the incorrect string also get output if called from script on the page.
So if you add
<script>
document.getElementById('test').textContent = window.getComputedStyle(document.getElementById('test')).transitionDuration
</script>
to the test, do you get the correct or incorrect behaviour?
,
Jun 14 2017
Unable to reproduce the issue in Ubuntu 16.04 using chrome reported version #60.0.3112.24 as per comment #7.
Following are the steps followed to reproduce the issue.
------------
1. Changed the language to german, system wide in ubuntu 16.04.
2. Opened test.html in chrome window.
3. Opened developer console.
4. Ran javascript: window.getComputedStyle(document.getElementById('test')).transitionDuration
5. Observed that console printed: "0.35s" as expected.
Attaching screen shot for reference.
mikelawther@ - Could you please check the screen shot and steps and please let us know if anything missing from our side.
Thanks...!!
,
Jun 14 2017
#13 This occurs on the page itself and in console. #14 Please run this in console to confirm. I also recommend a reboot in case. $ locale
,
Jun 14 2017
#14 (I meant terminal, as console can be confusing here.)
,
Jun 14 2017
Does this reproduce using other browsers (Firefox)?
,
Jun 15 2017
@pdknsk - thanks for helping narrow down how to reproduce this. Can you please confirm that you can still see the problem when using the latest nightly build of Chromium (eg using https://github.com/scheib/chromium-latest-linux). I'm interested in whether this is a recent regression, as we've had problems like this before (eg https://bugs.chromium.org/p/chromium/issues/detail?id=22782). We do try and set LC_NUMERIC (https://cs.chromium.org/chromium/src/services/service_manager/embedder/main.cc?q=lc_numeric+package:%5Echromium$&l=180) but something may have changed recently. @krajshree - can you check what your LC_NUMERIC env variable is by typing 'locale | grep LC_NUMERIC'. From comment #12, you may also need to install the German language package for Ubuntu to be able to repro this. Thanks!
,
Jun 15 2017
Chatting further with other Chrome devs, this looks like a dupe. Thanks for the effort on this issue.
,
Jul 2 2017
I think it was a mistake to merge this bug. The other bug has low priority, and no progress. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by krajshree@chromium.org
, Jun 13 2017Components: Platform>DevTools
Labels: Needs-Feedback
Unable to reproduce the issue on Windows 10 and Ubuntu 14.04 using chrome reported version #60.0.3112.24 and latest dev #61.0.3128.0. Attached a screen cast for reference. Following are the steps followed to reproduce the issue. ------------ 1. Created an html file using div: <div id="test" style="transition:height 0.35s ease"></div> 2. Opened developer console. 3. Ran javascript: window.getComputedStyle(document.getElementById('test')).transitionDuration 4. Observed that console printed: "0.35s" as expected. stevenchoo.nl@ - Could you please check this issue using latest dev #61.0.3128.0 by creating a new profile without any apps and extensions and please let us know if the issue still persist or not. Thanks...!!2.7 MB
2.7 MB View Download