Bug 1430787 - Restrict a debug assertion to fixed-pos layers. r?botond draft
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 19 Jan 2018 14:55:08 -0500
changeset 722765 19e8ea2a4bcb771f83b2eced89313a48a2f08c79
parent 722753 7861a7df0c4dda3414529637d638c68724e3521a
child 746691 b82f581703089f71f5616a7c0c366936f91aa03f
push id96238
push userkgupta@mozilla.com
push dateFri, 19 Jan 2018 22:14:07 +0000
reviewersbotond
bugs1430787
milestone59.0a1
Bug 1430787 - Restrict a debug assertion to fixed-pos layers. r?botond The assertion is in a codepath that is run for both fixed-pos and sticky layers, but the assertion only pertains to fixed-pos layers. So in the context of sticky layers it is invalid and might fail. MozReview-Commit-ID: 49MZRHxSBhL
gfx/layers/composite/AsyncCompositionManager.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -468,23 +468,25 @@ AsyncCompositionManager::AlignFixedAndSt
 
   // Insert a translation so that the position of the anchor point is the same
   // before and after the change to the transform of aTransformedSubtreeRoot.
 
   // A transform creates a containing block for fixed-position descendants,
   // so there shouldn't be a transform in between the fixed layer and
   // the subtree root layer.
 #ifdef DEBUG
-  Matrix4x4 ancestorTransform;
-  if (layer != aTransformedSubtreeRoot) {
-    AccumulateLayerTransforms(layer->GetParent(), aTransformedSubtreeRoot,
-                              ancestorTransform);
+  if (layer->GetIsFixedPosition()) {
+    Matrix4x4 ancestorTransform;
+    if (layer != aTransformedSubtreeRoot) {
+      AccumulateLayerTransforms(layer->GetParent(), aTransformedSubtreeRoot,
+                                ancestorTransform);
+    }
+    ancestorTransform.NudgeToIntegersFixedEpsilon();
+    MOZ_ASSERT(ancestorTransform.IsIdentity());
   }
-  ancestorTransform.NudgeToIntegersFixedEpsilon();
-  MOZ_ASSERT(ancestorTransform.IsIdentity());
 #endif
 
   // Since we create container layers for fixed layers, there shouldn't
   // a local CSS or OMTA transform on the fixed layer, either (any local
   // transform would go onto a descendant layer inside the container
   // layer).
 #ifdef DEBUG
   Matrix4x4 localTransform;