Title: [173134] trunk/Source/WebCore
Revision
173134
Author
[email protected]
Date
2014-08-29 19:55:02 -0700 (Fri, 29 Aug 2014)

Log Message

Rename updatePreferredWidth to make it more explicit.
https://bugs.webkit.org/show_bug.cgi?id=136389

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::preferredWidth):
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
(WebCore::updatePreferredWidth): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (173133 => 173134)


--- trunk/Source/WebCore/ChangeLog	2014-08-30 01:33:24 UTC (rev 173133)
+++ trunk/Source/WebCore/ChangeLog	2014-08-30 02:55:02 UTC (rev 173134)
@@ -1,3 +1,17 @@
+2014-08-29  Zalan Bujtas  <[email protected]>
+
+        Rename updatePreferredWidth to make it more explicit.
+        https://bugs.webkit.org/show_bug.cgi?id=136389
+
+        Reviewed by Simon Fraser.
+
+        No change in functionality.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::preferredWidth):
+        (WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
+        (WebCore::updatePreferredWidth): Deleted.
+
 2014-08-29  Gavin Barraclough  <[email protected]>
 
         Make timerNestingLevel threadsafe

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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to