| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 int LayoutSlider::baselinePosition(FontBaseline, bool /*firstLine*/, LineDirecti
onMode, LinePositionMode linePositionMode) const | 47 int LayoutSlider::baselinePosition(FontBaseline, bool /*firstLine*/, LineDirecti
onMode, LinePositionMode linePositionMode) const |
| 48 { | 48 { |
| 49 ASSERT(linePositionMode == PositionOnContainingLine); | 49 ASSERT(linePositionMode == PositionOnContainingLine); |
| 50 // FIXME: Patch this function for writing-mode. | 50 // FIXME: Patch this function for writing-mode. |
| 51 return (size().height() + marginTop()).toInt(); | 51 return (size().height() + marginTop()).toInt(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void LayoutSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, La
youtUnit& maxLogicalWidth) const | 54 void LayoutSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, La
youtUnit& maxLogicalWidth) const |
| 55 { | 55 { |
| 56 maxLogicalWidth = LayoutUnit(defaultTrackLength * style()->effectiveZoom()); | 56 maxLogicalWidth = LayoutUnit(defaultTrackLength * style()->effectiveZoom()); |
| 57 if (!style()->width().hasPercent()) | 57 if (!style()->width().isPercentOrCalc()) |
| 58 minLogicalWidth = maxLogicalWidth; | 58 minLogicalWidth = maxLogicalWidth; |
| 59 } | 59 } |
| 60 | 60 |
| 61 inline SliderThumbElement* LayoutSlider::sliderThumbElement() const | 61 inline SliderThumbElement* LayoutSlider::sliderThumbElement() const |
| 62 { | 62 { |
| 63 return toSliderThumbElement(toElement(node())->userAgentShadowRoot()->getEle
mentById(ShadowElementNames::sliderThumb())); | 63 return toSliderThumbElement(toElement(node())->userAgentShadowRoot()->getEle
mentById(ShadowElementNames::sliderThumb())); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void LayoutSlider::layout() | 66 void LayoutSlider::layout() |
| 67 { | 67 { |
| 68 // FIXME: Find a way to cascade appearance. | 68 // FIXME: Find a way to cascade appearance. |
| 69 // http://webkit.org/b/62535 | 69 // http://webkit.org/b/62535 |
| 70 LayoutBox* thumbBox = sliderThumbElement()->layoutBox(); | 70 LayoutBox* thumbBox = sliderThumbElement()->layoutBox(); |
| 71 if (thumbBox && thumbBox->isSliderThumb()) | 71 if (thumbBox && thumbBox->isSliderThumb()) |
| 72 toLayoutSliderThumb(thumbBox)->updateAppearance(styleRef()); | 72 toLayoutSliderThumb(thumbBox)->updateAppearance(styleRef()); |
| 73 | 73 |
| 74 LayoutFlexibleBox::layout(); | 74 LayoutFlexibleBox::layout(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool LayoutSlider::inDragMode() const | 77 bool LayoutSlider::inDragMode() const |
| 78 { | 78 { |
| 79 return sliderThumbElement()->active(); | 79 return sliderThumbElement()->active(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| OLD | NEW |