[csswg-drafts] [css-contain] contain: style is not useful.

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-contain] contain: style is not useful. ==
This is about https://drafts.csswg.org/css-contain/#containment-style.

I wonder what's the use-case for this. In particular, the following optimization that the spec describes:

> Whenever a property is changed on a descendant of the containing element, calculating what part of the DOM tree is "dirtied" and might need to have its style recalculated can stop at the containing element.

Is just not true, since you need to compute the style of ancestors in order to inherit from them.

It's also hard to envision any kind of style-recalc optimization, since any style change may make that element become or stop-being style-contained, and you need to handle stuff like `contain: inherit`.

Given:

 * contain: style is broken on Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=855798
 * The complexity of implementing it correctly in Firefox is high.
 * There's no potential optimization to be had out of this (if only, you could optimize counter updates, but that benefit is IMO overruled by the complexity of "unscoping" the counters when `contain: style` stops applying dynamically, and the fact that counters are uncommon).

I wonder what's the point of implementing it.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3280 using your GitHub account

Received on Friday, 2 November 2018 17:59:40 UTC