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

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

Issue 1647313003: Continue converting to explicit LayoutUnit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicitContstructors
Patch Set: Add TODO 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return sliderStyle.appearance() == SliderVerticalPart; 62 return sliderStyle.appearance() == SliderVerticalPart;
63 } 63 }
64 64
65 void LayoutSliderContainer::computeLogicalHeight(LayoutUnit logicalHeight, Layou tUnit logicalTop, LogicalExtentComputedValues& computedValues) const 65 void LayoutSliderContainer::computeLogicalHeight(LayoutUnit logicalHeight, Layou tUnit logicalTop, LogicalExtentComputedValues& computedValues) const
66 { 66 {
67 HTMLInputElement* input = toHTMLInputElement(node()->shadowHost()); 67 HTMLInputElement* input = toHTMLInputElement(node()->shadowHost());
68 bool isVertical = hasVerticalAppearance(input); 68 bool isVertical = hasVerticalAppearance(input);
69 69
70 if (input->layoutObject()->isSlider() && !isVertical && input->list()) { 70 if (input->layoutObject()->isSlider() && !isVertical && input->list()) {
71 int offsetFromCenter = LayoutTheme::theme().sliderTickOffsetFromTrackCen ter(); 71 int offsetFromCenter = LayoutTheme::theme().sliderTickOffsetFromTrackCen ter();
72 LayoutUnit trackHeight = 0; 72 LayoutUnit trackHeight;
73 if (offsetFromCenter < 0) { 73 if (offsetFromCenter < 0) {
74 trackHeight = -2 * offsetFromCenter; 74 trackHeight = -2 * offsetFromCenter;
75 } else { 75 } else {
76 int tickLength = LayoutTheme::theme().sliderTickSize().height(); 76 int tickLength = LayoutTheme::theme().sliderTickSize().height();
77 trackHeight = 2 * (offsetFromCenter + tickLength); 77 trackHeight = 2 * (offsetFromCenter + tickLength);
78 } 78 }
79 float zoomFactor = style()->effectiveZoom(); 79 float zoomFactor = style()->effectiveZoom();
80 if (zoomFactor != 1.0) 80 if (zoomFactor != 1.0)
81 trackHeight *= zoomFactor; 81 trackHeight *= zoomFactor;
82 82
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 thumbLocation.setX(thumbLocation.x() - offset); 139 thumbLocation.setX(thumbLocation.x() - offset);
140 thumb->setLocation(thumbLocation); 140 thumb->setLocation(thumbLocation);
141 141
142 // We need one-off invalidation code here because painting of the timeline e lement does not go through style. 142 // We need one-off invalidation code here because painting of the timeline e lement does not go through style.
143 // Instead it has a custom implementation in C++ code. 143 // Instead it has a custom implementation in C++ code.
144 // Therefore the style system cannot understand when it needs to be paint in validated. 144 // Therefore the style system cannot understand when it needs to be paint in validated.
145 setShouldDoFullPaintInvalidation(); 145 setShouldDoFullPaintInvalidation();
146 } 146 }
147 147
148 } // namespace blink 148 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutReplaced.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698