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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 18 Mar 2016 11:06:55 -0700
Message-ID: <CAAWBYDCa-LHxVFGACoGav19wWztQg_GRDmS8fEf=EJaF_B0now@mail.gmail.com>
To: Paul Lewis <paul@aerotwist.com>
Cc: www-style list <www-style@w3.org>
On Fri, Mar 18, 2016 at 10:46 AM, Paul Lewis <paul@aerotwist.com> wrote:
> Hehe yeah, that's fine. I think what I'm driving at is that both "strict"
> and -- fair enough -- "all" both imply that 4/4 are accounted for. I wonder
> if we need to use a different keyword for 3/4 (which I'm struggling to think
> of!), but if we have either keyword it should mean 4/4.
>
> Overall that might make the main case more verbose, but I'd prefer that over
> saying "strict is kinda strict, except it doesn't mean this last one, which
> is size. That's something you need to specify separately, so it's only
> sort-of strict."

Which is an argument for moving the sizing stuff out to a separate
property, actually.

This has more reasoning behind it than just "naming things is hard".
The "size containment" doesn't actually, when you think about it,
*add* anything, containment-wise.  If you use it, you *must* provide
means to size the element properly without reference to children
anyway, and once you do that *you've achieved precisely the goal you
sought in the first place* - the containment keyword doesn't optimize
any further!  The only benefit is that it "keeps you honest" - if you
*accidentally* make it depend on its children you'll very visibly
break things (but you won't lose the perf benefits!).

The main use of the size containment stuff is to (a) remind people
that being able to size yourself without looking at children is a perf
benefit, and (b) avoid loops in sizing behavior when you're doing some
types of sizing stuff on your own, like in userland Element Queries.

All the other containment benefits are things you can't achieve on
your own and/or things that don't self-negate when you deal with the
fallout of their effects.  (That is, whatever changes you have to make
to accommodate their effects does not, by itself, achieve those
effects, thus making the containment superfluous.)

That said, I'm still not *opposed* to keeping sizing in the 'contain'
property, as I outlined above.  I'm just also totally fine with it
being split out into some sort of width-*/height-* property.

~TJ
Received on Friday, 18 March 2016 18:07:44 UTC

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