Cleanup
Stop painting, dispose surfaces, and return DOM ownership cleanly.
Dispose surfaces when they are no longer part of the canvas composition:
surface.dispose();Destroy the runtime when the canvas integration is finished:
runtime.destroy();destroy() stops the runtime, unregisters surfaces, clears handlers and waiters, removes Prism-owned native canvas state, and restores Prism-owned DOM state as closely as possible.
Prism restores an initial style or attribute value only if the current value still matches its last write. Application changes to different values survive cleanup, including width and height. This rule also applies to each pointer-events and inert toggle. An application write equal to Prism's value cannot be distinguished, so cleanup restores the initial value. DOM placement is restored as before.
stop() leaves pending paintOnce() requests active; destroy() rejects them.
stop() is idempotent and safe after destroy(). A destroyed runtime should not be restarted or accept new handlers.
Prism