Bug
1877749: Prevent nsCocoaWindow from forgetting transitions during transitory window rebuilds. r=mstange
DestroyNativeWindow() is called for permanent window destruction, but it
is also called for transitory window recreated in HideWindowChrome().
When the nsCocoaWindow itself is also expected to be destroyed, it's
useful to clear out transitions. But when the nsCocoaWindow is expected
to persist (with a new mWindow instance), it's unhelpful to clear the
transitions, because emulated fullscreen relies on transition
continuity.
This change further simplifies DestroyNativeWindow so it does only the
bare-minimum, always-needed things before forgetting mWindow and its
delegate. The higher-level concern of clearing out transitions is
factored out into a new function CancelAllTransitions, which is invoked
by callers when appropriate.
Differential Revision: https://phabricator.services.mozilla.com/
D200215