Title: [112936] trunk/Source/WebCore
Revision
112936
Author
[email protected]
Date
2012-04-02 14:00:08 -0700 (Mon, 02 Apr 2012)

Log Message

Correct remaining LayoutUnit misuse in RenderReplaced and RenderFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=82899

Reviewed by Darin Adler.

Removing remaining LayoutUnit misuse and compiler errors that exist in RenderReplaced
and RenderFlexibleBox once LayoutUnit becomes sub-pixel.

No new tests. No change in behavior.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Switching
a raw zero in a ternary operation to zeroLayoutUnit.
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Ditto for std::max.
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint): Adding missing pixel snapping before painting.
(WebCore::RenderReplaced::computeReplacedLogicalWidth): Like above, switching
a raw zero to zeroLayoutUnit.
(WebCore::RenderReplaced::computePreferredLogicalWidths): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112935 => 112936)


--- trunk/Source/WebCore/ChangeLog	2012-04-02 20:58:10 UTC (rev 112935)
+++ trunk/Source/WebCore/ChangeLog	2012-04-02 21:00:08 UTC (rev 112936)
@@ -1,3 +1,25 @@
+2012-04-02  Levi Weintraub  <[email protected]>
+
+        Correct remaining LayoutUnit misuse in RenderReplaced and RenderFlexibleBox
+        https://bugs.webkit.org/show_bug.cgi?id=82899
+
+        Reviewed by Darin Adler.
+
+        Removing remaining LayoutUnit misuse and compiler errors that exist in RenderReplaced
+        and RenderFlexibleBox once LayoutUnit becomes sub-pixel.
+
+        No new tests. No change in behavior.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Switching
+        a raw zero in a ternary operation to zeroLayoutUnit.
+        (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Ditto for std::max.
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint): Adding missing pixel snapping before painting.
+        (WebCore::RenderReplaced::computeReplacedLogicalWidth): Like above, switching
+        a raw zero to zeroLayoutUnit.
+        (WebCore::RenderReplaced::computePreferredLogicalWidths): Ditto.
+
 2012-04-02  Ken Buchanan  <[email protected]>
 
         Crash due to floating object lists not properly being cleared

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (112935 => 112936)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-04-02 20:58:10 UTC (rev 112935)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-04-02 21:00:08 UTC (rev 112936)
@@ -296,7 +296,7 @@
 
 void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(FlexOrderIterator& iterator, WTF::Vector<LineContext>& lineContexts, LayoutUnit& oldClientAfterEdge)
 {
-    LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? 0 : lineContexts[0].crossAxisOffset;
+    LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? zeroLayoutUnit : lineContexts[0].crossAxisOffset;
     packFlexLines(iterator, lineContexts);
 
     // If we have a single line flexbox, the line height is all the available space.
@@ -1120,7 +1120,7 @@
     } else if (isColumnFlow() && child->style()->logicalWidth().isAuto() && isMultiline()) {
         // FIXME: Handle min-width and max-width.
         LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child);
-        child->setOverrideWidth(std::max(0, childWidth));
+        child->setOverrideWidth(std::max(zeroLayoutUnit, childWidth));
         child->setChildNeedsLayout(true);
         child->layoutIfNeeded();
     }

Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (112935 => 112936)


--- trunk/Source/WebCore/rendering/RenderReplaced.cpp	2012-04-02 20:58:10 UTC (rev 112935)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp	2012-04-02 21:00:08 UTC (rev 112936)
@@ -161,7 +161,7 @@
     if (drawSelectionTint) {
         LayoutRect selectionPaintingRect = localSelectionRect();
         selectionPaintingRect.moveBy(adjustedPaintOffset);
-        paintInfo.context->fillRect(selectionPaintingRect, selectionBackgroundColor(), style()->colorSpace());
+        paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor(), style()->colorSpace());
     }
 }
 
@@ -360,7 +360,7 @@
                 // This solves above equation for 'width' (== logicalWidth).
                 LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), logicalWidth);
                 LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), logicalWidth);
-                logicalWidth = max(0, logicalWidth - (marginStart + marginEnd + (width() - clientWidth())));
+                logicalWidth = max(zeroLayoutUnit, logicalWidth - (marginStart + marginEnd + (width() - clientWidth())));
                 if (isPercentageIntrinsicSize)
                     logicalWidth = roundToInt(logicalWidth * intrinsicSize.width() / 100);
                 return computeReplacedLogicalWidthRespectingMinMaxWidth(logicalWidth, includeMaxWidth);
@@ -425,7 +425,7 @@
     m_maxPreferredLogicalWidth = computeReplacedLogicalWidth(false) + borderAndPadding;
 
     if (style()->maxWidth().isFixed())
-        m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : zeroLayoutUnit));
+        m_maxPreferredLogicalWidth = min<LayoutUnit>(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : zeroLayoutUnit));
 
     if (hasRelativeDimensions())
         m_minPreferredLogicalWidth = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to