Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (173133 => 173134)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2014-08-30 01:33:24 UTC (rev 173133)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2014-08-30 02:55:02 UTC (rev 173134)
@@ -2897,9 +2897,9 @@
}
}
-static inline void updatePreferredWidth(LayoutUnit& preferredWidth, float& result)
+static inline LayoutUnit preferredWidth(LayoutUnit preferredWidth, float result)
{
- preferredWidth = std::max(LayoutUnit::fromFloatCeil(result), preferredWidth);
+ return std::max(preferredWidth, LayoutUnit::fromFloatCeil(result));
}
void RenderBlock::computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth)
@@ -2981,7 +2981,7 @@
if (!child->isText()) {
if (child->isLineBreakOpportunity()) {
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
inlineMin = 0;
continue;
}
@@ -3029,13 +3029,13 @@
bool canBreakReplacedElement = !child->isImage() || allowImagesToBreak;
if ((canBreakReplacedElement && (autoWrap || oldAutoWrap) && (!isPrevChildInlineFlow || shouldBreakLineAfterText)) || clearPreviousFloat) {
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
inlineMin = 0;
}
// If we're supposed to clear the previous float, then terminate maxwidth as well.
if (clearPreviousFloat) {
- updatePreferredWidth(maxLogicalWidth, inlineMax);
+ maxLogicalWidth = preferredWidth(maxLogicalWidth, inlineMax);
inlineMax = 0;
}
@@ -3056,19 +3056,19 @@
if (!autoWrap || !canBreakReplacedElement || (isPrevChildInlineFlow && !shouldBreakLineAfterText)) {
if (child->isFloating())
- updatePreferredWidth(minLogicalWidth, childMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, childMin);
else
inlineMin += childMin;
} else {
// Now check our line.
- updatePreferredWidth(minLogicalWidth, childMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, childMin);
// Now start a new line.
inlineMin = 0;
}
if (autoWrap && canBreakReplacedElement && isPrevChildInlineFlow) {
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
inlineMin = 0;
}
@@ -3101,7 +3101,7 @@
// This text object will not be rendered, but it may still provide a breaking opportunity.
if (!hasBreak && childMax == 0) {
if (autoWrap && (beginWS || endWS)) {
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
inlineMin = 0;
}
continue;
@@ -3144,10 +3144,10 @@
// we start and end with whitespace.
if (beginWS)
// Go ahead and end the current line.
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
else {
inlineMin += beginMin;
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
childMin -= ti;
}
@@ -3156,11 +3156,11 @@
if (endWS) {
// We end in whitespace, which means we can go ahead
// and end our current line.
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
inlineMin = 0;
shouldBreakLineAfterText = false;
} else {
- updatePreferredWidth(minLogicalWidth, inlineMin);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
inlineMin = endMin;
shouldBreakLineAfterText = true;
}
@@ -3168,8 +3168,8 @@
if (hasBreak) {
inlineMax += beginMax;
- updatePreferredWidth(maxLogicalWidth, inlineMax);
- updatePreferredWidth(maxLogicalWidth, childMax);
+ maxLogicalWidth = preferredWidth(maxLogicalWidth, inlineMax);
+ maxLogicalWidth = preferredWidth(maxLogicalWidth, childMax);
inlineMax = endMax;
addedTextIndent = true;
} else
@@ -3180,8 +3180,8 @@
if (child->isListMarker())
stripFrontSpaces = true;
} else {
- updatePreferredWidth(minLogicalWidth, inlineMin);
- updatePreferredWidth(maxLogicalWidth, inlineMax);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
+ maxLogicalWidth = preferredWidth(maxLogicalWidth, inlineMax);
inlineMin = inlineMax = 0;
stripFrontSpaces = true;
trailingSpaceChild = 0;
@@ -3199,8 +3199,8 @@
if (styleToUse.collapseWhiteSpace())
stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild);
- updatePreferredWidth(minLogicalWidth, inlineMin);
- updatePreferredWidth(maxLogicalWidth, inlineMax);
+ minLogicalWidth = preferredWidth(minLogicalWidth, inlineMin);
+ maxLogicalWidth = preferredWidth(maxLogicalWidth, inlineMax);
}
void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const