On 26 January 2014 17:56, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Sun, Jan 26, 2014 at 5:43 AM, Thomas Rosenau <rosenau@seitenbau.com>
> wrote:
> > Citing from http://dev.w3.org/csswg/css-box/
> >
> > Section 19.1:
> >> The space taken up by the scrollbars affects the computation of the
> dimensions in the rendering model.
> >
> > Does it? How so?
> > The reason I'm asking is because I observe different behaviour in
> Firefox/Chrome:
> >
> > <div style="width:20px;padding:20px;overflow:scroll"></div>
> > <script>
> > console.log(getComputedStyle(document.querySelector('div')).width);
> > </script>
> >
> > Firefox returns '20px', while Chrome returns '5px' (with scrollbars
> being 15px wide)
> > Which one is correct?
>
> Which Chrome? I get '20px' on Chrome 33.0.1750.51
>
FWIW Chrome 32.0.1700.76 m returns '5px', 34.0.1807.0 canary '3px', IE 11
'3px' and Opera 18.0 also '3px', while Firefox 26.0 and 29.0a1 (Nightly)
return '20px'.
A similar question came up at Bugzilla lately.[1]
Sebastian
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=157846#c144