Bug 1111753. Don't restrict the dirty rect stored for display items for out-of-flow elements to their visual overflow areas. r=tn

This commit is contained in:
Robert O'Callahan 2014-12-22 16:09:32 +13:00
parent 5b8f00360b
commit ef69860b7b
4 changed files with 55 additions and 0 deletions

View File

@ -3393,6 +3393,8 @@ nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
{
MOZ_COUNT_CTOR(nsDisplayWrapList);
mBaseVisibleRect = mVisibleRect;
mList.AppendToTop(aList);
UpdateBounds(aBuilder);
@ -3441,6 +3443,8 @@ nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
{
MOZ_COUNT_CTOR(nsDisplayWrapList);
mBaseVisibleRect = mVisibleRect;
mList.AppendToTop(aItem);
UpdateBounds(aBuilder);

View File

@ -2685,6 +2685,7 @@ public:
: nsDisplayItem(aBuilder, aFrame), mOverrideZIndex(0), mHasZIndexOverride(false)
{
MOZ_COUNT_CTOR(nsDisplayWrapList);
mBaseVisibleRect = mVisibleRect;
}
virtual ~nsDisplayWrapList();
/**
@ -2693,6 +2694,14 @@ public:
virtual void UpdateBounds(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE
{
mBounds = mList.GetBounds(aBuilder);
// The display list may contain content that's visible outside the visible
// rect (i.e. the current dirty rect) passed in when the item was created.
// This happens when the dirty rect has been restricted to the visual
// overflow rect of a frame for some reason (e.g. when setting up dirty
// rects in nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay), but that
// frame contains placeholders for out-of-flows that aren't descendants of
// the frame.
mVisibleRect.UnionRect(mBaseVisibleRect, mList.GetVisibleRect());
}
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames) MOZ_OVERRIDE;
@ -2787,6 +2796,9 @@ protected:
// this item's own frame.
nsTArray<nsIFrame*> mMergedFrames;
nsRect mBounds;
// Visible rect contributed by this display item itself.
// Our mVisibleRect may include the visible areas of children.
nsRect mBaseVisibleRect;
int32_t mOverrideZIndex;
bool mHasZIndexOverride;
};

View File

@ -0,0 +1,38 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<head>
<style>
#d2 {
opacity:0;
transition:all 0.2s;
position:absolute;
}
#d2.active {
opacity:1;
}
#image {
position:fixed;
width:100%;
height:100%;
background:blue;
left:0;
top:0;
}
</style>
</head>
<body>
<div id="d2" class="active">
<div id="image"></div>
<h2>ABCDEFG</h2>
</div>
<script>
function doTest() {
d2.addEventListener("transitionend", function() {
document.documentElement.removeAttribute("class");
});
d2.classList.toggle("active");
}
window.addEventListener("MozReftestInvalidate", doTest);
</script>
</body>
</html>

View File

@ -1853,3 +1853,4 @@ fuzzy-if(winWidget&&!layersGPUAccelerated,1,31) fuzzy-if(B2G,128,75) == 1081185-
== 1103258-1.html 1103258-1-ref.html # assertion crash test with layers culling test
== 1105137-1.html 1105137-1-ref.html
fuzzy-if(d2d,36,304) HTTP(..) == 1116480-1-fakeitalic-overflow.html 1116480-1-fakeitalic-overflow-ref.html
== 1111753-1.html about:blank