Re: Computed Style and Border Width - Question [CSSOM]

On Tue, Jul 1, 2008 at 6:04 AM, Garrett Smith <dhtmlkitchen@gmail.com>
wrote:

>
> When an element's border width is computed from EM, should the
> computed border width include fractions of a pixel?
>
> IOW, when calling:-
>
>  getComputedStyle(el, '').borderWidth,
>
> - is the return a float or an int?
>
> Furthermore, should the precision, if rounded down for rendering, be
> preserved? If it is preserved, it would seem that three border-widths
> of 33.3px would add up to 100px, and that this is where the element
> should appear, and that measurement should be reflected in
> getBoundingClientRect.
>

In Gecko, getComputedStyle returns the used border values, and we round
border widths to *device* pixels before layout, so it can return non-integer
CSS px values when zooming is in effect.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]

Received on Tuesday, 1 July 2008 03:39:39 UTC