Merge pull request #17207 from JerryShih/bug-974807-handle-lost-context-in-gallery-redo-when-lose-master

Bug 989847 - Handle webgl context lose/restore event for gallery editor mode r=djf(cherry picked from commit a55eb67d0659327a8e4b64099fc76a634823fecd)
Merge pull request #18240 from davidflanagan/bug989847-v1.4

Merge pull request #17207 from JerryShih/bug-974807-handle-lost-context-...