W3C home > Mailing lists > Public > www-style@w3.org > March 2016

Re: [css-containment] Splitting the "sizing" part from "layout" containment

From: Ojan Vafai <ojan@chromium.org>
Date: Sat, 19 Mar 2016 00:50:56 +0000
Message-ID: <CANMdWTssdyCsHV0cdvmoH_r6TMNh61dtsF0OC+SvMX2GpXZQOg@mail.gmail.com>
To: Paul Lewis <paul@aerotwist.com>, "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
There are two important use-cases here:
1. A simple way to get strong containment without needing to understand the
intricacies of the platform and of each vendor's implementation. This is
"style layout paint size".
2. A simple way to get soft containment that can be used broadly (e.g. via
"* { contain: strict }"). This is "style layout paint".

#1 is an extension of #2 and I think it should read that way. Also, it's
really critical that #1 be very simple. It's just so draconian that it
can't be used as the 90% use-case. But it's really critical for that other
10%.

It seems to me that we just have a naming problem here, but that we can
still have a single property. I think "strict" is a good name for #1. We
just need to make a name for #2 that sounds like the pre-cursor to #1.

Here's a few proposals:
a) strictish
b) strictable
c) strict-candidate
d) pre-strict

I prefer (c), but would be happier with any of these than splitting this up
into two properties.

On Fri, Mar 18, 2016 at 11:24 AM Paul Lewis <paul@aerotwist.com> wrote:

> Thanks for the clarification! SGTM.
>
> Seems like a good addition irrespective of containment. Mainly I'm happy
> if strict doesn't require explicit widths and heights. If there's a way to
> ensure that independently then yay.
>
> On Fri, 18 Mar 2016, 18:18 Tab Atkins Jr., <jackalmage@gmail.com> wrote:
>
>> On Fri, Mar 18, 2016 at 11:14 AM, Paul Lewis <paul@aerotwist.com> wrote:
>> > If we go with a separate property then that restores the clarity of
>> contain,
>> > which is good.
>> >
>> > The concern I would have then is what this other property looks like. I
>> > guess it comes like flex properties, which only apply when the parent is
>> > display: flex?
>> >
>> > So I guess, yeah, if a developer sets this additional property along
>> with
>> > width and height (does it need both?) then there's an extra constraint
>> > applied, but for the main case "strict-ish" just got promoted to
>> "strict"
>> > and we make this sizing property, in conjunction with the other, the
>> "super
>> > strict" option? :)
>>
>> Nah, the idea is that you'd have something like "height-foo: auto |
>> pretend-you-are-empty;" (all names subject to change, obviously).  It
>> would be completely disconnected from 'contain', and it applies to all
>> elements at all times.  If you set it to "pretend-you-are-empty", then
>> you need to either provide a value for 'height' as well, or your
>> element will break in an obvious way, as it immediately collapses to
>> zero height.  Similar for 'width'.
>>
>> ~TJ
>>
>
Received on Saturday, 19 March 2016 00:51:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:01 UTC