Bug 1384387 - Clear frame's invalidation state bits in layers-free mode. r=kats
authorEthan Lin <ethlin@mozilla.com>
Wed, 26 Jul 2017 12:05:24 +0800
changeset 371247 4415d55c49f7160165d590a09a6990503a931a67
parent 371246 d90974262a2c24aead075501eed98cb8082abbc1
child 371248 ac08e5a6a6cfc51dfc62fcecb1703d69af2d2241
push id32240
push usercbook@mozilla.com
push dateThu, 27 Jul 2017 08:56:05 +0000
treeherdermozilla-central@c1ed71da5707 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1384387
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1384387 - Clear frame's invalidation state bits in layers-free mode. r=kats MozReview-Commit-ID: DRv5IcRQVs0
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -2102,16 +2102,27 @@ already_AddRefed<LayerManager> nsDisplay
           return nullptr;
         }
       }
     }
 
     MaybeSetupTransactionIdAllocator(layerManager, presContext);
     bool temp = aBuilder->SetIsCompositingCheap(layerManager->IsCompositingCheap());
     static_cast<WebRenderLayerManager*>(layerManager.get())->EndTransactionWithoutLayer(this, aBuilder);
+
+    // For layers-free mode, we check the invalidation state bits in the EndTransaction.
+    // So we clear the invalidation state bits after EndTransaction.
+    if (widgetTransaction ||
+        // SVG-as-an-image docs don't paint as part of the retained layer tree,
+        // but they still need the invalidation state bits cleared in order for
+        // invalidation for CSS/SMIL animation to work properly.
+        (document && document->IsBeingUsedAsImage())) {
+      frame->ClearInvalidationStateBits();
+    }
+
     aBuilder->SetIsCompositingCheap(temp);
     return layerManager.forget();
   }
 
   NotifySubDocInvalidationFunc computeInvalidFunc =
     presContext->MayHavePaintEventListenerInSubDocument() ? nsPresContext::NotifySubDocInvalidation : 0;
 
   UniquePtr<LayerProperties> props;