Bug 1260335 - Add a comment that explains why the perspective child can't have more than one frame metrics. r=mattwoodrow a=ritu
authorMarkus Stange <mstange@themasta.com>
Wed, 30 Mar 2016 15:34:03 -0400
changeset 323953 f19ef8ed16061fb4f2661a142d466b02cd9a2a84
parent 323952 0c6e295e6f0a9aef71d04c8167166cdbf3975ca8
child 323954 82bd9ffb22fc273895ed9ad06c4f5f97342dcdb4
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, ritu
bugs1260335
milestone47.0a2
Bug 1260335 - Add a comment that explains why the perspective child can't have more than one frame metrics. r=mattwoodrow a=ritu MozReview-Commit-ID: BsB8XRtUd4b
gfx/layers/composite/AsyncCompositionManager.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -941,16 +941,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