Title: [169862] trunk
Revision
169862
Author
[email protected]
Date
2014-06-11 17:14:21 -0700 (Wed, 11 Jun 2014)

Log Message

Subpixel rendering: RenderBox's content clipping should clip on device pixel boundary.
https://bugs.webkit.org/show_bug.cgi?id=133767
<rdar://problem/17272365>

Reviewed by Simon Fraser.

Push RenderBox's content clipping to device pixel boundaries. Integral snapping makes
content cut off prematurely.

Source/WebCore:
Test: fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::pushContentsClip):

LayoutTests:
* fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden-expected.html: Added.
* fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (169861 => 169862)


--- trunk/LayoutTests/ChangeLog	2014-06-11 23:57:39 UTC (rev 169861)
+++ trunk/LayoutTests/ChangeLog	2014-06-12 00:14:21 UTC (rev 169862)
@@ -1,3 +1,17 @@
+2014-06-11  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: RenderBox's content clipping should clip on device pixel boundary.
+        https://bugs.webkit.org/show_bug.cgi?id=133767
+        <rdar://problem/17272365>
+
+        Reviewed by Simon Fraser.
+
+        Push RenderBox's content clipping to device pixel boundaries. Integral snapping makes
+        content cut off prematurely.
+
+        * fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden-expected.html: Added.
+        * fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html: Added.
+
 2014-06-11  David Kilzer  <[email protected]>
 
         WindowFeatures arguments shoud ignore invalid characters in values

Added: trunk/LayoutTests/fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden-expected.html (0 => 169862)


--- trunk/LayoutTests/fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden-expected.html	2014-06-12 00:14:21 UTC (rev 169862)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<head>
+<title>This tests that text with subpixel margin-top value does not get cut off prematurely.</title>
+<style>
+  .outer {
+    display: inline-block;
+    font-family: '.LucidaGrandeUI';
+    margin-top: 0.5px;
+  }
+
+  .inner {
+    overflow: hidden;
+  }
+</style>
+</head>
+<body>
+  <div class=outer>
+    <div class=inner>ggggg</div>
+  </div>
+<body>

Added: trunk/LayoutTests/fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html (0 => 169862)


--- trunk/LayoutTests/fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html	2014-06-12 00:14:21 UTC (rev 169862)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<head>
+<title>This tests that text with subpixel margin-top value does not get cut off prematurely.</title>
+<style>
+  .outer {
+    display: inline-block;
+    font-family: '.LucidaGrandeUI';
+    margin-top: 0.3px;
+  }
+
+  .inner {
+    overflow: hidden;
+  }
+</style>
+</head>
+<body>
+  <div class=outer>
+    <div class=inner>ggggg</div>
+  </div>
+<body>

Modified: trunk/Source/WebCore/ChangeLog (169861 => 169862)


--- trunk/Source/WebCore/ChangeLog	2014-06-11 23:57:39 UTC (rev 169861)
+++ trunk/Source/WebCore/ChangeLog	2014-06-12 00:14:21 UTC (rev 169862)
@@ -1,3 +1,19 @@
+2014-06-11  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: RenderBox's content clipping should clip on device pixel boundary.
+        https://bugs.webkit.org/show_bug.cgi?id=133767
+        <rdar://problem/17272365>
+
+        Reviewed by Simon Fraser.
+
+        Push RenderBox's content clipping to device pixel boundaries. Integral snapping makes
+        content cut off prematurely.
+
+        Test: fast/inline-block/hidpi-margin-top-with-subpixel-value-and-overflow-hidden.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::pushContentsClip):
+
 2014-06-11  Anders Carlsson  <[email protected]>
 
         Remove XHRReplayData::addHeader

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (169861 => 169862)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2014-06-11 23:57:39 UTC (rev 169861)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2014-06-12 00:14:21 UTC (rev 169862)
@@ -1691,10 +1691,11 @@
         paintObject(paintInfo, accumulatedOffset);
         paintInfo.phase = PaintPhaseChildBlockBackgrounds;
     }
-    IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, currentRenderNamedFlowFragment(), IgnoreOverlayScrollbarSize, paintInfo.phase));
+    float deviceScaleFactor = document().deviceScaleFactor();
+    FloatRect clipRect = pixelSnappedForPainting((isControlClip ? controlClipRect(accumulatedOffset) : overflowClipRect(accumulatedOffset, currentRenderNamedFlowFragment(), IgnoreOverlayScrollbarSize, paintInfo.phase)), deviceScaleFactor);
     paintInfo.context->save();
     if (style().hasBorderRadius())
-        paintInfo.context->clipRoundedRect(FloatRoundedRect(style().getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, size()))));
+        paintInfo.context->clipRoundedRect(style().getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, size())).pixelSnappedRoundedRectForPainting(deviceScaleFactor));
     paintInfo.context->clip(clipRect);
     return true;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to