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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutSliderContainer.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 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 LayoutFlexibleBox::layout(); 122 LayoutFlexibleBox::layout();
123 123
124 mutableStyleRef().setDirection(oldTextDirection); 124 mutableStyleRef().setDirection(oldTextDirection);
125 // These should always exist, unless someone mutates the shadow DOM (e.g., i n the inspector). 125 // These should always exist, unless someone mutates the shadow DOM (e.g., i n the inspector).
126 if (!thumb || !track) 126 if (!thumb || !track)
127 return; 127 return;
128 128
129 double percentageOffset = sliderPosition(input).toDouble(); 129 double percentageOffset = sliderPosition(input).toDouble();
130 LayoutUnit availableExtent = isVertical ? track->contentHeight() : track->co ntentWidth(); 130 LayoutUnit availableExtent = isVertical ? track->contentHeight() : track->co ntentWidth();
131 availableExtent -= isVertical ? thumb->size().height() : thumb->size().width (); 131 availableExtent -= isVertical ? thumb->size().height() : thumb->size().width ();
132 LayoutUnit offset = percentageOffset * availableExtent; 132 LayoutUnit offset(percentageOffset * availableExtent);
133 LayoutPoint thumbLocation = thumb->location(); 133 LayoutPoint thumbLocation = thumb->location();
134 if (isVertical) 134 if (isVertical)
135 thumbLocation.setY(thumbLocation.y() + track->contentHeight() - thumb->s ize().height() - offset); 135 thumbLocation.setY(thumbLocation.y() + track->contentHeight() - thumb->s ize().height() - offset);
136 else if (style()->isLeftToRightDirection()) 136 else if (style()->isLeftToRightDirection())
137 thumbLocation.setX(thumbLocation.x() + offset); 137 thumbLocation.setX(thumbLocation.x() + offset);
138 else 138 else
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/LayoutSlider.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698