https://drafts.csswg.org/css-sizing-4/#last-remembered
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 the current inner dimensions of its principal box as its last remembered size.
It's unclear what happens if there is no principal box.
There is a note below which says that the last remembered size survives display: none, so I guess it's just not recorded:
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, generates a principal box, but does not have size containment, record the current inner dimensions of its principal box as its last remembered size.