Skip to content

Commit

Permalink
[css-sizing-4] Clarify which elements can get a last remembered size,…
Browse files Browse the repository at this point in the history
… and when lrs is removed. #6220
  • Loading branch information
tabatkins committed Jun 7, 2021
1 parent 13e1f13 commit 22a5e0e
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions css-sizing-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ Overriding Contained Intrinsic Sizes: the 'contain-intrinsic-*' properties</h3>
: <dfn>auto && <<length>></dfn>
:: The corresponding axis has an [=explicit intrinsic inner size=]
of its [=last remembered size=].
If a [=last remembered size=] does not yet exist,
If a [=last remembered size=] does not exist,
instead use the specified <<length>>.
</dl>

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

Only elements capable of being {{ResizeObserver}} targets can have a [=last remembered size=].

<div algorithm="last remembered size">
The [=last remembered size=] of an element is determined by:

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

An element might not have a [=last remembered size=],
if it has never been rendered without [=size containment=].
(In this case, it will instead use the fallback value
provided along with ''contain-intrinsic-size/auto''.)
* At the time that {{ResizeObserver}} events are determined and delivered,
if an element has a [=last remembered size=]
but does <em>not</em> have ''contain-intrinsic-size: auto'',
remove its [=last remembered size=].

Note: The [=last remembered size=] is state attached to the <em>element</em>,
not any particular box generated by the element.
So long as the element retains ''contain-intrinsic-size: auto'',
it will remember its [=last remembered size=]
even across changes such as going to/from ''display: none''.
</div>

<h4 id='cis-scrollbars'>
Expand Down

0 comments on commit 22a5e0e

Please sign in to comment.