--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3110,17 +3110,22 @@ WrapInWrapList(nsDisplayListBuilder* aBu
nsIFrame* aFrame, nsDisplayList* aList,
const ActiveScrolledRoot* aContainerASR)
{
nsDisplayItem* item = aList->GetBottom();
if (!item) {
return nullptr;
}
- if (!aFrame->IsTransformed()) {
+ nsIFrame *itemFrame = item->Frame();
+ if (item->GetType() == DisplayItemType::TYPE_PERSPECTIVE) {
+ itemFrame = static_cast<nsDisplayPerspective*>(item)->TransformFrame();
+ }
+
+ if (item->GetAbove() || itemFrame != aFrame) {
return new (aBuilder) nsDisplayWrapList(aBuilder, aFrame, aList, aContainerASR);
}
aList->RemoveBottom();
return item;
}
/**
* Check if a frame should be visited for building display list.