diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 899e4896b0d..8786c28f38d 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -2094,11 +2094,12 @@ public: eXULBox = 1 << 10, eCanContainOverflowContainers = 1 << 11, eBlockFrame = 1 << 12, + eTablePart = 1 << 13, // If this bit is set, the frame doesn't allow ignorable whitespace as // children. For example, the whitespace between \n\n
// will be excluded during the construction of children. - eExcludesIgnorableWhitespace = 1 << 13, - eSupportsCSSTransforms = 1 << 14, + eExcludesIgnorableWhitespace = 1 << 14, + eSupportsCSSTransforms = 1 << 15, // These are to allow nsFrame::Init to assert that IsFrameOfType // implementations all call the base class method. They are only diff --git a/layout/style/ImageLoader.cpp b/layout/style/ImageLoader.cpp index 1c7bb7ead3c..edd47ba0993 100644 --- a/layout/style/ImageLoader.cpp +++ b/layout/style/ImageLoader.cpp @@ -342,7 +342,14 @@ ImageLoader::DoRedraw(FrameSet* aFrameSet) nsIFrame* frame = aFrameSet->ElementAt(i); if (frame->StyleVisibility()->IsVisible()) { - FrameLayerBuilder::IterateRetainedDataFor(frame, InvalidateImagesCallback); + if (frame->IsFrameOfType(nsIFrame::eTablePart)) { + // Tables don't necessarily build border/background display items + // for the individual table part frames, so IterateRetainedDataFor + // might not find the right display item. + frame->InvalidateFrame(); + } else { + FrameLayerBuilder::IterateRetainedDataFor(frame, InvalidateImagesCallback); + } } } } diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h index 00ce5b4b8bd..12bcf230e08 100644 --- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -210,6 +210,11 @@ public: nsPoint aPt); virtual bool UpdateOverflow(); + + virtual bool IsFrameOfType(uint32_t aFlags) const + { + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart)); + } virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; diff --git a/layout/tables/nsTableColFrame.h b/layout/tables/nsTableColFrame.h index ace895e927e..686d62a6800 100644 --- a/layout/tables/nsTableColFrame.h +++ b/layout/tables/nsTableColFrame.h @@ -263,6 +263,11 @@ public: nscoord GetFinalWidth() { return mFinalWidth; } + + virtual bool IsFrameOfType(uint32_t aFlags) const + { + return nsSplittableFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart)); + } virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; diff --git a/layout/tables/nsTableColGroupFrame.h b/layout/tables/nsTableColGroupFrame.h index 5daa8cfbd6b..6f569b974a8 100644 --- a/layout/tables/nsTableColGroupFrame.h +++ b/layout/tables/nsTableColGroupFrame.h @@ -196,6 +196,11 @@ public: */ void SetContinuousBCBorderWidth(uint8_t aForSide, BCPixelSize aPixelValue); + + virtual bool IsFrameOfType(uint32_t aFlags) const + { + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart)); + } virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; diff --git a/layout/tables/nsTableRowFrame.h b/layout/tables/nsTableRowFrame.h index 9b551771b78..4602f53e23f 100644 --- a/layout/tables/nsTableRowFrame.h +++ b/layout/tables/nsTableRowFrame.h @@ -224,6 +224,11 @@ public: void SetContinuousBCBorderWidth(uint8_t aForSide, BCPixelSize aPixelValue); + virtual bool IsFrameOfType(uint32_t aFlags) const + { + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart)); + } + virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); } diff --git a/layout/tables/nsTableRowGroupFrame.h b/layout/tables/nsTableRowGroupFrame.h index 49ba19fcc87..8aa75e95ef9 100644 --- a/layout/tables/nsTableRowGroupFrame.h +++ b/layout/tables/nsTableRowGroupFrame.h @@ -325,6 +325,11 @@ public: virtual nsILineIterator* GetLineIterator() { return this; } + virtual bool IsFrameOfType(uint32_t aFlags) const + { + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eTablePart)); + } + virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); }