Subpixel rendering: Pixelsnapping empty rounded rect results in NaN radii width/height.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jun 2014 21:19:17 +0000 (21:19 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jun 2014 21:19:17 +0000 (21:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133654

Reviewed by Simon Fraser.

Empty rounded rects don't need snapping.

Not testable.

* platform/graphics/RoundedRect.cpp:
(WebCore::RoundedRect::pixelSnappedRoundedRectForPainting):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169716 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/RoundedRect.cpp

index 2dc8488..b7e6871 100644 (file)
@@ -1,3 +1,17 @@
+2014-06-09  Zalan Bujtas  <zalan@apple.com>
+
+        Subpixel rendering: Pixelsnapping empty rounded rect results in NaN radii width/height.
+        https://bugs.webkit.org/show_bug.cgi?id=133654
+
+        Reviewed by Simon Fraser.
+
+        Empty rounded rects don't need snapping.
+
+        Not testable.
+
+        * platform/graphics/RoundedRect.cpp:
+        (WebCore::RoundedRect::pixelSnappedRoundedRectForPainting):
+
 2014-05-21  Myles C. Maxfield  <mmaxfield@apple.com>
 
         REGRESSION: missing underline under CJK text
index 0954108..d5e971e 100644 (file)
@@ -244,6 +244,9 @@ bool RoundedRect::intersectsQuad(const FloatQuad& quad) const
 FloatRoundedRect RoundedRect::pixelSnappedRoundedRectForPainting(float deviceScaleFactor) const
 {
     LayoutRect originalRect = rect();
+    if (originalRect.isEmpty())
+        return FloatRoundedRect(originalRect, radii());
+
     FloatRect pixelSnappedRect = pixelSnappedForPainting(originalRect, deviceScaleFactor);
     Radii adjustedRadii = radii();
     // Snapping usually does not alter size, but when it does, we need to make sure that the final rect is still renderable by distributing the size delta proportionally.