Bug 779598 - Call GetVisualOverflowRectRelativeToSelf() only in the case of NoPrerender. r?mattwoodrow
MozReview-Commit-ID: 7r4ebQs5qJx
--- 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());