Skip to content

Commit ed7f9d4

Browse files
committed
[css-sizing-4] Address vmpstr's comments on #5668; always wait to record sizes until you're already doing the work normally.
1 parent 0a8d962 commit ed7f9d4

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

css-sizing-4/Overview.bs

+10-21
Original file line numberDiff line numberDiff line change
@@ -574,13 +574,13 @@ Last Remembered Size</h4>
574574
it can cause unsightly scrollbars or accidentally-hidden content.
575575

576576
The ''contain-intrinsic-size: auto'' value allows a middle-ground:
577-
it lays out the element and records its sizes
578-
<em>just before [=size containment=] begins to apply</em>,
579-
then remembers this value
580-
and uses it from then on,
581-
offering a <em>probably accurate</em> size based on an actual layout of the contents
582-
while still offering the performance benefits of [=size containment=]
583-
from then onward.
577+
if an element is ever <em>not</em> [=size containment|size-contained=],
578+
this value causes the element to remember its size
579+
(calculated as normal by layout);
580+
then, if the element gains [=size containment=] later,
581+
it will use the remembered size,
582+
offering the performance benefits of [=size containment=]
583+
while <em>probably</em> sizing accurately to its contents.
584584

585585
<div algorithm="last remembered size">
586586
The [=last remembered size=] of an element is determined by:
@@ -591,21 +591,10 @@ Last Remembered Size</h4>
591591
record its current inner dimensions
592592
as its [=last remembered size=].
593593

594-
* If the element is being rendered for the first time,
595-
or has just switched from not being rendered to being rendered
596-
(for example, it was previously [=skipped contents|skipped=] due to being off-screen),
597-
then, even if it has [=size containment=],
598-
it must be laid out as if it does <em>not</em> have [=size containment=],
599-
and the resulting inner dimensions
600-
must be recorded as its [=last remembered size=].
601-
602-
(It is then rendered as usual,
603-
applying [=size containment=],
604-
but also using this [=last remembered size=]
605-
due to ''contain-intrinsic-size: auto''.)
606-
607594
An element might not have a [=last remembered size=],
608-
if it has not yet been rendered.
595+
if it has never been rendered without [=size containment=].
596+
(In this case, it will instead use the fallback value
597+
provided along with ''contain-intrinsic-size/auto''.)
609598
</div>
610599

611600
<h4 id='cis-scrollbars'>

0 commit comments

Comments
 (0)