From 10471e9231df498353391607d772d64c9b4d7142 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 22 Dec 2014 16:09:32 +1300 Subject: [PATCH] Bug 1111753. Don't restrict the dirty rect stored for display items for out-of-flow elements to their visual overflow areas. r=tn --- layout/base/nsDisplayList.cpp | 4 +++ layout/base/nsDisplayList.h | 12 +++++++++ layout/reftests/bugs/1111753-1.html | 38 +++++++++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 1 + 4 files changed, 55 insertions(+) create mode 100644 layout/reftests/bugs/1111753-1.html diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index e3c7d1fc85ae1..1fe9045707781 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -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); diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index f83130bcd07bf..808387d79d902 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2685,6 +2685,7 @@ class nsDisplayWrapList : public nsDisplayItem { : nsDisplayItem(aBuilder, aFrame), mOverrideZIndex(0), mHasZIndexOverride(false) { MOZ_COUNT_CTOR(nsDisplayWrapList); + mBaseVisibleRect = mVisibleRect; } virtual ~nsDisplayWrapList(); /** @@ -2693,6 +2694,14 @@ class nsDisplayWrapList : public nsDisplayItem { 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 *aOutFrames) MOZ_OVERRIDE; @@ -2787,6 +2796,9 @@ class nsDisplayWrapList : public nsDisplayItem { // this item's own frame. nsTArray 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; }; diff --git a/layout/reftests/bugs/1111753-1.html b/layout/reftests/bugs/1111753-1.html new file mode 100644 index 0000000000000..2b5f267fe2a05 --- /dev/null +++ b/layout/reftests/bugs/1111753-1.html @@ -0,0 +1,38 @@ + + + + + + +
+
+

ABCDEFG

+
+ + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 52c2e10f6bd53..34ac007a46e43 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -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