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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index 88a1e787f0d28afdeafb175d963182d4c0b6263a..1fa008d2edafece5ab3438349b1271b28052c32d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -664,8 +664,8 @@ LayoutUnit LayoutFlexibleBox::computeMainSizeFromAspectRatioUsing(const LayoutBo
const LayoutSize& childIntrinsicSize = child.intrinsicSize();
double ratio = childIntrinsicSize.width().toFloat() / childIntrinsicSize.height().toFloat();
if (isHorizontalFlow())
- return crossSize * ratio;
- return crossSize / ratio;
+ return LayoutUnit(crossSize * ratio);
+ return LayoutUnit(crossSize / ratio);
}
void LayoutFlexibleBox::setFlowAwareLocationForChild(LayoutBox& child, const LayoutPoint& location)
@@ -1099,7 +1099,7 @@ bool LayoutFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedF
double sumFlexFactors = (flexSign == PositiveFlexibility) ? totalFlexGrow : totalFlexShrink;
if (sumFlexFactors > 0 && sumFlexFactors < 1) {
- LayoutUnit fractional = availableFreeSpace * sumFlexFactors;
+ LayoutUnit fractional(availableFreeSpace * sumFlexFactors);
if (fractional.abs() < remainingFreeSpace.abs())
remainingFreeSpace = fractional;
}
@@ -1584,7 +1584,7 @@ void LayoutFlexibleBox::applyStretchAlignmentToChild(LayoutBox& child, LayoutUni
if (childNeedsRelayout || !child.hasOverrideLogicalContentHeight())
child.setOverrideLogicalContentHeight(desiredLogicalHeight - child.borderAndPaddingLogicalHeight());
if (childNeedsRelayout) {
- child.setLogicalHeight(0);
+ child.setLogicalHeight(LayoutUnit());
// We cache the child's intrinsic content logical height to avoid it being reset to the stretched height.
// FIXME: This is fragile. LayoutBoxes should be smart enough to determine their intrinsic content logical
// height correctly even when there's an overrideHeight.

Powered by Google App Engine
This is Rietveld 408576698