OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 13 matching lines...) Expand all Loading... |
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "core/html/forms/RangeInputType.h" | 32 #include "core/html/forms/RangeInputType.h" |
33 | 33 |
| 34 #include <limits> |
34 #include "bindings/core/v8/ExceptionState.h" | 35 #include "bindings/core/v8/ExceptionState.h" |
35 #include "core/HTMLNames.h" | 36 #include "core/HTMLNames.h" |
36 #include "core/InputTypeNames.h" | 37 #include "core/InputTypeNames.h" |
37 #include "core/dom/AXObjectCache.h" | 38 #include "core/dom/AXObjectCache.h" |
38 #include "core/dom/NodeComputedStyle.h" | 39 #include "core/dom/NodeComputedStyle.h" |
39 #include "core/dom/shadow/ShadowRoot.h" | 40 #include "core/dom/shadow/ShadowRoot.h" |
40 #include "core/events/KeyboardEvent.h" | 41 #include "core/events/KeyboardEvent.h" |
41 #include "core/events/MouseEvent.h" | 42 #include "core/events/MouseEvent.h" |
42 #include "core/events/ScopedEventQueue.h" | 43 #include "core/events/ScopedEventQueue.h" |
43 #include "core/html/HTMLDataListElement.h" | 44 #include "core/html/HTMLDataListElement.h" |
44 #include "core/html/HTMLDataListOptionsCollection.h" | 45 #include "core/html/HTMLDataListOptionsCollection.h" |
45 #include "core/html/HTMLDivElement.h" | 46 #include "core/html/HTMLDivElement.h" |
46 #include "core/html/HTMLInputElement.h" | 47 #include "core/html/HTMLInputElement.h" |
47 #include "core/html/HTMLOptionElement.h" | 48 #include "core/html/HTMLOptionElement.h" |
48 #include "core/html/forms/StepRange.h" | 49 #include "core/html/forms/StepRange.h" |
49 #include "core/html/parser/HTMLParserIdioms.h" | 50 #include "core/html/parser/HTMLParserIdioms.h" |
50 #include "core/html/shadow/ShadowElementNames.h" | 51 #include "core/html/shadow/ShadowElementNames.h" |
51 #include "core/html/shadow/SliderThumbElement.h" | 52 #include "core/html/shadow/SliderThumbElement.h" |
52 #include "core/layout/LayoutSlider.h" | 53 #include "core/layout/LayoutSlider.h" |
53 #include "wtf/MathExtras.h" | 54 #include "wtf/MathExtras.h" |
54 #include "wtf/NonCopyingSort.h" | 55 #include "wtf/NonCopyingSort.h" |
55 #include <limits> | |
56 | 56 |
57 namespace blink { | 57 namespace blink { |
58 | 58 |
59 using namespace HTMLNames; | 59 using namespace HTMLNames; |
60 | 60 |
61 static const int rangeDefaultMinimum = 0; | 61 static const int rangeDefaultMinimum = 0; |
62 static const int rangeDefaultMaximum = 100; | 62 static const int rangeDefaultMaximum = 100; |
63 static const int rangeDefaultStep = 1; | 63 static const int rangeDefaultStep = 1; |
64 static const int rangeDefaultStepBase = 0; | 64 static const int rangeDefaultStepBase = 0; |
65 static const int rangeStepScaleFactor = 1; | 65 static const int rangeStepScaleFactor = 1; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 : Decimal::infinity(Decimal::Negative); | 403 : Decimal::infinity(Decimal::Negative); |
404 const Decimal closestRight = middle != m_tickMarkValues.size() | 404 const Decimal closestRight = middle != m_tickMarkValues.size() |
405 ? m_tickMarkValues[middle] | 405 ? m_tickMarkValues[middle] |
406 : Decimal::infinity(Decimal::Positive); | 406 : Decimal::infinity(Decimal::Positive); |
407 if (closestRight - value < value - closestLeft) | 407 if (closestRight - value < value - closestLeft) |
408 return closestRight; | 408 return closestRight; |
409 return closestLeft; | 409 return closestLeft; |
410 } | 410 } |
411 | 411 |
412 } // namespace blink | 412 } // namespace blink |
OLD | NEW |