W3C home > Mailing lists > Public > www-style@w3.org > November 2015

[css-sizing]? Scrollbars and preferred width

From: Christian Biesinger <cbiesinger@google.com>
Date: Tue, 24 Nov 2015 18:17:02 -0500
Message-ID: <CAPTJ0XH-8=s50VSc2tWMcAJUbTgL5=AHzdYqBh8F1QF_ysp_Sg@mail.gmail.com>
To: www-style list <www-style@w3.org>
Cc: Stefan Zager <szager@google.com>
Hi there!

question about intrinsic width calculation and scrollbars. Consider

In Chrome and Firefox, at least, the first box gets a horizontal
scrollbar because the preferred width does not include the width of
the vertical scrollbar for overflow: auto. This makes sense because to
determine whether a scrollbar is needed, the box has to be laid out,
and the preferred width can't depend on layout. Conversely, at least
in Chrome (haven't tested other browsers), the scrollbar does get
included if it's overflow:scroll.

But my question is, is this behavior specified? (and correct? :) )

(Also, I was surprised when I realized that the scrollbar gets placed
within the content box, ie. width: 100px gets reduced by the scrollbar
size. Is that, too, specified?)

Received on Tuesday, 24 November 2015 23:17:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:58 UTC