Title: [113594] trunk/Source/WebCore
Revision
113594
Author
[email protected]
Date
2012-04-09 11:09:57 -0700 (Mon, 09 Apr 2012)

Log Message

Correct LayoutUnit usage in style functions getRoundedBorderFor
https://bugs.webkit.org/show_bug.cgi?id=83154

Reviewed by Julien Chaffraix.

Correcting LayoutUnit usage in getRoundedBorderFor and the calcRadiiFor helper function.

No new tests. No change in behavior.

* rendering/style/RenderStyle.cpp:
(WebCore::calcRadiiFor): This is a static internal function that returns the radii based on a size.
It's only called from getRoundedBorderFor, so we're now pixel snapping the size before handing it
to this function.
(WebCore::RenderStyle::getRoundedBorderFor): Takes a LayoutRect and returns the pixel-snapped
resulting RoundedRect. Using a local IntRect to avoid snapping twice.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (113593 => 113594)


--- trunk/Source/WebCore/ChangeLog	2012-04-09 18:00:11 UTC (rev 113593)
+++ trunk/Source/WebCore/ChangeLog	2012-04-09 18:09:57 UTC (rev 113594)
@@ -1,3 +1,21 @@
+2012-04-09  Levi Weintraub  <[email protected]>
+
+        Correct LayoutUnit usage in style functions getRoundedBorderFor
+        https://bugs.webkit.org/show_bug.cgi?id=83154
+
+        Reviewed by Julien Chaffraix.
+
+        Correcting LayoutUnit usage in getRoundedBorderFor and the calcRadiiFor helper function.
+
+        No new tests. No change in behavior.
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::calcRadiiFor): This is a static internal function that returns the radii based on a size.
+        It's only called from getRoundedBorderFor, so we're now pixel snapping the size before handing it
+        to this function.
+        (WebCore::RenderStyle::getRoundedBorderFor): Takes a LayoutRect and returns the pixel-snapped
+        resulting RoundedRect. Using a local IntRect to avoid snapping twice.
+
 2012-04-06  Andrey Kosyakov  <[email protected]>
 
         Web Inspector: zoom on vertical mousewheel in Timeline overview

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (113593 => 113594)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-04-09 18:00:11 UTC (rev 113593)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-04-09 18:09:57 UTC (rev 113594)
@@ -880,7 +880,7 @@
     rareData->m_boxShadow = shadowData;
 }
 
-static RoundedRect::Radii calcRadiiFor(const BorderData& border, LayoutSize size, RenderView* renderView)
+static RoundedRect::Radii calcRadiiFor(const BorderData& border, IntSize size, RenderView* renderView)
 {
     return RoundedRect::Radii(
         IntSize(valueForLength(border.topLeft().width(), size.width(), renderView), 
@@ -927,10 +927,11 @@
 
 RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, RenderView* renderView, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
 {
-    RoundedRect roundedRect(pixelSnappedIntRect(borderRect));
+    IntRect snappedBorderRect(pixelSnappedIntRect(borderRect));
+    RoundedRect roundedRect(snappedBorderRect);
     if (hasBorderRadius()) {
         RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size(), renderView);
-        radii.scale(calcConstraintScaleFor(pixelSnappedIntRect(borderRect), radii));
+        radii.scale(calcConstraintScaleFor(snappedBorderRect, radii));
         roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
     }
     return roundedRect;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to