W3C home > Mailing lists > Public > www-style@w3.org > September 2013

Re: Proposal for "overflow:clip" for stronger painting isolation

From: Nick Cameron <nick@ncameron.org>
Date: Sat, 21 Sep 2013 07:54:55 +1200
Message-ID: <CAA5tgF3E8Erd6SFmA5tj3xgVTiChfr_Ed2s7dQMVzpTTbpBGCA@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
I think this is a good idea. I would like to be able to isolate for layout
as well as painting. Perhaps overflow: clip and known (fixed?) width and
height are enough. "nothing inside the element can paint outside the
element's rect" seems necessary, but possibly not sufficient - do we need
to also guarantee that nothing outside the element can paint inside the
element's rect? Possibly only in the same stacking context? Perhaps having
overflow: clip start a new stacking context is enough.

Is 'hard' clipping plus a fixed size element enough to guarantee that we
can use the element as a layout boundary? That is, changing the size of
something inside the element cannot affect anything outside the element and
vice-versa (other than position of the element, which does not require
reflow). I can't think of a counterexample, but I am no css expert.

Nick


On Sat, Sep 21, 2013 at 7:03 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> I've been talking with out layout/compositor people here on Blink for
> a while now, and one of the things that has shaken out as a big helper
> in getting things to work *fast* is having strong, guaranteed methods
> to isolate parts of the page.
>
> In particular, isolating the painting of an element seems like a big
> win - having some way to guarantee that the element can be
> hard-clipped to its boundary without losing anything important.
> overflow:hidden doesn't *quite* do this - abspos and fixpos elements
> can escape the bounds of the element.
>
> As well, overflow:hidden still allows scrolling into the hidden area,
> through JS.  This isn't an edge-case - this technique is used by a lot
> of JS libraries.  This means that we can't depend on the element only
> painting its visible area - we have to speculatively paint further, so
> we can scroll smoothly at a moment's notice.
>
> To get around both of these issues and provide stronger optimization
> guarantees to the browser, I suggest we add a "clip" or "contained"
> value to overflow.  This does a strong clipping - nothing inside the
> element can paint outside the element's rect.
>
> It also acts as a positioning root for abspos inside the element, and
> kills fixpos, reverting it to abspos with the element as its
> positioning root.
>
> The value also completely prevents scrolling - the scrollWidth/Height
> of the element is its visible width/height.
>
> Thoughts?
>
> ~TJ
>
>
Received on Friday, 20 September 2013 19:55:23 UTC

This archive was generated by hypermail 2.3.1 : Friday, 20 September 2013 19:55:24 UTC