Bug 844750 - Don't use per-display-item invalidation for table frames. r=roc

This commit is contained in:
Matt Woodrow 2013-03-08 15:18:45 +13:00
parent 6c74aeb4d4
commit 981f3ba59b
7 changed files with 36 additions and 3 deletions

View File

@ -2094,11 +2094,12 @@ public:
eXULBox = 1 << 10, eXULBox = 1 << 10,
eCanContainOverflowContainers = 1 << 11, eCanContainOverflowContainers = 1 << 11,
eBlockFrame = 1 << 12, eBlockFrame = 1 << 12,
eTablePart = 1 << 13,
// If this bit is set, the frame doesn't allow ignorable whitespace as // If this bit is set, the frame doesn't allow ignorable whitespace as
// children. For example, the whitespace between <table>\n<tr>\n<td> // children. For example, the whitespace between <table>\n<tr>\n<td>
// will be excluded during the construction of children. // will be excluded during the construction of children.
eExcludesIgnorableWhitespace = 1 << 13, eExcludesIgnorableWhitespace = 1 << 14,
eSupportsCSSTransforms = 1 << 14, eSupportsCSSTransforms = 1 << 15,
// These are to allow nsFrame::Init to assert that IsFrameOfType // These are to allow nsFrame::Init to assert that IsFrameOfType
// implementations all call the base class method. They are only // implementations all call the base class method. They are only

View File

@ -342,7 +342,14 @@ ImageLoader::DoRedraw(FrameSet* aFrameSet)
nsIFrame* frame = aFrameSet->ElementAt(i); nsIFrame* frame = aFrameSet->ElementAt(i);
if (frame->StyleVisibility()->IsVisible()) { 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);
}
} }
} }
} }

View File

@ -210,6 +210,11 @@ public:
nsPoint aPt); nsPoint aPt);
virtual bool UpdateOverflow(); 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 InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;

View File

@ -263,6 +263,11 @@ public:
nscoord GetFinalWidth() { nscoord GetFinalWidth() {
return mFinalWidth; 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 InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;

View File

@ -196,6 +196,11 @@ public:
*/ */
void SetContinuousBCBorderWidth(uint8_t aForSide, void SetContinuousBCBorderWidth(uint8_t aForSide,
BCPixelSize aPixelValue); 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 InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;

View File

@ -224,6 +224,11 @@ public:
void SetContinuousBCBorderWidth(uint8_t aForSide, void SetContinuousBCBorderWidth(uint8_t aForSide,
BCPixelSize aPixelValue); 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 InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); } virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); }

View File

@ -325,6 +325,11 @@ public:
virtual nsILineIterator* GetLineIterator() { return this; } 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 InvalidateFrame(uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE; virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) MOZ_OVERRIDE;
virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); } virtual void InvalidateFrameForRemoval() MOZ_OVERRIDE { InvalidateFrameSubtree(); }