Hi, I'm using french locale, and have 94 failing tests in test_value_storage.html, all related to -moz-animation-timing-function. Example of a failing test: failed | parse+compute+serialize(-moz-animation-timing-function) should be idempotent for '-moz-animation: bounce 1s linear 2s' - got "cubic-bezier(0,250000, 0,100000, 0,250000, 1,000000)", expected "cubic-bezier(0,000000, 0,000000, 1,000000, 1,000000)" This happens because getComputedStyle uses printf with floats http://hg.mozilla.org/mozilla-central/file/320e5abc6f5a/layout/style/nsComputedDOMStyle.cpp#l3986 This gives me, with my locale, computed -moz-animation-timing-function which look like: cubic-bezier(0,250000, 0,100000, 0,250000, 1,000000) Which is wrong (notice the comma instead of dots for decimal separators).
Yeah, that's just wrong. Arno, do you want to fix, or should I?
Created attachment 543919 [details] [diff] [review] patch v1 I'm unsure if this is the right way. Should I instead reset LC_NUMERIC locale before calling nsPrintfCString (and set it back after) ?
You could use nsAutoString and AppendPrintf e.g. AppendPrintf("%f,%f", x, y) to build up a string. Or alternatively nsTextFormatter::ssprintf e.g. nsTextFormatter::ssprintf(aValue, NS_LITERAL_STRING("%g,%g").get(), x, y);
Or just use AppendFloat(). You do NOT want to mess with LC_NUMERIC.
Created attachment 543970 [details] [diff] [review] patch v2
Comment on attachment 543970 [details] [diff] [review] patch v2 r=me, but please add a useful commit message!
Created attachment 544162 [details] [diff] [review] reviewed patch with a commit message
That commit message needs to list the bug number (and reviewer, typically). I recommend: "Bug 669220. Use location-independent float-to-string conversions for timing function computed styles. r=bzbarsky".
Created attachment 544262 [details] [diff] [review] reviewed patch with a commit message (2)
Created attachment 544264 [details] [diff] [review] reviewed patch with a commit message (2)
https://hg.mozilla.org/integration/mozilla-inbound/rev/a9b83b5cfcab (I changed "location-independent" in the commit message to "locale-independent".)