Bug 1595086 - also pause painting when setActive(false) is called to stop requestAnimationFrames; r?snorp draft
authorThomas Wisniewski <twisniewski@mozilla.com>
Thu, 05 Dec 2019 03:02:06 +0000
changeset 2517412 8a83728e9f4385f4bfafb2cabbc81e1d674ee9f3
parent 2512126 53cfede1065cc3eeb57bb1f2561ac830396e84c7
child 2517413 c0f3b4cdd1a23a543e36f4e2bfc1984a35e6d246
push id460518
push userreviewbot
push dateThu, 05 Dec 2019 03:02:24 +0000
treeherdertry@c0f3b4cdd1a2 [default view] [failures only]
reviewerssnorp
bugs1595086
milestone73.0a1
Bug 1595086 - also pause painting when setActive(false) is called to stop requestAnimationFrames; r?snorp Summary: also freeze the presshell when setActive(false) is called to stop requestAnimationFrames Reviewers: snorp Tags: #secure-revision Bug #: 1595086 Differential Revision: https://phabricator.services.mozilla.com/D55343 Differential Diff: PHID-DIFF-5bojs3gxr4p3umfq3tuc
mobile/android/chrome/geckoview/GeckoViewContentChild.js
--- a/mobile/android/chrome/geckoview/GeckoViewContentChild.js
+++ b/mobile/android/chrome/geckoview/GeckoViewContentChild.js
@@ -258,19 +258,21 @@ class GeckoViewContentChild extends Geck
 
           restoredHistory.QueryInterface(Ci.nsISHistory).reloadCurrentEntry();
         }
         break;
 
       case "GeckoView:SetActive":
         if (content) {
           if (!aMsg.data.active) {
+            docShell.contentViewer.pausePainting();
             content.windowUtils.suspendTimeouts();
             this.timeoutsSuspended = true;
           } else if (this.timeoutsSuspended) {
+            docShell.contentViewer.resumePainting();
             content.windowUtils.resumeTimeouts();
             this.timeoutsSuspended = false;
           }
         }
         if (content && aMsg.data.suspendMedia) {
           content.windowUtils.mediaSuspend = aMsg.data.active
             ? Ci.nsISuspendedTypes.NONE_SUSPENDED
             : Ci.nsISuspendedTypes.SUSPENDED_PAUSE;