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 Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 int LayoutSlider::baselinePosition(FontBaseline, bool /*firstLine*/, LineDirecti
onMode, LinePositionMode linePositionMode) const | 48 int LayoutSlider::baselinePosition(FontBaseline, bool /*firstLine*/, LineDirecti
onMode, LinePositionMode linePositionMode) const |
49 { | 49 { |
50 ASSERT(linePositionMode == PositionOnContainingLine); | 50 ASSERT(linePositionMode == PositionOnContainingLine); |
51 // FIXME: Patch this function for writing-mode. | 51 // FIXME: Patch this function for writing-mode. |
52 return size().height() + marginTop(); | 52 return size().height() + marginTop(); |
53 } | 53 } |
54 | 54 |
55 void LayoutSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, La
youtUnit& maxLogicalWidth) const | 55 void LayoutSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, La
youtUnit& maxLogicalWidth) const |
56 { | 56 { |
57 maxLogicalWidth = defaultTrackLength * style()->effectiveZoom(); | 57 maxLogicalWidth = LayoutUnit(defaultTrackLength * style()->effectiveZoom()); |
58 if (!style()->width().hasPercent()) | 58 if (!style()->width().hasPercent()) |
59 minLogicalWidth = maxLogicalWidth; | 59 minLogicalWidth = maxLogicalWidth; |
60 } | 60 } |
61 | 61 |
62 inline SliderThumbElement* LayoutSlider::sliderThumbElement() const | 62 inline SliderThumbElement* LayoutSlider::sliderThumbElement() const |
63 { | 63 { |
64 return toSliderThumbElement(toElement(node())->userAgentShadowRoot()->getEle
mentById(ShadowElementNames::sliderThumb())); | 64 return toSliderThumbElement(toElement(node())->userAgentShadowRoot()->getEle
mentById(ShadowElementNames::sliderThumb())); |
65 } | 65 } |
66 | 66 |
67 void LayoutSlider::layout() | 67 void LayoutSlider::layout() |
68 { | 68 { |
69 // FIXME: Find a way to cascade appearance. | 69 // FIXME: Find a way to cascade appearance. |
70 // http://webkit.org/b/62535 | 70 // http://webkit.org/b/62535 |
71 LayoutBox* thumbBox = sliderThumbElement()->layoutBox(); | 71 LayoutBox* thumbBox = sliderThumbElement()->layoutBox(); |
72 if (thumbBox && thumbBox->isSliderThumb()) | 72 if (thumbBox && thumbBox->isSliderThumb()) |
73 toLayoutSliderThumb(thumbBox)->updateAppearance(styleRef()); | 73 toLayoutSliderThumb(thumbBox)->updateAppearance(styleRef()); |
74 | 74 |
75 LayoutFlexibleBox::layout(); | 75 LayoutFlexibleBox::layout(); |
76 } | 76 } |
77 | 77 |
78 bool LayoutSlider::inDragMode() const | 78 bool LayoutSlider::inDragMode() const |
79 { | 79 { |
80 return sliderThumbElement()->active(); | 80 return sliderThumbElement()->active(); |
81 } | 81 } |
82 | 82 |
83 } // namespace blink | 83 } // namespace blink |
OLD | NEW |