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 315471 ff6c2806545ebe2f2fa9ea9fd5b0d65cba478d59
parent 315470 f001332ad789062c28a73f0bef1ace98569c5d50
child 315472 4f1bcad3f4d6edb149785e1bbeb876ef74869bb0
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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