зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1098266. Set correct visible rect on nsDisplayOpacity items that are shuffled around during preserve-3d display list wrapping. r=tn
This commit is contained in:
Родитель
5cd1a3aebe
Коммит
e3acf6c50d
|
@ -3482,6 +3482,13 @@ nsDisplayWrapList::SetVisibleRect(const nsRect& aRect)
|
|||
mVisibleRect = aRect;
|
||||
}
|
||||
|
||||
void
|
||||
nsDisplayWrapList::SetReferenceFrame(const nsIFrame* aFrame)
|
||||
{
|
||||
mReferenceFrame = aFrame;
|
||||
mToReferenceFrame = mFrame->GetOffsetToCrossDoc(mReferenceFrame);
|
||||
}
|
||||
|
||||
static nsresult
|
||||
WrapDisplayList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||
nsDisplayList* aList, nsDisplayWrapper* aWrapper) {
|
||||
|
|
|
@ -2743,6 +2743,8 @@ public:
|
|||
|
||||
void SetVisibleRect(const nsRect& aRect);
|
||||
|
||||
void SetReferenceFrame(const nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
* This creates a copy of this item, but wrapping aItem instead of
|
||||
* our existing list. Only gets called if this item returned nullptr
|
||||
|
|
|
@ -1796,6 +1796,7 @@ WrapPreserve3DListInternal(nsIFrame* aFrame, nsDisplayListBuilder *aBuilder,
|
|||
switch (item->GetType()) {
|
||||
case nsDisplayItem::TYPE_TRANSFORM: {
|
||||
if (!aTemp->IsEmpty()) {
|
||||
// Flush current aTemp contents
|
||||
aOutput->AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder,
|
||||
aFrame, aTemp, aTemp->GetVisibleRect(), aIndex++));
|
||||
}
|
||||
|
@ -1819,6 +1820,7 @@ WrapPreserve3DListInternal(nsIFrame* aFrame, nsDisplayListBuilder *aBuilder,
|
|||
}
|
||||
case nsDisplayItem::TYPE_OPACITY: {
|
||||
if (!aTemp->IsEmpty()) {
|
||||
// Flush current aTemp contents
|
||||
aOutput->AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder,
|
||||
aFrame, aTemp, aTemp->GetVisibleRect(), aIndex++));
|
||||
}
|
||||
|
@ -1833,6 +1835,9 @@ WrapPreserve3DListInternal(nsIFrame* aFrame, nsDisplayListBuilder *aBuilder,
|
|||
output.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder,
|
||||
aFrame, aTemp, aTemp->GetVisibleRect(), aIndex++));
|
||||
}
|
||||
|
||||
opacity->SetVisibleRect(output.GetVisibleRect());
|
||||
opacity->SetReferenceFrame(output.GetBottom()->ReferenceFrame());
|
||||
opacity->GetChildren()->AppendToTop(&output);
|
||||
opacity->UpdateBounds(aBuilder);
|
||||
aOutput->AppendToTop(item);
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div style="position: absolute; transform-style: preserve-3d; transform: perspective(600px) scale(0.166667); opacity:0.3">
|
||||
<div style="position: absolute; background: yellow; width:900px; height:100px; transform: translate3d(0, 3000px, 0px) rotateZ(90deg) scale(5); transform-style: preserve-3d;">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div style="position: absolute; transform-style: preserve-3d; transform: perspective(600px) scale(0.166667); ">
|
||||
<div style="position: absolute; background: yellow; width:900px; height:100px; transform: translate3d(0, 3000px, 0px) rotateZ(90deg) scale(5); transform-style: preserve-3d; opacity:0.3">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче