Bug 1260335 - Add a comment that explains why the perspective child can't have more than one frame metrics. r?mattwoodrow draft
authorMarkus Stange <mstange@themasta.com>
Wed, 30 Mar 2016 15:34:03 -0400
changeset 346022 0b19c783ec5095578c0983b96f34fb09525ee75d
parent 346021 29f3eb15d440c225c9b4518f31dddf14511c9176
child 346023 188ec4ff29553c1e88196148d7e4532e4fce53ae
push id14215
push usermstange@themasta.com
push dateWed, 30 Mar 2016 19:39:23 +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
@@ -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