W3C home > Mailing lists > Public > www-style@w3.org > January 2014

Re: padding lost in overflow

From: Robert O'Callahan <robert@ocallahan.org>
Date: Sun, 12 Jan 2014 00:25:44 +1300
Message-ID: <CAOp6jLaD502Yy6igyuhdkjcX=6sWjmHAggfe_+_N=iv2oVhARg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Mats Palmgren <mats@mozilla.com>, Ojan Vafai <ojan@chromium.org>, "www-style@w3.org" <www-style@w3.org>, David Baron <dbaron@dbaron.org>, Daniel Holbert <dholbert@mozilla.com>, Elliott Sprehn <esprehn@chromium.org>
On Sat, Jan 11, 2014 at 11:24 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> overflow:scroll is *not* just
> "overflow:visible, but we don't show the overflow and instead you can
> scroll to it"

No, that's exactly what it is in Gecko/IE (and the spec).

So, the background is clearly laid out "as large as the contents",
> because it's inside the scrollable area.

No, it's actually "as large as the container", and under the scrollable
area. In Ojan's example, set the background to an image instead of a solid
color and this becomes a lot more obvious.

It seems more logical to lay out the contents normally, as if you were
> doing overflow:visible, then grow the content box to fully contain the
> contents

What exactly would it mean to "grow the content box to fully contain the
contents"? I guess it would have to mean something like "determine the
height of the content box as if the element was height:auto, even when it's
not". Which would be weird since 'height' is defined to set the height of
the content box.

, and wrap the padding box around that as normal.  The first
> part is what we do already; it's really weird that the content box is
> allowed to overflow the padding box.

No, the content box doesn't overflow the padding box in Gecko. In Ojan's
example, or in fact any example where 'height' is not 'auto' (regardless of
the value of 'overflow'), the content box and padding box do not depend on
the contents of the element. The height of the content box is simply the
value of 'height'. The children of the element may overflow the element's
content and padding boxes.

It's your proposed change that's really weird :-). It would mean 'height'
no longer sets the height of the content box, and the element's content-box
and padding-box can overflow the element's border-box and margin-box.

I agree that the current behavior is confusing. I think the real problem is
that the scrolled area includes the padding instead of just the scrolling
element's content-box, which may be a historical accident. But I'm
skeptical that your proposed change makes things overall more sane.

Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w
Received on Saturday, 11 January 2014 11:26:11 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:36 UTC