Bug 1260335 - Add a comment that explains why the perspective child can't have more than one frame metrics. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Wed, 30 Mar 2016 15:34:03 -0400
changeset 347733 ff6c2806545ebe2f2fa9ea9fd5b0d65cba478d59
parent 347732 f001332ad789062c28a73f0bef1ace98569c5d50
child 347734 4f1bcad3f4d6edb149785e1bbeb876ef74869bb0
push id14653
push userolivier@olivieryiptong.com
push dateTue, 05 Apr 2016 19:21:01 +0000
reviewersmattwoodrow
bugs1260335
milestone48.0a1
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
gfx/layers/composite/AsyncCompositionManager.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -943,16 +943,22 @@ AsyncCompositionManager::ApplyAsyncConte
     // move with this APZC.
     if (scrollMetadata.HasClipRect()) {
       ParentLayerIntRect clip = scrollMetadata.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