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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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 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 30 matching lines...) Expand all
41 } 41 }
42 42
43 LayoutSlider::~LayoutSlider() 43 LayoutSlider::~LayoutSlider()
44 { 44 {
45 } 45 }
46 46
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(); 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().hasPercent())
58 minLogicalWidth = maxLogicalWidth; 58 minLogicalWidth = maxLogicalWidth;
59 } 59 }
60 60
61 inline SliderThumbElement* LayoutSlider::sliderThumbElement() const 61 inline SliderThumbElement* LayoutSlider::sliderThumbElement() const
(...skipping 11 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698