Bug 779598 - Call GetVisualOverflowRectRelativeToSelf() only in the case of NoPrerender. r?mattwoodrow draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 24 Jul 2018 13:12:25 +0900
changeset 821849 4f04019f9555fc5f8b9e5c189ff42eb86b282001
parent 821749 fe48e26ca88c7919f0c075dc01d5f9fdccdb1260
child 821850 0afa946b8eb53e0ef9f04bbf4bd93e66eda9817a
push id117200
push userhikezoe@mozilla.com
push dateTue, 24 Jul 2018 04:13:09 +0000
reviewersmattwoodrow
bugs779598
milestone63.0a1
Bug 779598 - Call GetVisualOverflowRectRelativeToSelf() only in the case of NoPrerender. r?mattwoodrow MozReview-Commit-ID: 7r4ebQs5qJx
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2878,49 +2878,50 @@ nsIFrame::BuildDisplayListForStackingCon
   // so we keep track if the parent stacking context needs a container too.
   AutoSaveRestoreContainsBlendMode autoRestoreBlendMode(*aBuilder);
   aBuilder->SetContainsBlendMode(false);
 
   nsRect visibleRectOutsideTransform = visibleRect;
   bool allowAsyncAnimation = false;
   bool inTransform = aBuilder->IsInTransform();
   if (isTransformed) {
-    const nsRect overflow = GetVisualOverflowRectRelativeToSelf();
     nsDisplayTransform::PrerenderDecision decision =
         nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder, this, &dirtyRect);
     switch (decision) {
-    case nsDisplayTransform::FullPrerender:
-      allowAsyncAnimation = true;
-      visibleRect = dirtyRect;
-      break;
-    case nsDisplayTransform::PartialPrerender:
-      allowAsyncAnimation = true;
-      visibleRect = dirtyRect;
-      MOZ_FALLTHROUGH;
-      // fall through to the NoPrerender case
-    case nsDisplayTransform::NoPrerender:
-      if (overflow.IsEmpty() && !extend3DContext) {
-        return;
-      }
-
-      // If we're in preserve-3d then grab the dirty rect that was given to the root
-      // and transform using the combined transform.
-      if (combines3DTransformWithAncestors) {
-        visibleRect = dirtyRect = aBuilder->GetPreserves3DRect();
-      }
-
-      nsRect untransformedDirtyRect;
-      if (nsDisplayTransform::UntransformRect(dirtyRect, overflow, this,
-            &untransformedDirtyRect)) {
-        dirtyRect = untransformedDirtyRect;
-        nsDisplayTransform::UntransformRect(visibleRect, overflow, this, &visibleRect);
-      } else {
-        // This should only happen if the transform is singular, in which case nothing is visible anyway
-        dirtyRect.SetEmpty();
-        visibleRect.SetEmpty();
+      case nsDisplayTransform::FullPrerender:
+        allowAsyncAnimation = true;
+        visibleRect = dirtyRect;
+        break;
+      case nsDisplayTransform::PartialPrerender:
+        allowAsyncAnimation = true;
+        visibleRect = dirtyRect;
+        MOZ_FALLTHROUGH;
+        // fall through to the NoPrerender case
+      case nsDisplayTransform::NoPrerender: {
+        const nsRect overflow = GetVisualOverflowRectRelativeToSelf();
+        if (overflow.IsEmpty() && !extend3DContext) {
+          return;
+        }
+
+        // If we're in preserve-3d then grab the dirty rect that was given to the root
+        // and transform using the combined transform.
+        if (combines3DTransformWithAncestors) {
+          visibleRect = dirtyRect = aBuilder->GetPreserves3DRect();
+        }
+
+        nsRect untransformedDirtyRect;
+        if (nsDisplayTransform::UntransformRect(dirtyRect, overflow, this,
+              &untransformedDirtyRect)) {
+          dirtyRect = untransformedDirtyRect;
+          nsDisplayTransform::UntransformRect(visibleRect, overflow, this, &visibleRect);
+        } else {
+          // This should only happen if the transform is singular, in which case nothing is visible anyway
+          dirtyRect.SetEmpty();
+          visibleRect.SetEmpty();
+        }
       }
     }
     inTransform = true;
   } else if (IsFixedPosContainingBlock()) {
     // Restict the building area to the overflow rect for these frames, since
     // RetainedDisplayListBuilder uses it to know if the size of the stacking
     // context changed.
     visibleRect.IntersectRect(visibleRect, GetVisualOverflowRect());