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
--- 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;