diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index fc6c2d510e0..f479e2a455b 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1262,8 +1262,7 @@ nsDisplayTableItem::GetBounds(nsDisplayListBuilder* aBuilder) { } PRBool -nsDisplayTableItem::IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder, - nsIFrame* aAncestorFrame) +nsDisplayTableItem::IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder) { if (!mPartHasFixedBackground) return PR_FALSE; @@ -1274,8 +1273,9 @@ nsDisplayTableItem::IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder, // will move relative to its viewport, which means this display item will // change when it is moved. If they are in different documents, we do not // want to return true because mFrame won't move relative to its viewport. - return mFrame == aAncestorFrame || - nsLayoutUtils::IsProperAncestorFrame(aAncestorFrame, mFrame); + nsIFrame* rootMover = aBuilder->GetRootMovingFrame(); + return mFrame == rootMover || + nsLayoutUtils::IsProperAncestorFrame(rootMover, mFrame); } /* static */ void diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 4de68e5735c..d0223998c9e 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -79,8 +79,7 @@ public: nsDisplayTableItem(nsIFrame* aFrame) : nsDisplayItem(aFrame), mPartHasFixedBackground(PR_FALSE) {} - virtual PRBool IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder, - nsIFrame* aAncestorFrame); + virtual PRBool IsVaryingRelativeToMovingFrame(nsDisplayListBuilder* aBuilder); // With collapsed borders, parts of the collapsed border can extend outside // the table part frames, so allow this display element to blow out to our // overflow rect. This is also useful for row frames that have spanning