[whatwg] Canvas size and double buffering.

Brian Campbell lambda at continuation.org
Thu Feb 4 06:25:52 PST 2010

On Feb 4, 2010, at 1:55 AM, Robert O'Callahan wrote:

> On Thu, Feb 4, 2010 at 6:50 PM, Brian Campbell <lambda at continuation.org> wrote:
> I think the most reasonable approach would be to say that the getBoundingClientRect().width or height is rounded to the nearest pixel. Boxes are displayed rounded to the nearest pixel, with no fractional pixels being drawn, right?
> No.

In what cases are fractional pixels drawn? I see fractional widths being returned here, but it seems to be drawing rounded to the nearest pixel:


> Why would they report a width or height that is different than how they are displayed? All browsers that I've tested (the ones listed above, so not IE) report integral values for getBoundingClientRect().width and height (or for left and right in the case of Opera, which doesn't support width and height).
> Firefox often returns non-integral values for getBoundingClientRect().width or height.

Sorry, I meant to write "but Firefox", but somehow missed that. Safari, Chrome, and Opera all return values rounded to the nearest pixel.

-- Brian

More information about the whatwg mailing list