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)