Bug 1343147 - Part 1. Do not append a nsDisplayPerspective if we already decide spipping a nsDisplayTransform.
MozReview-Commit-ID: 1CLWGmh64ik
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2793,27 +2793,27 @@ nsIFrame::BuildDisplayListForStackingCon
if (!aBuilder->IsForGenerateGlyphMask() &&
!aBuilder->IsForPaintingSelectionBG()) {
nsDisplayTransform *transformItem =
new (aBuilder) nsDisplayTransform(aBuilder, this,
&resultList, dirtyRect, 0,
allowAsyncAnimation);
resultList.AppendNewToTop(transformItem);
- }
-
- if (hasPerspective) {
- if (clipCapturedBy == ContainerItemType::ePerspective) {
- clipState.Restore();
- }
- resultList.AppendNewToTop(
- new (aBuilder) nsDisplayPerspective(
- aBuilder, this,
- GetContainingBlock(0, disp)->GetContent()->GetPrimaryFrame(),
- &resultList));
+
+ if (hasPerspective) {
+ if (clipCapturedBy == ContainerItemType::ePerspective) {
+ clipState.Restore();
+ }
+ resultList.AppendNewToTop(
+ new (aBuilder) nsDisplayPerspective(
+ aBuilder, this,
+ GetContainingBlock(0, disp)->GetContent()->GetPrimaryFrame(),
+ &resultList));
+ }
}
}
if (clipCapturedBy == ContainerItemType::eOwnLayerForTransformWithRoundedClip) {
clipState.Restore();
resultList.AppendNewToTop(
new (aBuilder) nsDisplayOwnLayer(aBuilder, this, &resultList,
aBuilder->CurrentActiveScrolledRoot(), 0,