Skip to content

Commit bb11354

Browse files
committed
[css-contain-2] Mention c-i-s:auto when discussion size skipping.
1 parent e77e91e commit bb11354

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

css-contain-2/Overview.bs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,23 +1420,34 @@ Using ''content-visibility: auto''</h3>
14201420
can "jump around" as elements go off-screen and start [=skipping=].
14211421

14221422
<div class=example>
1423-
This can be fixed by making the element fixed-size,
1424-
or sometimes by carefully arranging a layout such as Grid
1425-
to size the element without depending on its contents.
1426-
1427-
If that can't be done, however,
1428-
'contain-intrinsic-size' can be set to an <em>estimate</em>
1429-
of the element's size,
1430-
ensuring it'll remain approximately the correct size when it's skipped.
1423+
This can be fixed in a number of ways:
1424+
1425+
* making the element fixed-size
1426+
* carefully arranging a layout such as Grid
1427+
to size the element without depending on its contents
1428+
* using 'contain-intrinsic-size' to set an <em>estimate</em> of the element's size
1429+
* using ''contain-intrinsic-size: auto'' to automatically "snapshot" the <em>exact</em> size of the element
1430+
from the last time it was rendered,
1431+
before it was [=skipped=]
1432+
(along with providing an estimate of the size
1433+
to be used before it's rendered and can have its size snapshotted)
14311434

14321435
For example,
14331436
on Twitter,
14341437
the average tweet is approximately 200px tall,
1435-
so ''contain-intrinsic-size: 500px 200px''
1438+
so ''contain-intrinsic-size: auto 500px 200px''
14361439
will ensure that the scrollbar thumb is in approximately the correct size and position
14371440
even when preceding or following tweets are [=skipped=],
14381441
while still allowing the tweets to size according to their contents
14391442
when they're on-screen.
1443+
As long as the tweets have all been viewed at least once
1444+
(and haven't changed size while they were [=skipped=]),
1445+
their sizes will be <em>exactly</em> correct while they're [=skipped=],
1446+
so the scrollbar thumb will be as well;
1447+
only freshly-loaded tweets
1448+
(such as those loaded at the top of the timeline
1449+
while you are scrolling further down)
1450+
will be forced to rely on the ''200px'' height estimate.
14401451
</div>
14411452

14421453
Restrictions and Clarifications {#cv-notes}

0 commit comments

Comments
 (0)