OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Publicw | 5 * modify it under the terms of the GNU Library General Publicw |
6 * version 2 of the License, or (at your option) any later version. | 6 * version 2 of the License, or (at your option) any later version. |
7 * | 7 * |
8 * This library is distributed in the hope that it will be useful, | 8 * This library is distributed in the hope that it will be useful, |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "core/layout/LayoutSliderThumb.h" | 27 #include "core/layout/LayoutSliderThumb.h" |
28 #include "wtf/MathExtras.h" | 28 #include "wtf/MathExtras.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 const int LayoutSlider::defaultTrackLength = 129; | 32 const int LayoutSlider::defaultTrackLength = 129; |
33 | 33 |
34 LayoutSlider::LayoutSlider(HTMLInputElement* element) | 34 LayoutSlider::LayoutSlider(HTMLInputElement* element) |
35 : LayoutFlexibleBox(element) { | 35 : LayoutFlexibleBox(element) { |
36 // We assume LayoutSlider works only with <input type=range>. | 36 // We assume LayoutSlider works only with <input type=range>. |
37 ASSERT(element->type() == InputTypeNames::range); | 37 DCHECK_EQ(element->type(), InputTypeNames::range); |
38 } | 38 } |
39 | 39 |
40 LayoutSlider::~LayoutSlider() {} | 40 LayoutSlider::~LayoutSlider() {} |
41 | 41 |
42 int LayoutSlider::baselinePosition(FontBaseline, | 42 int LayoutSlider::baselinePosition(FontBaseline, |
43 bool /*firstLine*/, | 43 bool /*firstLine*/, |
44 LineDirectionMode, | 44 LineDirectionMode, |
45 LinePositionMode linePositionMode) const { | 45 LinePositionMode linePositionMode) const { |
46 ASSERT(linePositionMode == PositionOnContainingLine); | 46 DCHECK_EQ(linePositionMode, PositionOnContainingLine); |
47 // FIXME: Patch this function for writing-mode. | 47 // FIXME: Patch this function for writing-mode. |
48 return (size().height() + marginTop()).toInt(); | 48 return (size().height() + marginTop()).toInt(); |
49 } | 49 } |
50 | 50 |
51 void LayoutSlider::computeIntrinsicLogicalWidths( | 51 void LayoutSlider::computeIntrinsicLogicalWidths( |
52 LayoutUnit& minLogicalWidth, | 52 LayoutUnit& minLogicalWidth, |
53 LayoutUnit& maxLogicalWidth) const { | 53 LayoutUnit& maxLogicalWidth) const { |
54 maxLogicalWidth = LayoutUnit(defaultTrackLength * style()->effectiveZoom()); | 54 maxLogicalWidth = LayoutUnit(defaultTrackLength * style()->effectiveZoom()); |
55 if (!style()->width().isPercentOrCalc()) | 55 if (!style()->width().isPercentOrCalc()) |
56 minLogicalWidth = maxLogicalWidth; | 56 minLogicalWidth = maxLogicalWidth; |
(...skipping 13 matching lines...) Expand all Loading... |
70 toLayoutSliderThumb(thumbBox)->updateAppearance(styleRef()); | 70 toLayoutSliderThumb(thumbBox)->updateAppearance(styleRef()); |
71 | 71 |
72 LayoutFlexibleBox::layout(); | 72 LayoutFlexibleBox::layout(); |
73 } | 73 } |
74 | 74 |
75 bool LayoutSlider::inDragMode() const { | 75 bool LayoutSlider::inDragMode() const { |
76 return sliderThumbElement()->isActive(); | 76 return sliderThumbElement()->isActive(); |
77 } | 77 } |
78 | 78 |
79 } // namespace blink | 79 } // namespace blink |
OLD | NEW |