border collapsing: subpixels can make table-cell with smaller border width "win" over table with larger width
Categories
(Core :: Layout: Tables, defect, P3)
Tracking
()
People
(Reporter: dgrogan, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36
Steps to reproduce:
http://w3c-test.org/css/css-tables/subpixel-collapsed-borders-003.html passes in hi-dpi but fails in low-dpi. Its essence is:
<table style="border-collapse: collapsed; border-width:5.95px">
<td style="border-width:5px"></td>
</table>
Actual results:
In the collapsed border resolution algorithm, Firefox (and Safari) presumably use border widths after they've been rounded to device pixels. In the test above, the table's 5.95px border should beat the cell's 5px border.
But rounding causes 5.95px to round down to 5px on a 1x ratio device. So the table and cell have the same widths. When the widths are the same, the cell beats the table. On a 2x device, 5.95px is rounded to 5.5px, making the table beat the cell.
Expected results:
The pre-rounded width should be used in the algorithm so that colors don't change based on the user's device pixel ratio.
Comment 1•6 years ago
|
||
The pre-rounded width should be used in the algorithm so that colors don't change based on the user's device pixel ratio.
I agree. We store the width already-snapped on our computed style representation, so fixing this requires keeping yet another border rect, or deferring the snapping until some later point in layout (which requires a bit of auditing and plumbing).
Updated•2 years ago
|
Description
•