Title: [119893] trunk
Revision
119893
Author
[email protected]
Date
2012-06-08 22:44:08 -0700 (Fri, 08 Jun 2012)

Log Message

RenderLayer::paintChildLayerIntoColumns doesn't properly pixel snap
https://bugs.webkit.org/show_bug.cgi?id=88554

Reviewed by Darin Adler.

Source/WebCore:

Column handling code in RenderLayer and RenderBlock was improperly clipping and translating
using floats derived from FractionalLayoutUnits without pixel snapping. RenderLayer also
improperly stored render tree offsets in ints instead of LayoutUnits. This corrects this
issue.

Test: fast/sub-pixel/column-clipping.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintColumnContents):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintChildLayerIntoColumns):

LayoutTests:

* fast/sub-pixel/column-clipping-expected.html: Added.
* fast/sub-pixel/column-clipping.html: Added.
* platform/chromium-mac-snowleopard/fast/multicol/nested-columns-expected.png:
* platform/chromium-mac-snowleopard/fast/multicol/vertical-lr/nested-columns-expected.png:
* platform/chromium-mac-snowleopard/fast/multicol/vertical-rl/nested-columns-expected.png:
* platform/chromium-mac/fast/borders/border-antialiasing-expected.png:
* platform/chromium/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (119892 => 119893)


--- trunk/LayoutTests/ChangeLog	2012-06-09 05:02:41 UTC (rev 119892)
+++ trunk/LayoutTests/ChangeLog	2012-06-09 05:44:08 UTC (rev 119893)
@@ -1,3 +1,18 @@
+2012-06-08  Levi Weintraub  <[email protected]>
+
+        RenderLayer::paintChildLayerIntoColumns doesn't properly pixel snap
+        https://bugs.webkit.org/show_bug.cgi?id=88554
+
+        Reviewed by Darin Adler.
+
+        * fast/sub-pixel/column-clipping-expected.html: Added.
+        * fast/sub-pixel/column-clipping.html: Added.
+        * platform/chromium-mac-snowleopard/fast/multicol/nested-columns-expected.png:
+        * platform/chromium-mac-snowleopard/fast/multicol/vertical-lr/nested-columns-expected.png:
+        * platform/chromium-mac-snowleopard/fast/multicol/vertical-rl/nested-columns-expected.png:
+        * platform/chromium-mac/fast/borders/border-antialiasing-expected.png:
+        * platform/chromium/TestExpectations:
+
 2012-06-08  Ryosuke Niwa  <[email protected]>
 
         Remove FAIL test expectations from EFL, Mac, and Qt ports' test expectations.

Added: trunk/LayoutTests/fast/sub-pixel/column-clipping-expected.html (0 => 119893)


--- trunk/LayoutTests/fast/sub-pixel/column-clipping-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/column-clipping-expected.html	2012-06-09 05:44:08 UTC (rev 119893)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<style>
+.box {
+	width: 10px;
+	height: 10px;
+	background-color: green;
+	border: 1px solid black;
+	position: absolute;
+	top: 0px;
+	left: 0px;
+}
+.shifted {
+	left: 33.5px;
+}
+</style>
+<body>
+<div class="box"></div>
+<div class="box shifted"></div>
+</div>
+</body>

Added: trunk/LayoutTests/fast/sub-pixel/column-clipping.html (0 => 119893)


--- trunk/LayoutTests/fast/sub-pixel/column-clipping.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/column-clipping.html	2012-06-09 05:44:08 UTC (rev 119893)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<style>
+body > div {
+	-webkit-column-count: 2;
+	width: 51px;
+	position: absolute;
+	left: 0px;
+	top: 0px;
+}
+div > div {
+	width: 10px;
+	height: 10px;
+	background-color: green;
+	border: 1px solid black;
+	position: relative;
+}
+</style>
+<body>
+<div>
+	<div></div>
+	<div></div>
+</div>
+</body>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (119892 => 119893)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-06-09 05:02:41 UTC (rev 119892)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-06-09 05:44:08 UTC (rev 119893)
@@ -3770,6 +3770,10 @@
 // Needs rebaseline after the bots cycle.
 BUG_OJAN WIN MAC : tables/mozilla/bugs/bug131020.html = PASS IMAGE IMAGE+TEXT
 BUGLEVIW LEOPARD LION WIN LINUX : fast/sub-pixel/file-upload-control-at-fractional-offset.html = PASS FAIL MISSING
+BUGLEVIW LEOPARD LION WIN LINUX : fast/borders/border-antialiasing.html = PASS FAIL
+BUGLEVIW LEOPARD LION WIN LINUX : fast/multicol/nested-columns.html = PASS FAIL
+BUGLEVIW LEOPARD LION WIN LINUX : fast/multicol/vertical-lr/nested-columns.html = PASS FAIL
+BUGLEVIW LEOPARD LION WIN LINUX : fast/multicol/vertical-rl/nested-columns.html = PASS FAIL
 
 BUGCR131187 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.gradient.radial.cone.cylinder.html = TEXT
 BUGCR131187 : platform/chromium/virtual/gpu/fast/canvas/canvas-currentColor.html = TEXT

Modified: trunk/LayoutTests/platform/chromium-mac/fast/borders/border-antialiasing-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-mac-snowleopard/fast/multicol/nested-columns-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-mac-snowleopard/fast/multicol/vertical-lr/nested-columns-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-mac-snowleopard/fast/multicol/vertical-rl/nested-columns-expected.png


(Binary files differ)

Modified: trunk/Source/WebCore/ChangeLog (119892 => 119893)


--- trunk/Source/WebCore/ChangeLog	2012-06-09 05:02:41 UTC (rev 119892)
+++ trunk/Source/WebCore/ChangeLog	2012-06-09 05:44:08 UTC (rev 119893)
@@ -1,3 +1,22 @@
+2012-06-08  Levi Weintraub  <[email protected]>
+
+        RenderLayer::paintChildLayerIntoColumns doesn't properly pixel snap
+        https://bugs.webkit.org/show_bug.cgi?id=88554
+
+        Reviewed by Darin Adler.
+
+        Column handling code in RenderLayer and RenderBlock was improperly clipping and translating
+        using floats derived from FractionalLayoutUnits without pixel snapping. RenderLayer also
+        improperly stored render tree offsets in ints instead of LayoutUnits. This corrects this
+        issue.
+
+        Test: fast/sub-pixel/column-clipping.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintColumnContents):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintChildLayerIntoColumns):
+
 2012-06-08  Rakesh KN  <[email protected]>
 
         REGRESSION(r116487?): HTMLFormElement::elements['name'] is empty if the form is detached from the document tree

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (119892 => 119893)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-06-09 05:02:41 UTC (rev 119892)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-06-09 05:44:08 UTC (rev 119893)
@@ -2744,7 +2744,7 @@
             // like overflow:hidden.
             // FIXME: Content and column rules that extend outside column boxes at the edges of the multi-column element
             // are clipped according to the 'overflow' property.
-            context->clip(clipRect);
+            context->clip(pixelSnappedIntRect(clipRect));
 
             // Adjust our x and y when painting.
             LayoutPoint adjustedPaintOffset = paintOffset + offset;

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (119892 => 119893)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-06-09 05:02:41 UTC (rev 119892)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-06-09 05:44:08 UTC (rev 119893)
@@ -3222,12 +3222,12 @@
 
     ColumnInfo* colInfo = columnBlock->columnInfo();
     unsigned colCount = columnBlock->columnCount(colInfo);
-    int currLogicalTopOffset = 0;
+    LayoutUnit currLogicalTopOffset = 0;
     for (unsigned i = 0; i < colCount; i++) {
         // For each rect, we clip to the rect, and then we adjust our coords.
         LayoutRect colRect = columnBlock->columnRectAt(colInfo, i);
         columnBlock->flipForWritingMode(colRect);
-        int logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent();
+        LayoutUnit logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent();
         LayoutSize offset;
         if (isHorizontal) {
             if (colInfo->progressionAxis() == ColumnInfo::InlineAxis)
@@ -3251,7 +3251,7 @@
             
             // Each strip pushes a clip, since column boxes are specified as being
             // like overflow:hidden.
-            context->clip(colRect);
+            context->clip(pixelSnappedIntRect(colRect));
 
             if (!colIndex) {
                 // Apply a translation transform to change where the layer paints.
@@ -3260,7 +3260,7 @@
                 if (oldHasTransform)
                     oldTransform = *childLayer->transform();
                 TransformationMatrix newTransform(oldTransform);
-                newTransform.translateRight(offset.width(), offset.height());
+                newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height()));
                 
                 childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));
                 childLayer->paintLayer(rootLayer, context, localDirtyRect, paintBehavior, paintingRoot, region, overlapTestRequests, paintFlags);
@@ -3274,7 +3274,7 @@
                 LayoutPoint childOffset;
                 columnLayers[colIndex - 1]->convertToLayerCoords(rootLayer, childOffset);
                 TransformationMatrix transform;
-                transform.translateRight(childOffset.x() + offset.width(), childOffset.y() + offset.height());
+                transform.translateRight(roundToInt(childOffset.x() + offset.width()), roundToInt(childOffset.y() + offset.height()));
                 
                 // Apply the transform.
                 context->concatCTM(transform.toAffineTransform());
@@ -3287,7 +3287,7 @@
         }
 
         // Move to the next position.
-        int blockDelta = isHorizontal ? colRect.height() : colRect.width();
+        LayoutUnit blockDelta = isHorizontal ? colRect.height() : colRect.width();
         if (columnBlock->style()->isFlippedBlocksWritingMode())
             currLogicalTopOffset += blockDelta;
         else
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to