- From: Christian Biesinger <notifications@github.com>
- Date: Mon, 20 Sep 2021 10:47:36 -0700
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3ctag/design-reviews/issues/624/923142901@github.com>
Thanks for the feedback! TL;DR of the below: we think this feature is best viewed as a UA default behavior triggered by CSS, not a side-effect of CSS algorithms; there is precedent in features such as scrolling. Full version: After your latest comment, we thought some more about the issue of side-effects, and how to express it in some other way such as JS. Regarding JS: as we mentioned previously, the feature can be polyfilled via a ResizeObserver, but we think it is (a) too expensive/difficult for developers (especially CSS-oriented developers) to be expected to reliably achieve, and (b) something almost all developers using content-visibility: auto would want (developer feedback from multiple partners has confirmed this). We don’t think this should be viewed as a side-effect of a CSS algorithm (which we agree is a bad thing generally), but as a UA default behavior. Compare it with scrolling: scrolling is a super complicated UA default behavior that is triggered by CSS via `overflow:scroll`, and has lots of built-in behaviors that have visual side-effects, such as scrollbar gutters, scroll offsets and so on. This feature should be viewed similarly - it’s a thing that developers want to do and can potentially do themselves, but there is enough efficiency/convenience/defaults-work-well value that it makes sense for the UA to provide the functionality as a built-in. Note that the feature is carefully specified to happen at ResizeObserver timing, so there is no magic implementation advantage of the browser over script. The only magic thing about this feature is where it stores the cached intrinsic size. Conceptually it stores it on a property of Element objects (and that’s exactly what the Chromium implementation does). But we don’t propose exposing that as a JS property (analogous to `scrollTop`) to web developers at this time, nor do we propose exposing an event (analogous to `scroll`) that can allow `preventDefault`. If there were demand for such features we could expose them in the future (https://github.com/WICG/display-locking/issues/112). -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3ctag/design-reviews/issues/624#issuecomment-923142901
Received on Monday, 20 September 2021 17:47:49 UTC