Title: [108545] branches/subpixellayout/Source/WebCore/rendering
- Revision
- 108545
- Author
- [email protected]
- Date
- 2012-02-22 13:23:56 -0800 (Wed, 22 Feb 2012)
Log Message
Adding a floorToInt method for ease in moving to trunk, and flooring the right offset for line layout, as due to column layout, we can't be guaranteed to pixel snap at render time identically to layout time.
Modified Paths
Diff
Modified: branches/subpixellayout/Source/WebCore/rendering/LayoutTypes.h (108544 => 108545)
--- branches/subpixellayout/Source/WebCore/rendering/LayoutTypes.h 2012-02-22 21:17:23 UTC (rev 108544)
+++ branches/subpixellayout/Source/WebCore/rendering/LayoutTypes.h 2012-02-22 21:23:56 UTC (rev 108545)
@@ -92,6 +92,11 @@
return value.round();
}
+inline int floorToInt(LayoutUnit value)
+{
+ return value.toInt();
+}
+
inline LayoutUnit roundedLayoutUnit(float value)
{
return FractionalLayoutUnit(value);
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBlock.h (108544 => 108545)
--- branches/subpixellayout/Source/WebCore/rendering/RenderBlock.h 2012-02-22 21:17:23 UTC (rev 108544)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBlock.h 2012-02-22 21:23:56 UTC (rev 108545)
@@ -169,7 +169,10 @@
LayoutUnit left = logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), firstLine, 0);
LayoutUnit right = logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), firstLine, 0);
snappedLeft = roundToInt(left);
- snappedRight = roundToInt(right - left) + snappedLeft;
+ // FIXME: Multicolumn layouts break carrying over subpixel values to the logical right offset because the lines may be shifted
+ // by a subpixel value for all but the first column. This can lead to the actual pixel snapped width of the column being off
+ // by one pixel when rendered versus layed out, which can result in the line being clipped. For now, we have to floor.
+ snappedRight = floorToInt(right);
}
LayoutUnit startAlignedOffsetForLine(RenderBox* child, LayoutUnit position, bool firstLine);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes