Title: [163262] trunk
Revision
163262
Author
za...@apple.com
Date
2014-02-02 08:15:20 -0800 (Sun, 02 Feb 2014)

Log Message

Subpixel rendering: Make BorderEdge/RoundedRect::Radii LayoutUnit aware.
https://bugs.webkit.org/show_bug.cgi?id=128036

Reviewed by Darin Adler.

Source/WebCore:

Covered by existing tests.

* platform/LayoutUnit.h:
(WebCore::LayoutUnit::operator++):
* rendering/RenderBoxModelObject.cpp:
(WebCore::BorderEdge::BorderEdge):
(WebCore::BorderEdge::usedWidth):
(WebCore::BorderEdge::getDoubleBorderStripeWidths):
(WebCore::RenderBoxModelObject::paintOneBorderSide):
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::drawBoxSideFromPath):
(WebCore::calculateSideRectIncludingInner):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::drawLineForBoxSide):
* rendering/RenderObject.h:
* rendering/style/BorderData.h:
(WebCore::BorderData::borderLeftWidth):
(WebCore::BorderData::borderRightWidth):
(WebCore::BorderData::borderTopWidth):
(WebCore::BorderData::borderBottomWidth):
* rendering/style/RenderStyle.cpp:
(WebCore::calcRadiiFor):
(WebCore::calcConstraintScaleFor):
(WebCore::RenderStyle::getRoundedInnerBorderFor):
* rendering/style/RenderStyle.h:

LayoutTests:

Bug 128061: Subpixel rendering: borders are reporting float values.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (163261 => 163262)


--- trunk/LayoutTests/ChangeLog	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/LayoutTests/ChangeLog	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1,3 +1,17 @@
+2014-02-02  Zalan Bujtas  <za...@apple.com>
+
+        Subpixel rendering: Make BorderEdge/RoundedRect::Radii LayoutUnit aware.
+        https://bugs.webkit.org/show_bug.cgi?id=128036
+
+        Reviewed by Darin Adler.
+
+        Bug 128061: Subpixel rendering: borders are reporting float values.
+
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/win/TestExpectations:
+
 2014-02-01  Alexey Proskuryakov  <a...@apple.com>
 
         Update WebCrypto JWK mapping to use key_ops

Modified: trunk/LayoutTests/platform/efl/TestExpectations (163261 => 163262)


--- trunk/LayoutTests/platform/efl/TestExpectations	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1806,3 +1806,25 @@
 webkit.org/b/127725 media/video-restricted-no-preload-auto.html [ Failure ]
 
 webkit.org/b/127731 plugins/embed-prefers-plugins-for-images.html [ Failure ]
+
+# Subpixel rendering: borders are reporting float values.
+webkit.org/b/128061 css1/units/length_units.html [ Failure ]
+webkit.org/b/128061 fast/css/bidi-override-in-anonymous-block.html [ Failure ]
+webkit.org/b/128061 fast/multicol/span/anonymous-style-inheritance.html [ Failure ]
+webkit.org/b/128061 fast/repaint/repaint-during-scroll-with-zoom.html [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-initial-value-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-002.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-004.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-top-left-radius-values-003.htm [ Failure ]
+webkit.org/b/128061 media/video-zoom.html [ Failure ]
+webkit.org/b/128061 svg/custom/svg-fonts-in-html.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-image-tiled.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-images.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-float-border-padding.xml [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-through-object-with-auto-size.html [ Failure ]
+webkit.org/b/128061 tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ]
+# End of subpixel failures.

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (163261 => 163262)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1535,6 +1535,28 @@
 
 webkit.org/b/127740 accessibility/range-alter-by-percent.html [ Failure ]
 
+# Subpixel rendering: borders are reporting float values.
+webkit.org/b/128061 css1/units/length_units.html [ Failure ]
+webkit.org/b/128061 fast/css/bidi-override-in-anonymous-block.html [ Failure ]
+webkit.org/b/128061 fast/multicol/span/anonymous-style-inheritance.html [ Failure ]
+webkit.org/b/128061 fast/repaint/repaint-during-scroll-with-zoom.html [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-initial-value-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-002.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-004.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-top-left-radius-values-003.htm [ Failure ]
+webkit.org/b/128061 media/video-zoom.html [ Failure ]
+webkit.org/b/128061 svg/custom/svg-fonts-in-html.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-image-tiled.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-images.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-float-border-padding.xml [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-through-object-with-auto-size.html [ Failure ]
+webkit.org/b/128061 tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ]
+# End of subpixel failures.
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of Tests failing
 #////////////////////////////////////////////////////////////////////////////////////////

Modified: trunk/LayoutTests/platform/mac/TestExpectations (163261 => 163262)


--- trunk/LayoutTests/platform/mac/TestExpectations	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1320,6 +1320,28 @@
 # Subpixel: misplaced zoomed svg content.
 webkit.org/b/126900 svg/zoom/page/zoom-zoom-coords.xhtml [ Failure ]
 
+# Subpixel rendering: borders are reporting float values.
+webkit.org/b/128061 css1/units/length_units.html [ Failure ]
+webkit.org/b/128061 fast/css/bidi-override-in-anonymous-block.html [ Failure ]
+webkit.org/b/128061 fast/multicol/span/anonymous-style-inheritance.html [ Failure ]
+webkit.org/b/128061 fast/repaint/repaint-during-scroll-with-zoom.html [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-initial-value-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-002.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-004.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-top-left-radius-values-003.htm [ Failure ]
+webkit.org/b/128061 media/video-zoom.html [ Failure ]
+webkit.org/b/128061 svg/custom/svg-fonts-in-html.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-image-tiled.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-images.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-float-border-padding.xml [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-through-object-with-auto-size.html [ Failure ]
+webkit.org/b/128061 tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ]
+# End of subpixel failures.
+
 webkit.org/b/35297 media/video-display-aspect-ratio.html [ Pass Failure ]
 
 webkit.org/b/127310 svg/filters/feComponentTransfer-style-crash.xhtml [ Pass Failure Timeout ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (163261 => 163262)


--- trunk/LayoutTests/platform/win/TestExpectations	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/LayoutTests/platform/win/TestExpectations	2014-02-02 16:15:20 UTC (rev 163262)
@@ -2880,3 +2880,25 @@
 
 # REGRESSION (r159892): Failing _javascript_ test
 webkit.org/b/127492 js/dom/date-big-constructor.html [ Failure ]
+
+# Subpixel rendering: borders are reporting float values.
+webkit.org/b/128061 css1/units/length_units.html [ Failure ]
+webkit.org/b/128061 fast/css/bidi-override-in-anonymous-block.html [ Failure ]
+webkit.org/b/128061 fast/multicol/span/anonymous-style-inheritance.html [ Failure ]
+webkit.org/b/128061 fast/repaint/repaint-during-scroll-with-zoom.html [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-initial-value-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-002.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-style-004.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001.htm [ Failure ]
+webkit.org/b/128061 ietestcenter/css3/bordersbackgrounds/border-top-left-radius-values-003.htm [ Failure ]
+webkit.org/b/128061 media/video-zoom.html [ Failure ]
+webkit.org/b/128061 svg/custom/svg-fonts-in-html.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-image-tiled.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-background-images.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-float-border-padding.xml [ Failure ]
+webkit.org/b/128061 svg/zoom/page/zoom-svg-through-object-with-auto-size.html [ Failure ]
+webkit.org/b/128061 tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ]
+# End of subpixel failures.

Modified: trunk/Source/WebCore/ChangeLog (163261 => 163262)


--- trunk/Source/WebCore/ChangeLog	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/Source/WebCore/ChangeLog	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1,3 +1,36 @@
+2014-02-02  Zalan Bujtas  <za...@apple.com>
+
+        Subpixel rendering: Make BorderEdge/RoundedRect::Radii LayoutUnit aware.
+        https://bugs.webkit.org/show_bug.cgi?id=128036
+
+        Reviewed by Darin Adler.
+
+        Covered by existing tests.
+
+        * platform/LayoutUnit.h:
+        (WebCore::LayoutUnit::operator++):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::BorderEdge::BorderEdge):
+        (WebCore::BorderEdge::usedWidth):
+        (WebCore::BorderEdge::getDoubleBorderStripeWidths):
+        (WebCore::RenderBoxModelObject::paintOneBorderSide):
+        (WebCore::RenderBoxModelObject::paintBorder):
+        (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
+        (WebCore::calculateSideRectIncludingInner):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::drawLineForBoxSide):
+        * rendering/RenderObject.h:
+        * rendering/style/BorderData.h:
+        (WebCore::BorderData::borderLeftWidth):
+        (WebCore::BorderData::borderRightWidth):
+        (WebCore::BorderData::borderTopWidth):
+        (WebCore::BorderData::borderBottomWidth):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::calcRadiiFor):
+        (WebCore::calcConstraintScaleFor):
+        (WebCore::RenderStyle::getRoundedInnerBorderFor):
+        * rendering/style/RenderStyle.h:
+
 2014-02-01  Hunseop Jeong  <hs85.je...@samsung.com>
 
         REGRESSION(r163234) Debug build is broken

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (163261 => 163262)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1396,7 +1396,7 @@
 
 class BorderEdge {
 public:
-    BorderEdge(int edgeWidth, const Color& edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent = true)
+    BorderEdge(LayoutUnit edgeWidth, const Color& edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent = true)
         : width(edgeWidth)
         , color(edgeColor)
         , style(edgeStyle)
@@ -1442,9 +1442,9 @@
         return true;
     }
 
-    int usedWidth() const { return isPresent ? width : 0; }
+    LayoutUnit usedWidth() const { return isPresent ? width : LayoutUnit::fromPixel(0); }
     
-    void getDoubleBorderStripeWidths(int& outerWidth, int& innerWidth) const
+    void getDoubleBorderStripeWidths(LayoutUnit& outerWidth, LayoutUnit& innerWidth) const
     {
         int fullWidth = usedWidth();
         outerWidth = fullWidth / 3;
@@ -1458,7 +1458,7 @@
             innerWidth += 1;
     }
     
-    int width;
+    LayoutUnit width;
     Color color;
     EBorderStyle style;
     bool isTransparent;
@@ -1692,7 +1692,7 @@
         }
         
         drawLineForBoxSide(graphicsContext, sideRect.x(), sideRect.y(), sideRect.maxX(), sideRect.maxY(), side, colorToPaint, edgeToRender.style,
-                mitreAdjacentSide1 ? adjacentEdge1.width : 0, mitreAdjacentSide2 ? adjacentEdge2.width : 0, antialias);
+            mitreAdjacentSide1 ? adjacentEdge1.width : LayoutUnit::fromPixel(0), mitreAdjacentSide2 ? adjacentEdge2.width : LayoutUnit::fromPixel(0), antialias);
     }
 }
 
@@ -1881,8 +1881,8 @@
                 LayoutRect innerThirdRect = outerBorder.rect();
                 LayoutRect outerThirdRect = outerBorder.rect();
                 for (int side = BSTop; side <= BSLeft; ++side) {
-                    int outerWidth;
-                    int innerWidth;
+                    LayoutUnit outerWidth;
+                    LayoutUnit innerWidth;
                     edges[side].getDoubleBorderStripeWidths(outerWidth, innerWidth);
 
                     if (side == BSTop) {
@@ -2024,20 +2024,20 @@
     }
     case DOUBLE: {
         // Get the inner border rects for both the outer border line and the inner border line
-        int outerBorderTopWidth;
-        int innerBorderTopWidth;
+        LayoutUnit outerBorderTopWidth;
+        LayoutUnit innerBorderTopWidth;
         edges[BSTop].getDoubleBorderStripeWidths(outerBorderTopWidth, innerBorderTopWidth);
 
-        int outerBorderRightWidth;
-        int innerBorderRightWidth;
+        LayoutUnit outerBorderRightWidth;
+        LayoutUnit innerBorderRightWidth;
         edges[BSRight].getDoubleBorderStripeWidths(outerBorderRightWidth, innerBorderRightWidth);
 
-        int outerBorderBottomWidth;
-        int innerBorderBottomWidth;
+        LayoutUnit outerBorderBottomWidth;
+        LayoutUnit innerBorderBottomWidth;
         edges[BSBottom].getDoubleBorderStripeWidths(outerBorderBottomWidth, innerBorderBottomWidth);
 
-        int outerBorderLeftWidth;
-        int innerBorderLeftWidth;
+        LayoutUnit outerBorderLeftWidth;
+        LayoutUnit innerBorderLeftWidth;
         edges[BSLeft].getDoubleBorderStripeWidths(outerBorderLeftWidth, innerBorderLeftWidth);
 
         // Draw inner border line
@@ -2239,7 +2239,7 @@
 static LayoutRect calculateSideRectIncludingInner(const RoundedRect& outerBorder, const BorderEdge edges[], BoxSide side)
 {
     LayoutRect sideRect = outerBorder.rect();
-    int width;
+    LayoutUnit width;
 
     switch (side) {
     case BSTop:

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (163261 => 163262)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2014-02-02 16:15:20 UTC (rev 163262)
@@ -736,11 +736,11 @@
     return toRenderBlock(o);
 }
 
-void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, int x1, int y1, int x2, int y2,
+void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, LayoutUnit x1, LayoutUnit y1, LayoutUnit x2, LayoutUnit y2,
     BoxSide side, Color color, EBorderStyle borderStyle, int adjacentWidth1, int adjacentWidth2, bool antialias)
 {
-    int thickness;
-    int length;
+    float thickness;
+    float length;
     if (side == BSTop || side == BSBottom) {
         thickness = y2 - y1;
         length = x2 - x1;

Modified: trunk/Source/WebCore/rendering/RenderObject.h (163261 => 163262)


--- trunk/Source/WebCore/rendering/RenderObject.h	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2014-02-02 16:15:20 UTC (rev 163262)
@@ -882,7 +882,7 @@
 
     RespectImageOrientationEnum shouldRespectImageOrientation() const;
 
-    void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
+    void drawLineForBoxSide(GraphicsContext*, LayoutUnit x1, LayoutUnit y1, LayoutUnit x2, LayoutUnit y2, BoxSide,
                             Color, EBorderStyle, int adjbw1, int adjbw2, bool antialias = false);
 protected:
     int columnNumberForOffset(int offset);

Modified: trunk/Source/WebCore/rendering/style/BorderData.h (163261 => 163262)


--- trunk/Source/WebCore/rendering/style/BorderData.h	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/Source/WebCore/rendering/style/BorderData.h	2014-02-02 16:15:20 UTC (rev 163262)
@@ -60,28 +60,28 @@
         return false;
     }
     
-    unsigned borderLeftWidth() const
+    float borderLeftWidth() const
     {
         if (!m_image.hasImage() && (m_left.style() == BNONE || m_left.style() == BHIDDEN))
             return 0; 
         return m_left.width();
     }
     
-    unsigned borderRightWidth() const
+    float borderRightWidth() const
     {
         if (!m_image.hasImage() && (m_right.style() == BNONE || m_right.style() == BHIDDEN))
             return 0;
         return m_right.width();
     }
     
-    unsigned borderTopWidth() const
+    float borderTopWidth() const
     {
         if (!m_image.hasImage() && (m_top.style() == BNONE || m_top.style() == BHIDDEN))
             return 0;
         return m_top.width();
     }
     
-    unsigned borderBottomWidth() const
+    float borderBottomWidth() const
     {
         if (!m_image.hasImage() && (m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN))
             return 0;

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (163261 => 163262)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1068,46 +1068,46 @@
     rareData->m_boxShadow = shadowData;
 }
 
-static RoundedRect::Radii calcRadiiFor(const BorderData& border, IntSize size, RenderView* renderView)
+static RoundedRect::Radii calcRadiiFor(const BorderData& border, const LayoutSize& size, RenderView* renderView)
 {
     return RoundedRect::Radii(
-        IntSize(valueForLength(border.topLeft().width(), size.width(), renderView), 
-                valueForLength(border.topLeft().height(), size.height(), renderView)),
-        IntSize(valueForLength(border.topRight().width(), size.width(), renderView),
-                valueForLength(border.topRight().height(), size.height(), renderView)),
-        IntSize(valueForLength(border.bottomLeft().width(), size.width(), renderView), 
-                valueForLength(border.bottomLeft().height(), size.height(), renderView)),
-        IntSize(valueForLength(border.bottomRight().width(), size.width(), renderView), 
-                valueForLength(border.bottomRight().height(), size.height(), renderView)));
+        LayoutSize(valueForLength(border.topLeft().width(), size.width(), renderView),
+            valueForLength(border.topLeft().height(), size.height(), renderView)),
+        LayoutSize(valueForLength(border.topRight().width(), size.width(), renderView),
+            valueForLength(border.topRight().height(), size.height(), renderView)),
+        LayoutSize(valueForLength(border.bottomLeft().width(), size.width(), renderView),
+            valueForLength(border.bottomLeft().height(), size.height(), renderView)),
+        LayoutSize(valueForLength(border.bottomRight().width(), size.width(), renderView),
+            valueForLength(border.bottomRight().height(), size.height(), renderView)));
 }
 
-static float calcConstraintScaleFor(const IntRect& rect, const RoundedRect::Radii& radii)
+static float calcConstraintScaleFor(const LayoutRect& rect, const RoundedRect::Radii& radii)
 {
     // Constrain corner radii using CSS3 rules:
     // http://www.w3.org/TR/css3-background/#the-border-radius
     
     float factor = 1;
-    unsigned radiiSum;
+    float radiiSum;
 
     // top
-    radiiSum = static_cast<unsigned>(radii.topLeft().width()) + static_cast<unsigned>(radii.topRight().width()); // Casts to avoid integer overflow.
-    if (radiiSum > static_cast<unsigned>(rect.width()))
-        factor = std::min(static_cast<float>(rect.width()) / radiiSum, factor);
+    radiiSum = radii.topLeft().width() + radii.topRight().width(); // Casts to avoid integer overflow.
+    if (radiiSum > rect.width())
+        factor = std::min(rect.width() / radiiSum, factor);
 
     // bottom
-    radiiSum = static_cast<unsigned>(radii.bottomLeft().width()) + static_cast<unsigned>(radii.bottomRight().width());
-    if (radiiSum > static_cast<unsigned>(rect.width()))
-        factor = std::min(static_cast<float>(rect.width()) / radiiSum, factor);
+    radiiSum = radii.bottomLeft().width() + radii.bottomRight().width();
+    if (radiiSum > rect.width())
+        factor = std::min(rect.width() / radiiSum, factor);
     
     // left
-    radiiSum = static_cast<unsigned>(radii.topLeft().height()) + static_cast<unsigned>(radii.bottomLeft().height());
-    if (radiiSum > static_cast<unsigned>(rect.height()))
-        factor = std::min(static_cast<float>(rect.height()) / radiiSum, factor);
+    radiiSum = radii.topLeft().height() + radii.bottomLeft().height();
+    if (radiiSum > rect.height())
+        factor = std::min(rect.height() / radiiSum, factor);
     
     // right
-    radiiSum = static_cast<unsigned>(radii.topRight().height()) + static_cast<unsigned>(radii.bottomRight().height());
-    if (radiiSum > static_cast<unsigned>(rect.height()))
-        factor = std::min(static_cast<float>(rect.height()) / radiiSum, factor);
+    radiiSum = radii.topRight().height() + radii.bottomRight().height();
+    if (radiiSum > rect.height())
+        factor = std::min(rect.height() / radiiSum, factor);
     
     ASSERT(factor <= 1);
     return factor;
@@ -1146,16 +1146,16 @@
 {
     bool horizontal = isHorizontalWritingMode();
 
-    int leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
-    int rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
-    int topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
-    int bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
+    LayoutUnit leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
+    LayoutUnit rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
+    LayoutUnit topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
+    LayoutUnit bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
 
     return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge);
 }
 
-RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
-    int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
+RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, LayoutUnit topWidth, LayoutUnit bottomWidth,
+    LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
 {
     LayoutRect innerRect(borderRect.x() + leftWidth, 
                borderRect.y() + topWidth, 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (163261 => 163262)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2014-02-02 08:02:27 UTC (rev 163261)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2014-02-02 16:15:20 UTC (rev 163262)
@@ -1088,8 +1088,8 @@
     RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, RenderView* = 0, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
     RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
 
-    RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,
-        int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
+    RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, LayoutUnit topWidth, LayoutUnit bottomWidth,
+        LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
 
     void setBorderLeftWidth(float v) { SET_VAR(surround, border.m_left.m_width, v); }
     void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v); }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to