Title: [209277] trunk/Source/WebCore
Revision
209277
Author
[email protected]
Date
2016-12-02 15:05:48 -0800 (Fri, 02 Dec 2016)

Log Message

Remove redundant LayoutUnit conversions.
https://bugs.webkit.org/show_bug.cgi?id=165338

Reviewed by Simon Fraser.

RenderBlockFlow::computeColumnCountAndWidth has some redundant LayoutUnti <-> unsigned conversions.

No change in functionality.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeColumnCountAndWidth):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209276 => 209277)


--- trunk/Source/WebCore/ChangeLog	2016-12-02 23:01:21 UTC (rev 209276)
+++ trunk/Source/WebCore/ChangeLog	2016-12-02 23:05:48 UTC (rev 209277)
@@ -1,3 +1,17 @@
+2016-12-02  Zalan Bujtas  <[email protected]>
+
+        Remove redundant LayoutUnit conversions.
+        https://bugs.webkit.org/show_bug.cgi?id=165338
+
+        Reviewed by Simon Fraser.
+
+        RenderBlockFlow::computeColumnCountAndWidth has some redundant LayoutUnti <-> unsigned conversions.
+
+        No change in functionality.
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::computeColumnCountAndWidth):
+
 2016-12-02  Antoine Quint  <[email protected]>
 
         [Modern Media Controls] Add rewind and fast-forward support

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (209276 => 209277)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2016-12-02 23:01:21 UTC (rev 209276)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2016-12-02 23:05:48 UTC (rev 209277)
@@ -403,16 +403,16 @@
     // FIXME: Can overflow on fast/block/float/float-not-removed-from-next-sibling4.html, see https://bugs.webkit.org/show_bug.cgi?id=68744
     unsigned desiredColumnCount = 1;
     LayoutUnit desiredColumnWidth = contentLogicalWidth();
-    
+
     // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination.
     if (document().paginated() || (style().hasAutoColumnCount() && style().hasAutoColumnWidth()) || !style().hasInlineColumnAxis()) {
         setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
         return;
     }
-        
+
     LayoutUnit availWidth = desiredColumnWidth;
     LayoutUnit colGap = columnGap();
-    LayoutUnit colWidth = std::max<LayoutUnit>(LayoutUnit::fromPixel(1), LayoutUnit(style().columnWidth()));
+    LayoutUnit colWidth = std::max<LayoutUnit>(1, style().columnWidth());
     unsigned colCount = std::max<unsigned>(1, style().columnCount());
 
     if (style().hasAutoColumnWidth() && !style().hasAutoColumnCount()) {
@@ -419,10 +419,10 @@
         desiredColumnCount = colCount;
         desiredColumnWidth = std::max<LayoutUnit>(0, (availWidth - ((desiredColumnCount - 1) * colGap)) / desiredColumnCount);
     } else if (!style().hasAutoColumnWidth() && style().hasAutoColumnCount()) {
-        desiredColumnCount = std::max<LayoutUnit>(1, (availWidth + colGap) / (colWidth + colGap)).toUnsigned();
+        desiredColumnCount = std::max<unsigned>(1, ((availWidth + colGap) / (colWidth + colGap)).toUnsigned());
         desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
     } else {
-        desiredColumnCount = std::max<LayoutUnit>(std::min<LayoutUnit>(colCount, (availWidth + colGap) / (colWidth + colGap)), 1).toUnsigned();
+        desiredColumnCount = std::max<unsigned>(std::min(colCount, ((availWidth + colGap) / (colWidth + colGap)).toUnsigned()), 1);
         desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
     }
     setComputedColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to