Differentiate "current orientation" and "update orientation".
random rewrite
pending-promise is set on the document
Rewrite orientation change and visibility handling.