Bug 584282. Add nsDisplayItem::mToReferenceFrame and initialize it in the constructor. r=tnikkel,a=dbaron

This commit is contained in:
Robert O'Callahan
2010-08-13 22:01:13 +12:00
parent 23cb3c01d8
commit 6994544c46
49 changed files with 354 additions and 266 deletions

View File

@@ -385,7 +385,9 @@ nsTableCellFrame::PaintCellBackground(nsIRenderingContext& aRenderingContext,
class nsDisplayTableCellBackground : public nsDisplayTableItem {
public:
nsDisplayTableCellBackground(nsTableCellFrame* aFrame) : nsDisplayTableItem(aFrame) {
nsDisplayTableCellBackground(nsDisplayListBuilder* aBuilder,
nsTableCellFrame* aFrame) :
nsDisplayTableItem(aBuilder, aFrame) {
MOZ_COUNT_CTOR(nsDisplayTableCellBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@@ -458,8 +460,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// display outset box-shadows if we need to.
PRBool hasBoxShadow = !!(GetStyleBorder()->mBoxShadow);
if (hasBoxShadow) {
nsDisplayItem* item = new (aBuilder) nsDisplayBoxShadowOuter(this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -470,7 +472,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// The cell background was not painted by the nsTablePainter,
// so we need to do it. We have special background processing here
// so we need to duplicate some code from nsFrame::DisplayBorderBackgroundOutline
nsDisplayTableItem* item = new (aBuilder) nsDisplayTableCellBackground(this);
nsDisplayTableItem* item =
new (aBuilder) nsDisplayTableCellBackground(aBuilder, this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
NS_ENSURE_SUCCESS(rv, rv);
item->UpdateForFrameBackground(this);
@@ -478,8 +481,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// display inset box-shadows if we need to.
if (hasBoxShadow) {
nsDisplayItem* item = new (aBuilder) nsDisplayBoxShadowInner(this);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
nsresult rv = aLists.BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -487,7 +490,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!tableFrame->IsBorderCollapse() && HasBorder() &&
emptyCellStyle == NS_STYLE_TABLE_EMPTY_CELLS_SHOW) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBorder(this));
nsDisplayBorder(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -496,7 +499,8 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
(GetStateBits() & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT;
if (isSelected) {
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(this, ::PaintTableCellSelection, "TableCellSelection",
nsDisplayGeneric(aBuilder, this, ::PaintTableCellSelection,
"TableCellSelection",
nsDisplayItem::TYPE_TABLE_CELL_SELECTION));
NS_ENSURE_SUCCESS(rv, rv);
}