Bug 564991. Part 35: Fix text decorations to have a unique GetPerFrameKey. r=tnikkel

This commit is contained in:
Robert O'Callahan 2010-07-16 09:08:10 +12:00
parent e98a518e3c
commit 4e94c263b7
3 changed files with 13 additions and 0 deletions

View File

@ -137,3 +137,8 @@ enum Type {
TYPE_MAX
};
enum {
// Number of bits needed to represent all types
TYPE_BITS = 8
};

View File

@ -96,6 +96,8 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
if (mIsBackgroundOnly) {
mBuildCaret = PR_FALSE;
}
PR_STATIC_ASSERT(nsDisplayItem::TYPE_MAX < (1 << nsDisplayItem::TYPE_BITS));
}
static void MarkFrameForDisplay(nsIFrame* aFrame, nsIFrame* aStopAtFrame) {

View File

@ -89,6 +89,12 @@ public:
nsIRenderingContext* aCtx);
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
NS_DISPLAY_DECL_NAME("TextDecoration", TYPE_TEXT_DECORATION)
virtual PRUint32 GetPerFrameKey()
{
return TYPE_TEXT_DECORATION | (mDecoration << TYPE_BITS);
}
private:
nsLineBox* mLine;
nscolor mColor;