Re: [CSS2.1] Fixed z-index interop issue

On Wed, Nov 19, 2014 at 9:53 PM, Robert O'Callahan <robert@ocallahan.org>
wrote:

> On Thu, Nov 20, 2014 at 5:48 PM, Chris Harrelson <chrishtr@google.com>
> wrote:
>
>> Apologies for not knowing the full background of this decision, but could
>> someone point me at documentation for why it's bad for position:fixed to be
>> a stacking context? There are definitely performance & simplicity
>> advantages to Blink making it so.
>>
>
> It broke some existing content (most of which has probably been fixed by
> now, but maybe not all). It makes position:fixed less consistent with
> position:absolute. Prior to Webkit changing behavior, we had interop across
> all browsers. Other browsers didn't have an implementation need to change
> behavior (and apparently still don't). You have to solve most of the
> architectural issues anyway if you want async scrolling of arbitrary
> scrollable elements, since a position:absolute child of a scrollable
> non-positioned element has very similar z-ordering problems to
> position:fixed. In Gecko, forcing position:fixed elements to be stacking
> contexts wouldn't help us much at this point.
>

This is a fair point, from a practical point of view. If overflow:scroll
also forced a stacking context, then things would be a whole lot simpler,
but sadly it does not, and it is likely very hard/impossible to make that
change now.

Blink is in fact in the middle of a big project ("slimming paint", which
Gecko has already done), one outcome of which is to be able to potentially
make this change, among other web compatibility bugs Blink currently has
(Blink has not committed to doing so BTW, just that we will be able to;
compatibility risk is one reason it might be hard to change).


> So my point of view is, why change the spec?
>

Here are two reasons to at least consider it, one practical and one
architectural:

Practical: Webkit is unaffected by the Blink work going on right now. It's
unclear right now if Webkit will be able to fix this any time soon.

Architectural: stacking contexts are the primary form of encapsulation in
the web painting algorithm. Encapsulation is good for ease and flexibility
of implementation, predictable performance, and developer ergonomics (*).

Regards,
Chris

(*) For example, the behavior of positioned children of position:fixed
elements w/o a stacking context is very hard to understand intuitively;
same goes for overflow:scroll.

Received on Friday, 21 November 2014 23:16:26 UTC