Change RenderTableCell to use pixelSnappedSize when painting
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 16:16:20 +0000 (16:16 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Mar 2013 16:16:20 +0000 (16:16 +0000)
commit723d360179388ac808e2a5cf67154b30d493d66a
tree0c100852932d923d41828d7ff1c318dd5f5e0335
parent5d3b62bab09d467148967a28273393ac88a22e93
Change RenderTableCell to use pixelSnappedSize when painting
https://bugs.webkit.org/show_bug.cgi?id=112562

Reviewed by Eric Seidel.

Source/WebCore:

Change the paining code in RenderTableCell to use the pixel snapped size
to ensure consistent rounding given that the location was rounded during
layout.

It is currently constructing a paint rect by taking the rounded location
and the precise size and then pixel snapping it. This causes the size to
be rounded incorrectly. By instead using the pixel snapped size the
rounding problem can be avoided.

Test: fast/sub-pixel/table-cell-background.html

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintCollapsedBorders):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
(WebCore::RenderTableCell::paintBoxDecorations):
(WebCore::RenderTableCell::paintMask):

LayoutTests:

Add test for painting of cell backgrounds on a sub-pixel boundary.

* fast/sub-pixel/table-cell-background-expected.html: Added.
* fast/sub-pixel/table-cell-background.html: Added.
* platform/chromium-linux/tables/mozilla/bugs/bug73321-expected.png:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/sub-pixel/table-cell-background-expected.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/table-cell-background.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug73321-expected.png
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTableCell.cpp