W3C home > Mailing lists > Public > www-style@w3.org > July 2008

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

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 1 Jul 2008 15:39:03 +1200
Message-ID: <11e306600806302039x2e0f6978lb4efb769d10cba1d@mail.gmail.com>
To: "Garrett Smith" <dhtmlkitchen@gmail.com>
Cc: Www-style <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT