-
Notifications
You must be signed in to change notification settings - Fork 756
Open
Labels
Description
The idea is this: it renders like display: none, but further unloads state to save on memory. I'm filing this here, but it also would require significant changes to the HTML spec.
- Images and iframes are unloaded. Transitioning back to any other
displayvalue causes fetches to happen anew like it was just added, firing an additionalloadevent once (re)loaded. - Animations are cut off by
display: unloadand reset upondisplaychanging back to something other thanunload. - Inputs' state resets upon
displaychanging tounload. - Audio and video play state resets upon
displaychanging tounload. - Focus removal occurs upon
displaychanging tounloadin the same way they fire on element removal. - Custom elements can observe changes via
.attachedCallback()and.detachedCallback()..connectedCallback()and.disconnectedCallback()would default to these if missing. - Probably other stuff I may be missing.
The idea is to unload external state for things like inactive popovers, inactive tabs, and inactive routes (see WICG/declarative-partial-updates#14). It does not cause elements to be actually removed unless observing JS callbacks do so explicitly, but it has most of the observable side effects that element removal has.