diff options
Diffstat (limited to 'Source/WebCore/html/StepRange.h')
-rw-r--r-- | Source/WebCore/html/StepRange.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/WebCore/html/StepRange.h b/Source/WebCore/html/StepRange.h index 697a7b53d..84aa75a7f 100644 --- a/Source/WebCore/html/StepRange.h +++ b/Source/WebCore/html/StepRange.h @@ -18,8 +18,7 @@ * */ -#ifndef StepRange_h -#define StepRange_h +#pragma once #include "Decimal.h" #include <wtf/Forward.h> @@ -27,10 +26,13 @@ namespace WebCore { -class HTMLInputElement; - enum AnyStepHandling { RejectAny, AnyIsDefaultStep }; +enum class RangeLimitations { + Valid, + Invalid +}; + class StepRange { public: enum StepValueShouldBe { @@ -71,11 +73,12 @@ public: StepRange(); StepRange(const StepRange&); - StepRange(const Decimal& stepBase, const Decimal& minimum, const Decimal& maximum, const Decimal& step, const StepDescription&); + StepRange(const Decimal& stepBase, RangeLimitations, const Decimal& minimum, const Decimal& maximum, const Decimal& step, const StepDescription&); Decimal acceptableError() const; Decimal alignValueForStep(const Decimal& currentValue, const Decimal& newValue) const; Decimal clampValue(const Decimal& value) const; bool hasStep() const { return m_hasStep; } + bool hasRangeLimitations() const { return m_hasRangeLimitations; } Decimal maximum() const { return m_maximum; } Decimal minimum() const { return m_minimum; } static Decimal parseStep(AnyStepHandling, const StepDescription&, const String&); @@ -114,9 +117,8 @@ private: const Decimal m_step; const Decimal m_stepBase; const StepDescription m_stepDescription; - const bool m_hasStep; + const bool m_hasRangeLimitations { false }; + const bool m_hasStep { false }; }; -} - -#endif // StepRange_h +} // namespace WebCore |