RESOLVED INVALID 125757
Subpixel layout: Rounding padding vales pushes the content 1px off.
https://bugs.webkit.org/show_bug.cgi?id=125757
Summary Subpixel layout: Rounding padding vales pushes the content 1px off.
zalan
Reported 2013-12-15 12:22:46 PST
<html> <head> <style> body { font-size: 99%; padding-left: 0.5em; } </style> </head> <body>This line is pushed to left by 1px. (body's padding-left is 0.5em with font-size: 99%.)</body> </html>
Attachments
test case (205 bytes, text/html)
2013-12-15 12:23 PST, zalan
no flags
screenshot(wikipedia) (304.78 KB, image/gif)
2013-12-19 17:00 PST, zalan
no flags
regressed test case (wikipedia) (139 bytes, text/html)
2013-12-19 17:01 PST, zalan
no flags
Testing FF's rendering. (118.77 KB, image/jpeg)
2014-01-14 15:06 PST, zalan
no flags
zalan
Comment 1 2013-12-15 12:23:50 PST
Created attachment 219279 [details] test case
zalan
Comment 2 2013-12-15 12:26:19 PST
zalan
Comment 3 2013-12-16 14:31:54 PST
This is the result of clamping float values at LayoutUnit(float) to int when minimumValueForLength() is called. computed minimum value: 6.8; subpixel on: LayoutUnit value -> 435 (which eventually gets pixelsnapped to 7px) subpixel off: LayoutUnit value -> 6 as the result of the clamping. It mainly (most visibly) effects paddings and margins, but it can push pixels off by 1 at other places too (like with text-indent, width properties) div { font-size: 99%; text-indent: 1em; } div { font-size: 99%; width: 1em; display: inline-block; }
Simon Fraser (smfr)
Comment 4 2013-12-18 11:26:11 PST
I think it's OK to have a behavior change with subpixel when authors are using percentages. We should check Firefox behavior.
zalan
Comment 5 2013-12-19 17:00:45 PST
Created attachment 219704 [details] screenshot(wikipedia) Rounding these values would also regress some content including wikipedia. <html> <head> <style> div { margin-top: -1.4em; margin-bottom: 1.4em } </style> </head> <body> <div></div> foo </body> </html>
zalan
Comment 6 2013-12-19 17:01:22 PST
Created attachment 219705 [details] regressed test case (wikipedia)
zalan
Comment 7 2014-01-14 15:06:30 PST
Created attachment 221209 [details] Testing FF's rendering. The new off-by-one rendering matches FF's (v26.0) rendering. (top to bottom: subpixel on, FF, subpixel off)
Note You need to log in before you can comment on or make changes to this bug.