Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: Source/WebCore/platform/Decimal.cpp

Issue 10786036: Merge 122552 - REGRESSION(r119948): [Forms] Spin button Up/Down actions make value to zero for inpu… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/Decimal.cpp
===================================================================
--- Source/WebCore/platform/Decimal.cpp (revision 122851)
+++ Source/WebCore/platform/Decimal.cpp (working copy)
@@ -628,7 +628,7 @@
const int numberOfDigits = countDigits(result);
const int numberOfDropDigits = -exponent();
if (numberOfDigits < numberOfDropDigits)
- return zero(Positive);
+ return isPositive() ? Decimal(1) : zero(Positive);
result = scaleDown(result, numberOfDropDigits - 1);
if (sign() == Positive && result % 10 > 0)
@@ -670,7 +670,7 @@
const int numberOfDigits = countDigits(result);
const int numberOfDropDigits = -exponent();
if (numberOfDigits < numberOfDropDigits)
- return zero(Positive);
+ return isPositive() ? zero(Positive) : Decimal(-1);
result = scaleDown(result, numberOfDropDigits - 1);
if (isNegative() && result % 10 > 0)

Powered by Google App Engine
This is Rietveld 408576698