| Summary: | Subpixel layout: Rounding padding vales pushes the content 1px off. | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zalan <zalan> | ||||||||||
| Component: | Layout and Rendering | Assignee: | zalan <zalan> | ||||||||||
| Status: | RESOLVED INVALID | ||||||||||||
| Severity: | Normal | CC: | hyatt, jonlee, koivisto, simon.fraser, webkit-bug-importer | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 126283 | ||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 219279 [details]
test case
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;
}
I think it's OK to have a behavior change with subpixel when authors are using percentages. We should check Firefox behavior. 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>
Created attachment 219705 [details]
regressed test case (wikipedia)
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)
|
<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>