Chromium Code Reviews| Index: Source/core/html/forms/StepRange.cpp |
| diff --git a/Source/core/html/forms/StepRange.cpp b/Source/core/html/forms/StepRange.cpp |
| index 62a3afac9b47be031dc26a11f069d001d9ebbb07..8967c06652782de76711ec74bf0622b5e9d927ea 100644 |
| --- a/Source/core/html/forms/StepRange.cpp |
| +++ b/Source/core/html/forms/StepRange.cpp |
| @@ -26,6 +26,7 @@ |
| #include "wtf/MathExtras.h" |
| #include "wtf/text/WTFString.h" |
| #include <float.h> |
| +#include <stdio.h> |
|
tkent
2014/02/28 01:12:04
This change is unnecessary.
Habib Virji
2014/03/04 09:33:44
Done. Apologies missed it.
|
| using namespace std; |
| @@ -157,11 +158,11 @@ bool StepRange::stepMismatch(const Decimal& valueForCheck) const |
| DEFINE_STATIC_LOCAL(const Decimal, twoPowerOfDoubleMantissaBits, (Decimal::Positive, 0, UINT64_C(1) << DBL_MANT_DIG)); |
| if (value / twoPowerOfDoubleMantissaBits > m_step) |
| return false; |
| - // The computation follows HTML5 4.10.7.2.10 `The step attribute' : |
| + // http://www.whatwg.org/specs/web-apps/current-work/#the-step-attribute: |
|
tkent
2014/02/28 01:12:04
We don't need to update this now.
Habib Virji
2014/03/04 09:33:44
Done.
|
| // ... that number subtracted from the step base is not an integral multiple |
| // of the allowed value step, the element is suffering from a step mismatch. |
| const Decimal remainder = (value - m_step * (value / m_step).round()).abs(); |
| - // Accepts errors in lower fractional part which IEEE 754 single-precision |
| + // Accepts errors in lower fractional part which IEEE 754 double-precision |
|
tkent
2014/02/28 01:12:04
Ditto.
Habib Virji
2014/03/04 09:33:44
Done.
|
| // can't represent. |
| const Decimal computedAcceptableError = acceptableError(); |
| return computedAcceptableError < remainder && remainder < (m_step - computedAcceptableError); |