Bug 1260335 - Add a comment that explains why the perspective child can't have more than one frame metrics. r?mattwoodrow
MozReview-Commit-ID: BsB8XRtUd4b
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -940,16 +940,22 @@ AsyncCompositionManager::ApplyAsyncConte
// move with this APZC.
if (metrics.HasClipRect()) {
ParentLayerIntRect clip = metrics.ClipRect();
if (aLayer->GetParent() && aLayer->GetParent()->GetTransformIsPerspective()) {
// If our parent layer has a perspective transform, we want to apply
// our scroll clip to it instead of to this layer (see bug 1168263).
// A layer with a perspective transform shouldn't have multiple
// children with FrameMetrics, nor a child with multiple FrameMetrics.
+ // (A child with multiple FrameMetrics would mean that there's *another*
+ // scrollable element between the one with the CSS perspective and the
+ // transformed element. But you'd have to use preserve-3d on the inner
+ // scrollable element in order to have the perspective apply to the
+ // transformed child, and preserve-3d is not supported on scrollable
+ // elements, so this case can't occur.)
MOZ_ASSERT(!aClipDeferredToParent);
aClipDeferredToParent = Some(clip);
} else {
asyncClip = IntersectMaybeRects(Some(clip), asyncClip);
}
}
// Do the same for the ancestor mask layers: ancestorMaskLayers contains