Skip to content

Commit 22a5e0e

Browse files
committed
[css-sizing-4] Clarify which elements can get a last remembered size, and when lrs is removed. #6220
1 parent 13e1f13 commit 22a5e0e

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

css-sizing-4/Overview.bs

+17-8
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ Overriding Contained Intrinsic Sizes: the 'contain-intrinsic-*' properties</h3>
540540
: <dfn>auto && <<length>></dfn>
541541
:: The corresponding axis has an [=explicit intrinsic inner size=]
542542
of its [=last remembered size=].
543-
If a [=last remembered size=] does not yet exist,
543+
If a [=last remembered size=] does not exist,
544544
instead use the specified <<length>>.
545545
</dl>
546546

@@ -601,19 +601,28 @@ Last Remembered Size</h4>
601601
offering the performance benefits of [=size containment=]
602602
while <em>probably</em> sizing accurately to its contents.
603603

604+
Only elements capable of being {{ResizeObserver}} targets can have a [=last remembered size=].
605+
604606
<div algorithm="last remembered size">
605607
The [=last remembered size=] of an element is determined by:
606608

607-
* At the time that ResizeObserver events are determined and delivered,
608-
if an element has ''contain-intrinsic-size: auto''
609+
* At the time that {{ResizeObserver}} events are determined and delivered,
610+
if an element has ''contain-intrinsic-size: auto'',
611+
is capable of being a {{ResizeObserver}} target,
609612
but does not have [=size containment=],
610-
record its current inner dimensions
613+
record the current inner dimensions of its [=principal box=]
611614
as its [=last remembered size=].
612615

613-
An element might not have a [=last remembered size=],
614-
if it has never been rendered without [=size containment=].
615-
(In this case, it will instead use the fallback value
616-
provided along with ''contain-intrinsic-size/auto''.)
616+
* At the time that {{ResizeObserver}} events are determined and delivered,
617+
if an element has a [=last remembered size=]
618+
but does <em>not</em> have ''contain-intrinsic-size: auto'',
619+
remove its [=last remembered size=].
620+
621+
Note: The [=last remembered size=] is state attached to the <em>element</em>,
622+
not any particular box generated by the element.
623+
So long as the element retains ''contain-intrinsic-size: auto'',
624+
it will remember its [=last remembered size=]
625+
even across changes such as going to/from ''display: none''.
617626
</div>
618627

619628
<h4 id='cis-scrollbars'>

0 commit comments

Comments
 (0)