[Webkit-unassigned] [Bug 48308] Too precise serialization from floating point number to string for "number" input elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 31 08:19:01 PDT 2010


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





--- Comment #12 from Dai Mikurube <dmikurube at google.com>  2010-10-31 08:19:00 PST ---
(From update of attachment 72189)
View in context: https://bugs.webkit.org/attachment.cgi?id=72189&action=review

>> JavaScriptCore/ChangeLog:5
>> +        Too precise serialization from floating point number to string
> 
> Please change the summary as Simon did for the bug entry.
> We should mention that this affects only to input element.

Modified.

>> JavaScriptCore/JavaScriptCore.exp:392
>> +__ZN3WTF14numberToStringEdPtj
> 
> We need similar change to JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def. The mangled symbol name in VC++ is different from gcc's.

Finally, removed it and added a new function toStringExponential to JavaScriptCore.exp and .def.

>> LayoutTests/fast/forms/script-tests/input-valueasnumber-number.js:24
>> +shouldBe('valueAsNumberFor("123456789012345678901234567890123456789")', '1.23456789012345678E+38');
> 
> Why the result is changed? This test doesn't use serializeForNumberType().

It was a mistake. I brought it back. (Actually, both results before and after the change PASSed.)

>> WebCore/html/HTMLInputElement.cpp:302
>> +    double acceptableError = step / pow(2.0, FLT_MANT_DIG);
> 
> This is specific to type=number.  Other types such as type=date may have different acceptableError value.
> Please introduce InputType::acceptableError(step) and override it in NumberInputType.  You can merge the same expression in NumberImputType::stepMismatch().

Done.

>> WebCore/html/HTMLInputElement.cpp:303
>> +    if (newValue - m_inputType->minimum() < -acceptableError) {
> 
> Is this change needed to pass existing tests?  If not, we need new test cases.

Yes, it is required to pass /platform/mac/fast/forms/input-number-click.html .

-- 
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