Seems that the HTML/CSS engine rounds values to the nearest whole px
unit. Would be neat to have sizing to non-discrete values (floats).
EDIT: After closer observation (at least in Chrome), yes, the engine rounds widths/height to the nearest physical pixel. If you zoom in, then there are more physical pixels to alias to and therefore it is possible to render things closer to their specified decimal sizes. For proof, see https://jsfiddle.net/yu55vk1p/1. At first you see the div with size 0.25 is rendered as if it has width 0px. The last three divs are rendered as if they have width 1px. After zooming in, then they are rendered with differing sizes.
EDIT: After realizing what's happening, I guess my real question is "can we have anti-aliasing". Seems like the answer is no (at least not by default).
After further investigation, trying to apply anti-aliasing using CSS transform does apply anti-aliasing, but it applies anti-aliasing to content who's original 2D width/height is still aliased to the physical pixels. For example, compare the two example:
What you'll notice is that when the transform translate is 1.5px
, the three visible divs are fuzzy because they are half-way between two pixels in the 3D space (physical pixels?). But, you'll also notice that the first two divs are still not visible, and the last three divs are the same size and equally fuzzy, which is a strong indicator that the 2-dimensional rendering is aliased to the physical pixels, converted to a texture, then anti-aliased after that.
So, the anti-aliasing that people say to enable with transforms doesn't really help the 2D raster that seems to happen first.
Can we have 2D rasterization before the texture is sent to the 3D rendering?