Title: [168221] trunk/Source/WebCore
Revision
168221
Author
za...@apple.com
Date
2014-05-03 00:47:38 -0700 (Sat, 03 May 2014)

Log Message

Subpixel rendering: Fieldset legend has a horizontal line through, when the fieldset is painted on odd device pixel position.
https://bugs.webkit.org/show_bug.cgi?id=132521
<rdar://problem/16803305>

Reviewed by Simon Fraser.

Use device pixel snapping when the fieldset's border gets clipped out for the legend's text. It ensures that
the device pixel snapped border gets properly clipped out.

Existing fieldset tests cover it.

* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::paintBoxDecorations):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (168220 => 168221)


--- trunk/Source/WebCore/ChangeLog	2014-05-03 04:09:37 UTC (rev 168220)
+++ trunk/Source/WebCore/ChangeLog	2014-05-03 07:47:38 UTC (rev 168221)
@@ -1,3 +1,19 @@
+2014-05-03  Zalan Bujtas  <za...@apple.com>
+
+        Subpixel rendering: Fieldset legend has a horizontal line through, when the fieldset is painted on odd device pixel position.
+        https://bugs.webkit.org/show_bug.cgi?id=132521
+        <rdar://problem/16803305>
+
+        Reviewed by Simon Fraser.
+
+        Use device pixel snapping when the fieldset's border gets clipped out for the legend's text. It ensures that
+        the device pixel snapped border gets properly clipped out.
+
+        Existing fieldset tests cover it.
+
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::paintBoxDecorations):
+
 2014-05-02  Zalan Bujtas  <za...@apple.com>
 
         CodeCleanup: Remove *MaintainsPixelAlignment from GraphicsLayer*.

Modified: trunk/Source/WebCore/rendering/RenderFieldset.cpp (168220 => 168221)


--- trunk/Source/WebCore/rendering/RenderFieldset.cpp	2014-05-03 04:09:37 UTC (rev 168220)
+++ trunk/Source/WebCore/rendering/RenderFieldset.cpp	2014-05-03 07:47:38 UTC (rev 168221)
@@ -174,15 +174,19 @@
     // FIXME: We need to work with "rl" and "bt" block flow directions.  In those
     // cases the legend is embedded in the right and bottom borders respectively.
     // https://bugs.webkit.org/show_bug.cgi?id=47236
+    LayoutRect clipRect;
     if (style().isHorizontalWritingMode()) {
-        LayoutUnit clipTop = paintRect.y();
-        LayoutUnit clipHeight = std::max<LayoutUnit>(style().borderTopWidth(), legend->height() - ((legend->height() - borderTop()) / 2));
-        graphicsContext->clipOut(pixelSnappedIntRect(paintRect.x() + legend->x(), clipTop, legend->width(), clipHeight));
+        clipRect.setX(paintRect.x() + legend->x());
+        clipRect.setY(paintRect.y());
+        clipRect.setWidth(legend->width());
+        clipRect.setHeight(std::max<LayoutUnit>(style().borderTopWidth(), legend->height() - ((legend->height() - borderTop()) / 2)));
     } else {
-        LayoutUnit clipLeft = paintRect.x();
-        LayoutUnit clipWidth = std::max<LayoutUnit>(style().borderLeftWidth(), legend->width());
-        graphicsContext->clipOut(pixelSnappedIntRect(clipLeft, paintRect.y() + legend->y(), clipWidth, legend->height()));
+        clipRect.setX(paintRect.x());
+        clipRect.setY(paintRect.y() + legend->y());
+        clipRect.setWidth(std::max<LayoutUnit>(style().borderLeftWidth(), legend->width()));
+        clipRect.setHeight(legend->height());
     }
+    graphicsContext->clipOut(pixelSnappedForPainting(clipRect, document().deviceScaleFactor()));
 
     paintBorder(paintInfo, paintRect, style());
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to