Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutSlider.cpp

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix additional test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698